<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fzm.mall.server.admin.auth_center.mapper.AdminRoleMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.fzm.mall.server.admin.auth_center.model.AdminRole">
        <id column="id" property="id"/>
        <result column="role_id" property="roleId"/>
        <result column="role_name" property="roleName"/>
        <result column="type" property="type"/>
        <result column="status" property="status"/>
        <result column="auth_json" property="authJson"/>
        <result column="remarks" property="remarks"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
    </resultMap>

    <select id="page" resultType="com.fzm.mall.server.admin.auth_center.entity.vo.AdminRoleVO">
        SELECT
        role_id,role_name,remarks,create_time,type,status,auth_json
        FROM
        admin_role
        <where>
            <if test="roleId!=null and roleId!=''">
                role_id = #{roleId}
            </if>
            <if test="roleName!=null and roleName!=''">
                AND
                role_name = #{roleName}
            </if>
            AND
            status != 0
            AND
            type not in (1,2,3)
        </where>
        ORDER BY
        create_time
        DESC
    </select>
</mapper>
