MonitorReportWeeksMapper.xml
5.7 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
<?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.ruoyi.web.controller.monitorReportWeeks.mapper.MonitorReportWeeksMapper">
<resultMap type="MonitorReportWeeks" id="MonitorReportWeeksResult">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="executeDate" column="execute_date" />
<result property="highRisk" column="high_risk" />
<result property="mediumRisk" column="medium_risk" />
<result property="warning" column="warning" />
<result property="reminder" column="reminder" />
<result property="dataJson" column="data_json" />
<result property="createDate" column="create_date" />
<result property="createBy" column="create_by" />
<result property="typeJson" column="type_json" />
<result property="changeJson" column="change_json" />
<result property="countJson" column="count_json" />
</resultMap>
<sql id="selectMonitorReportWeeksVo">
select id, user_id, execute_date, high_risk, medium_risk, warning, reminder, data_json, create_date, create_by,type_json,change_json,count_json from monitor_report_weeks
</sql>
<select id="selectMonitorReportWeeksList" parameterType="MonitorReportWeeks" resultMap="MonitorReportWeeksResult">
<include refid="selectMonitorReportWeeksVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="executeDate != null and executeDate != '' "> and execute_date = #{executeDate}</if>
<if test="highRisk != null "> and high_risk = #{highRisk}</if>
<if test="mediumRisk != null "> and medium_risk = #{mediumRisk}</if>
<if test="warning != null "> and warning = #{warning}</if>
<if test="reminder != null "> and reminder = #{reminder}</if>
<if test="dataJson != null and dataJson != '' "> and data_json = #{dataJson}</if>
<if test="createDate != null "> and create_date = #{createDate}</if>
<if test="createBy != null and createBy != '' "> and create_by = #{createBy}</if>
</where>
</select>
<select id="selectMonitorReportWeeksById" parameterType="Integer" resultMap="MonitorReportWeeksResult">
<include refid="selectMonitorReportWeeksVo"/>
where id = #{id}
</select>
<insert id="insertMonitorReportWeeks" parameterType="MonitorReportWeeks" useGeneratedKeys="true" keyProperty="id">
insert into monitor_report_weeks
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null ">user_id,</if>
<if test="executeDate != null and executeDate != '' ">execute_date,</if>
<if test="highRisk != null ">high_risk,</if>
<if test="mediumRisk != null ">medium_risk,</if>
<if test="warning != null ">warning,</if>
<if test="reminder != null ">reminder,</if>
<if test="dataJson != null and dataJson != '' ">data_json,</if>
<if test="createDate != null ">create_date,</if>
<if test="createBy != null and createBy != '' ">create_by,</if>
<if test="typeJson != null and typeJson != '' ">type_json,</if>
<if test="changeJson != null and changeJson != '' ">change_json,</if>
<if test="countJson != null and countJson != '' ">count_json,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null ">#{userId},</if>
<if test="executeDate != null and executeDate != '' ">#{executeDate},</if>
<if test="highRisk != null ">#{highRisk},</if>
<if test="mediumRisk != null ">#{mediumRisk},</if>
<if test="warning != null ">#{warning},</if>
<if test="reminder != null ">#{reminder},</if>
<if test="dataJson != null and dataJson != '' ">#{dataJson},</if>
<if test="createDate != null ">#{createDate},</if>
<if test="createBy != null and createBy != '' ">#{createBy},</if>
<if test="typeJson != null and typeJson != '' ">#{typeJson},</if>
<if test="changeJson != null and changeJson != '' ">#{changeJson},</if>
<if test="countJson != null and countJson != '' ">#{countJson},</if>
</trim>
</insert>
<update id="updateMonitorReportWeeks" parameterType="MonitorReportWeeks">
update monitor_report_weeks
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null ">user_id = #{userId},</if>
<if test="executeDate != null and executeDate != '' ">execute_date = #{executeDate},</if>
<if test="highRisk != null ">high_risk = #{highRisk},</if>
<if test="mediumRisk != null ">medium_risk = #{mediumRisk},</if>
<if test="warning != null ">warning = #{warning},</if>
<if test="reminder != null ">reminder = #{reminder},</if>
<if test="dataJson != null and dataJson != '' ">data_json = #{dataJson},</if>
<if test="createDate != null ">create_date = #{createDate},</if>
<if test="createBy != null and createBy != '' ">create_by = #{createBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMonitorReportWeeksById" parameterType="Integer">
delete from monitor_report_weeks where id = #{id}
</delete>
<delete id="deleteMonitorReportWeeksByIds" parameterType="String">
delete from monitor_report_weeks where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>