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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?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="cn.wisenergy.chnmuseum.party.mapper.AuditMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.wisenergy.chnmuseum.party.model.Audit">
<id column="id" property="id"/>
<result column="content" property="content"/>
<result column="organ_id" property="organId"/>
<result column="ref_item_id" property="refItemId"/>
<result column="user_id" property="userId"/>
<result column="type" property="type"/>
<result column="operation" property="operation"/>
<result column="status" property="status"/>
<result column="create_time" property="createTime"/>
<result column="first_time" property="firstTime"/>
<result column="second_time" property="secondTime"/>
<result column="is_deleted" property="deleted"/>
<result column="first_remarks" property="firstRemarks"/>
<result column="second_remarks" property="secondRemarks"/>
<result column="level" property="level"/>
</resultMap>
<select id="getUserList" resultMap="BaseResultMap">
select a.*,o.name org_name,u.user_name user_name
from t_audit a
left join t_organ o on o.id = a.organ_id
left join t_user u on u.id = a.user_id
where 1 = 1
<if test="user.userName != null and user.userName != ''">
and (u.user_name LIKE concat('%', #{user.userName}, '%') or a.content LIKE concat('%', #{user.userName},
'%'))
</if>
<if test="user.status != null and user.status != ''">
and a.status = #{user.status}
</if>
<if test="user.auditStatus != null and user.auditStatus != ''">
and a.level = #{user.auditStatus}
</if>
<if test="user.orgCode != null and user.orgCode != ''">
and o.code LIKE concat(#{user.orgCode}, '%')
</if>
and a.is_deleted = false
and a.type = 'ACCOUNT'
and a.operation = 'DISABLE'
order by a.create_time desc
</select>
<select id="getVideoContentPage" resultType="cn.wisenergy.chnmuseum.party.model.Audit">
SELECT
a.*, b.`name`, c.user_name AS userName
FROM
t_audit a
LEFT JOIN video_content b ON a.ref_item_id = b.id
LEFT JOIN t_user c ON a.user_id = c.id
${ew.customSqlSegment}
</select>
<select id="getExhibitionBoardPage" resultType="cn.wisenergy.chnmuseum.party.model.Audit">
SELECT
a.*,b.`name`,c.user_name AS userName
FROM
t_audit a
LEFT JOIN exhibition_board b ON a.ref_item_id=b.id
LEFT JOIN t_user c ON a.user_id = c.id
${ew.customSqlSegment}
</select>
<select id="getLearningContentPage" resultType="cn.wisenergy.chnmuseum.party.model.Audit">
SELECT
a.*,b.`name`,c.user_name AS userName
FROM
t_audit a
LEFT JOIN learning_content b ON a.ref_item_id=b.id
LEFT JOIN t_user c ON a.user_id = c.id
${ew.customSqlSegment}
</select>
</mapper>