HandleAffairsXfMapper.xml
4.87 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
<?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.trash.office.mapper.HandleAffairsXfMapper">
<resultMap type="HandleAffairsXf" id="HandleAffairsXfResult">
<result property="id" column="id" />
<result property="company" column="company" />
<result property="receiveDate" column="receive_date" />
<result property="appeal" column="appeal" />
<result property="deptOpinion" column="dept_opinion" />
<result property="zhbOpinion" column="zhb_opinion" />
<result property="isRead" column="is_read" />
<result property="status" column="status" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
</resultMap>
<sql id="selectHandleAffairsXfVo">
select id, company, receive_date, appeal, dept_opinion, zhb_opinion, is_read, status, create_time, create_by, update_time, update_by from office_handle_affairs_xf
</sql>
<select id="selectHandleAffairsXfList" parameterType="HandleAffairsXf" resultMap="HandleAffairsXfResult">
<include refid="selectHandleAffairsXfVo"/>
<where>
<if test="company != null and company != ''"> and company = #{company}</if>
<if test="receiveDate != null "> and receive_date = #{receiveDate}</if>
<if test="appeal != null and appeal != ''"> and appeal = #{appeal}</if>
<if test="deptOpinion != null and deptOpinion != ''"> and dept_opinion = #{deptOpinion}</if>
<if test="zhbOpinion != null and zhbOpinion != ''"> and zhb_opinion = #{zhbOpinion}</if>
<if test="isRead != null "> and is_read = #{isRead}</if>
<if test="status != null "> and status = #{status}</if>
</where>
</select>
<select id="selectHandleAffairsXfById" parameterType="Long" resultMap="HandleAffairsXfResult">
<include refid="selectHandleAffairsXfVo"/>
where id = #{id}
</select>
<insert id="insertHandleAffairsXf" parameterType="HandleAffairsXf" useGeneratedKeys="true" keyProperty="id">
insert into office_handle_affairs_xf
<trim prefix="(" suffix=")" suffixOverrides=",">
create_time,
<if test="company != null">company,</if>
<if test="receiveDate != null">receive_date,</if>
<if test="appeal != null">appeal,</if>
<if test="deptOpinion != null">dept_opinion,</if>
<if test="zhbOpinion != null">zhb_opinion,</if>
<if test="isRead != null">is_read,</if>
<if test="status != null">status,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
now(),
<if test="company != null">#{company},</if>
<if test="receiveDate != null">#{receiveDate},</if>
<if test="appeal != null">#{appeal},</if>
<if test="deptOpinion != null">#{deptOpinion},</if>
<if test="zhbOpinion != null">#{zhbOpinion},</if>
<if test="isRead != null">#{isRead},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
</trim>
</insert>
<update id="updateHandleAffairsXf" parameterType="HandleAffairsXf">
update office_handle_affairs_xf
<trim prefix="SET" suffixOverrides=",">
update_time = now(),
<if test="company != null">company = #{company},</if>
<if test="receiveDate != null">receive_date = #{receiveDate},</if>
<if test="appeal != null">appeal = #{appeal},</if>
<if test="deptOpinion != null">dept_opinion = #{deptOpinion},</if>
<if test="zhbOpinion != null">zhb_opinion = #{zhbOpinion},</if>
<if test="isRead != null">is_read = #{isRead},</if>
<if test="status != null">status = #{status},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHandleAffairsXfById" parameterType="Long">
delete from office_handle_affairs_xf where id = #{id}
</delete>
<delete id="deleteHandleAffairsXfByIds" parameterType="String">
delete from office_handle_affairs_xf where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>