AcademyRoleDictMapper.xml
1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?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>