HandleAffairsCommonMapper.xml
4.77 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
<?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.HandleAffairsCommonMapper">
<resultMap type="HandleAffairsCommon" id="HandleAffairsCommonResult">
<result property="id" column="id" />
<result property="company" column="company" />
<result property="receiveTime" column="receive_time" />
<result property="title" column="title" />
<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="selectHandleAffairsCommonVo">
select id, company, receive_time, title, dept_opinion, zhb_opinion, is_read, status, create_time, create_by, update_time, update_by from office_handle_affairs_common
</sql>
<select id="selectHandleAffairsCommonList" parameterType="HandleAffairsCommon" resultMap="HandleAffairsCommonResult">
<include refid="selectHandleAffairsCommonVo"/>
<where>
<if test="company != null and company != ''"> and company = #{company}</if>
<if test="receiveTime != null "> and receive_time = #{receiveTime}</if>
<if test="title != null and title != ''"> and title = #{title}</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="selectHandleAffairsCommonById" parameterType="Long" resultMap="HandleAffairsCommonResult">
<include refid="selectHandleAffairsCommonVo"/>
where id = #{id}
</select>
<insert id="insertHandleAffairsCommon" parameterType="HandleAffairsCommon" useGeneratedKeys="true" keyProperty="id">
insert into office_handle_affairs_common
<trim prefix="(" suffix=")" suffixOverrides=",">
create_time,
<if test="company != null">company,</if>
<if test="receiveTime != null">receive_time,</if>
<if test="title != null">title,</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="createBy != null">create_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
now(),
<if test="company != null">#{company},</if>
<if test="receiveTime != null">#{receiveTime},</if>
<if test="title != null">#{title},</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="updateHandleAffairsCommon" parameterType="HandleAffairsCommon">
update office_handle_affairs_common
<trim prefix="SET" suffixOverrides=",">
update_time = now(),
<if test="company != null">company = #{company},</if>
<if test="receiveTime != null">receive_time = #{receiveTime},</if>
<if test="title != null">title = #{title},</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="deleteHandleAffairsCommonById" parameterType="Long">
delete from office_handle_affairs_common where id = #{id}
</delete>
<delete id="deleteHandleAffairsCommonByIds" parameterType="String">
delete from office_handle_affairs_common where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>