CreditScreenSetMapper.xml
3.76 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
<?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.CreditScreenSetMapper">
<resultMap type="CreditScreenSet" id="CreditScreenSetResult">
<result property="id" column="id" />
<result property="type" column="type" />
<result property="wsh" column="wsh" />
<result property="screenWsh" column="screen_wsh" />
<result property="deptName" column="dept_name" />
<result property="deptId" column="dept_id" />
<result property="creditTime" column="credit_time" />
</resultMap>
<sql id="selectCreditScreenSetVo">
select id, type, wsh, screen_wsh, dept_name, dept_id, credit_time from credit_screen_set
</sql>
<select id="selectCreditScreenSetList" parameterType="CreditScreenSet" resultMap="CreditScreenSetResult">
<include refid="selectCreditScreenSetVo"/>
<where>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="wsh != null and wsh != ''"> and wsh = #{wsh}</if>
<if test="screenWsh != null and screenWsh != ''"> and screen_wsh = #{screenWsh}</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>
<if test="creditTime != null "> and credit_time = #{creditTime}</if>
</where>
</select>
<select id="selectCreditScreenSetById" parameterType="Long" resultMap="CreditScreenSetResult">
<include refid="selectCreditScreenSetVo"/>
where id = #{id}
</select>
<insert id="insertCreditScreenSet" parameterType="CreditScreenSet" useGeneratedKeys="true" keyProperty="id">
insert into credit_screen_set
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="type != null">type,</if>
<if test="wsh != null">wsh,</if>
<if test="screenWsh != null and screenWsh != ''">screen_wsh,</if>
<if test="deptName != null">dept_name,</if>
<if test="deptId != null">dept_id,</if>
<if test="creditTime != null">credit_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="type != null">#{type},</if>
<if test="wsh != null">#{wsh},</if>
<if test="screenWsh != null and screenWsh != ''">#{screenWsh},</if>
<if test="deptName != null">#{deptName},</if>
<if test="deptId != null">#{deptId},</if>
<if test="creditTime != null">#{creditTime},</if>
</trim>
</insert>
<update id="updateCreditScreenSet" parameterType="CreditScreenSet">
update credit_screen_set
<trim prefix="SET" suffixOverrides=",">
<if test="type != null">type = #{type},</if>
<if test="wsh != null">wsh = #{wsh},</if>
<if test="screenWsh != null and screenWsh != ''">screen_wsh = #{screenWsh},</if>
<if test="deptName != null">dept_name = #{deptName},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="creditTime != null">credit_time = #{creditTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteCreditScreenSetById" parameterType="Long">
delete from credit_screen_set where id = #{id}
</delete>
<delete id="deleteCreditScreenSetByIds" parameterType="String">
delete from credit_screen_set where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>