CreditMonitorMapper.xml
5.93 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
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?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.credit.cy.business.mapper.CreditMonitorMapper">
<resultMap type="CreditMonitor" id="CreditMonitorResult">
<result property="parentId" column="parent_id" />
<result property="reportNo" column="report_no" />
<result property="checkStatus" column="check_status" />
<result property="reportFeedback" column="report_feedback" />
<result property="reportDeadline" column="report_deadline" />
<result property="reportDate" column="report_date" />
<result property="reportDept" column="report_dept" />
<result property="reportOperate" column="report_operate" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectCreditMonitorVo">
select parent_id, report_no, check_status, report_feedback, report_deadline, report_date, report_dept, report_operate, create_by, create_time, update_by, update_time, del_flag from credit_monitor
</sql>
<select id="selectCreditMonitorList" parameterType="CreditMonitor" resultMap="CreditMonitorResult">
<include refid="selectCreditMonitorVo"/>
<where>
<if test="reportNo != null and reportNo != ''"> and report_no = #{reportNo}</if>
<if test="checkStatus != null"> and check_status = #{checkStatus}</if>
<if test="reportFeedback != null and reportFeedback != ''"> and report_feedback = #{reportFeedback}</if>
<if test="reportDeadline != null "> and report_deadline = #{reportDeadline}</if>
<if test="reportDate != null "> and report_date = #{reportDate}</if>
<if test="reportDept != null and reportDept != ''"> and report_dept = #{reportDept}</if>
<if test="reportOperate != null "> and report_operate = #{reportOperate}</if>
</where>
</select>
<select id="selectCreditMonitorByParentId" parameterType="Long" resultMap="CreditMonitorResult">
<include refid="selectCreditMonitorVo"/>
where parent_id = #{parentId}
</select>
<insert id="insertCreditMonitor" parameterType="CreditMonitor" useGeneratedKeys="true" keyProperty="parentId">
insert into credit_monitor
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="reportNo != null">report_no,</if>
<if test="checkStatus != null">check_status,</if>
<if test="reportFeedback != null">report_feedback,</if>
<if test="reportDeadline != null">report_deadline,</if>
<if test="reportDate != null">report_date,</if>
<if test="reportDept != null">report_dept,</if>
<if test="reportOperate != null">report_operate,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="reportNo != null">#{reportNo},</if>
<if test="checkStatus != null">#{checkStatus},</if>
<if test="reportFeedback != null">#{reportFeedback},</if>
<if test="reportDeadline != null">#{reportDeadline},</if>
<if test="reportDate != null">#{reportDate},</if>
<if test="reportDept != null">#{reportDept},</if>
<if test="reportOperate != null">#{reportOperate},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateCreditMonitor" parameterType="CreditMonitor">
update credit_monitor
<trim prefix="SET" suffixOverrides=",">
<if test="checkStatus != null">check_status = #{checkStatus},</if>
<if test="reportFeedback != null">report_feedback = #{reportFeedback},</if>
<if test="reportDeadline != null">report_deadline = #{reportDeadline},</if>
<if test="reportDate != null">report_date = #{reportDate},</if>
<if test="reportOperate != null">report_operate = #{reportOperate},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where parent_id = #{parentId}
</update>
<delete id="deleteCreditMonitorByParentId" parameterType="Long">
delete from credit_monitor where parent_id = #{parentId}
</delete>
<delete id="deleteCreditMonitorByParentIds" parameterType="String">
delete from credit_monitor where parent_id in
<foreach item="parentId" collection="array" open="(" separator="," close=")">
#{parentId}
</foreach>
</delete>
<select id="selectCreditMonitorByReportNo" parameterType="String" resultMap="CreditMonitorResult">
<include refid="selectCreditMonitorVo"/>
where report_no = #{reportNo} and del_flag = 0
</select>
<update id="updateCreditMonitorOperate" parameterType="CreditMonitor">
update credit_monitor set report_operate = #{reportOperate},update_by = #{updateBy},update_time = #{updateTime}
where report_operate = 1 and del_flag = 0
</update>
</mapper>