ViolationWarningInformationMapper.xml
6.81 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
115
116
117
<?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.casefile.mapper.ViolationWarningInformationMapper">
<resultMap type="ViolationWarningInformation" id="ViolationWarningInformationResult">
<result property="id" column="id" />
<result property="number" column="number" />
<result property="violationObjectType" column="violation_object_type" />
<result property="owningRegion" column="owning_region" />
<result property="violationType" column="violation_type" />
<result property="violationGrade" column="violation_grade" />
<result property="projectName" column="project_name" />
<result property="companyName" column="company_name" />
<result property="describe" column="describe" />
<result property="sendObject" column="send_object" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="status" column="status" />
<result property="receive" column="receive" />
<result property="receiveStatus" column="receive_status" />
<result property="readBy" column="read_by" />
<result property="readTime" column="read_time" />
</resultMap>
<sql id="selectViolationWarningInformationVo">
select id, `number`, violation_object_type, owning_region, violation_type, violation_grade, project_name, company_name, `describe`, send_object, create_time, create_by, update_time, update_by, status, receive, receive_status, read_by, read_time from casefile_violation_warning_information
</sql>
<select id="selectViolationWarningInformationList" parameterType="ViolationWarningInformation" resultMap="ViolationWarningInformationResult">
<include refid="selectViolationWarningInformationVo"/>
<where>
<if test="number != null and number != ''"> and `number` = #{number}</if>
<if test="violationObjectType != null and violationObjectType != ''"> and violation_object_type = #{violationObjectType}</if>
<if test="owningRegion != null and owningRegion != ''"> and owning_region = #{owningRegion}</if>
<if test="violationType != null and violationType != ''"> and violation_type = #{violationType}</if>
<if test="violationGrade != null and violationGrade != ''"> and violation_grade = #{violationGrade}</if>
<if test="projectName != null and projectName != ''"> and project_name like concat('%', #{projectName}, '%')</if>
<if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
</where>
</select>
<select id="selectViolationWarningInformationById" parameterType="Long" resultMap="ViolationWarningInformationResult">
<include refid="selectViolationWarningInformationVo"/>
where id = #{id}
</select>
<insert id="insertViolationWarningInformation" parameterType="ViolationWarningInformation" useGeneratedKeys="true" keyProperty="id">
insert into casefile_violation_warning_information
<trim prefix="(" suffix=")" suffixOverrides=",">
create_time,
<if test="number != null">`number`,</if>
<if test="violationObjectType != null">violation_object_type,</if>
<if test="owningRegion != null">owning_region,</if>
<if test="violationType != null">violation_type,</if>
<if test="violationGrade != null">violation_grade,</if>
<if test="projectName != null">project_name,</if>
<if test="companyName != null">company_name,</if>
<if test="describe != null">`describe`,</if>
<if test="sendObject != null">send_object,</if>
<if test="createBy != null">create_by,</if>
<if test="status != null">status,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
now(),
<if test="number != null">#{number},</if>
<if test="violationObjectType != null">#{violationObjectType},</if>
<if test="owningRegion != null">#{owningRegion},</if>
<if test="violationType != null">#{violationType},</if>
<if test="violationGrade != null">#{violationGrade},</if>
<if test="projectName != null">#{projectName},</if>
<if test="companyName != null">#{companyName},</if>
<if test="describe != null">#{describe},</if>
<if test="sendObject != null">#{sendObject},</if>
<if test="createBy != null">#{createBy},</if>
<if test="status != null">#{status},</if>
</trim>
</insert>
<update id="updateViolationWarningInformation" parameterType="ViolationWarningInformation">
update casefile_violation_warning_information
<trim prefix="SET" suffixOverrides=",">
update_time = now(),
<if test="number != null">`number` = #{number},</if>
<if test="violationObjectType != null">violation_object_type = #{violationObjectType},</if>
<if test="owningRegion != null">owning_region = #{owningRegion},</if>
<if test="violationType != null">violation_type = #{violationType},</if>
<if test="violationGrade != null">violation_grade = #{violationGrade},</if>
<if test="projectName != null">project_name = #{projectName},</if>
<if test="companyName != null">company_name = #{companyName},</if>
<if test="describe != null">`describe` = #{describe},</if>
<if test="sendObject != null">send_object = #{sendObject},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="status != null">status = #{status},</if>
<if test="receive != null">receive = #{receive},</if>
<if test="receiveStatus != null">receive_status = #{receiveStatus},</if>
<if test="readBy != null">read_by = #{readBy},</if>
<if test="readTime != null">read_time = #{readTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteViolationWarningInformationById" parameterType="Long">
delete from casefile_violation_warning_information where id = #{id}
</delete>
<delete id="deleteViolationWarningInformationByIds" parameterType="String">
delete from casefile_violation_warning_information where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>