AcademyRoleDictMapper.xml 1.42 KB
<?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.show.mapper.AcademyRoleDictMapper">

    <select id="roles" parameterType="long" resultType="com.show.model.AcademyRoleDictDO">
        SELECT
            *
        FROM
            academy_role_dict t
        WHERE
            t.delete_date IS NULL
            AND (
            t.academy_id = #{academyId}
            OR t.academy_id IS NULL)
            and t.id not in (4,5)
            <if test="academyId == 18">
               and t.id not in(6,8,9,10)
            </if>
    </select>

    <select id="checkRoles" resultType="com.show.model.AcademyRoleDictDO">
        SELECT
        *
        FROM
        academy_role_dict t
        WHERE
        t.delete_date IS NULL
        and t.academy_id = #{academyId}
        <if test="checkRole != null and checkRole != ''">
            and t.check_role like concat('%',#{checkRole} ,'%')
        </if>
    </select>

    <select id="rolesName" resultType="com.show.vo.work.NamesVO">
        select t.id,role name from academy_role_dict t where t.delete_date is null
        <if test="roleIds != null and roleIds.size>0">
            and t.id in
            <foreach collection="roleIds" item="item" index="index" open="(" close=")" separator=",">
                #{item}
            </foreach>
        </if>
    </select>
</mapper>