CreditScreenErrMapper.xml
5.45 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
113
114
<?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.CreditScreenErrMapper">
<resultMap type="CreditScreenErr" id="CreditScreenErrResult">
<result property="id" column="id" />
<result property="type" column="type" />
<result property="wsh" column="wsh" />
<result property="bz" column="bz" />
<result property="creditTime" column="credit_time" />
<result property="creditBy" column="credit_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="deptName" column="dept_name" />
<result property="deptId" column="dept_id" />
</resultMap>
<sql id="selectCreditScreenErrVo">
select id, type, wsh, bz, credit_time, credit_by, update_time, update_by, dept_name, dept_id from credit_screen_err
</sql>
<select id="selectCreditScreenErrList" parameterType="CreditScreenErr" resultMap="CreditScreenErrResult">
<include refid="selectCreditScreenErrVo"/>
<where>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="wsh != null and wsh != ''"> and wsh concat('%', #{wsh},'%')</if>
<if test="bz != null and bz != ''"> and bz = #{bz}</if>
<if test="creditTime != null "> and credit_time = #{creditTime}</if>
<if test="creditBy != null and creditBy != ''"> and credit_by = #{creditBy}</if>
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
<if test="deptId != null and deptId != ''"> and dept_id = #{deptId}</if>
</where>
</select>
<select id="queryCreditScreenErrList" parameterType="CreditScreenErr" resultMap="CreditScreenErrResult">
<include refid="selectCreditScreenErrVo"/>
<where>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="wsh != null and wsh != ''"> and wsh = #{wsh}</if>
<if test="bz != null and bz != ''"> and bz = #{bz}</if>
<if test="startTime!=null and startTime!=''">
and credit_time > #{startTime}
</if>
<if test="endTime!=null and endTime!=''">
and credit_time <=#{endTime}
</if>
<if test="creditBy != null and creditBy != ''"> and credit_by = #{creditBy}</if>
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
<if test="deptId != null and deptId != ''"> and dept_id = #{deptId}</if>
</where>
order by credit_time
</select>
<select id="selectCreditScreenErrById" parameterType="Long" resultMap="CreditScreenErrResult">
<include refid="selectCreditScreenErrVo"/>
where id = #{id}
</select>
<insert id="insertCreditScreenErr" parameterType="CreditScreenErr" useGeneratedKeys="true" keyProperty="id">
insert into credit_screen_err
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="type != null">type,</if>
<if test="wsh != null">wsh,</if>
<if test="bz != null">bz,</if>
<if test="creditTime != null">credit_time,</if>
<if test="creditBy != null">credit_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="deptName != null">dept_name,</if>
<if test="deptId != null">dept_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="type != null">#{type},</if>
<if test="wsh != null">#{wsh},</if>
<if test="bz != null">#{bz},</if>
<if test="creditTime != null">#{creditTime},</if>
<if test="creditBy != null">#{creditBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="deptName != null">#{deptName},</if>
<if test="deptId != null">#{deptId},</if>
</trim>
</insert>
<update id="updateCreditScreenErr" parameterType="CreditScreenErr">
update credit_screen_err
<trim prefix="SET" suffixOverrides=",">
<if test="type != null">type = #{type},</if>
<if test="wsh != null">wsh = #{wsh},</if>
<if test="bz != null">bz = #{bz},</if>
<if test="creditTime != null">credit_time = #{creditTime},</if>
<if test="creditBy != null">credit_by = #{creditBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="deptName != null">dept_name = #{deptName},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteCreditScreenErrById" parameterType="Long">
delete from credit_screen_err where id = #{id}
</delete>
<delete id="deleteCreditScreenErrByIds" parameterType="String">
delete from credit_screen_err where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>