ProcessTemplateMapper.xml
4.94 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
<?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.chinagas.modules.zjwjsb.mapper.ProcessTemplateMapper">
<select id="selectTemplateList" resultType="ProcessTemplate">
select template_id,template_name,upload_period,process_type,biz_type,parent_id,type,ancestors from zjwjsb_process_template
where del_flag = '0' and type = 'P'
</select>
<select id="selectProcessTemplateList" resultType="ProcessTemplate">
select template_id,template_name,upload_period,process_type,biz_type,parent_id,type,ancestors from zjwjsb_process_template
where del_flag = '0'
<if test="templateId != null and templateId != ''">
and template_id = #{templateId}
</if>
<if test="templateName != null and templateName != ''">
and template_name = #{templateName}
</if>
<if test="uploadPeriod != null and uploadPeriod != ''">
and upload_period = #{uploadPeriod}
</if>
<if test="processType != null and processType != ''">
and process_type = #{processType}
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
</if>
</select>
<insert id="insertProcessTemplate" parameterType="ProcessTemplate">
insert into zjwjsb_process_template(
<!-- <if test=" templateId != null and templateId != ''">template_id,</if>-->
<if test=" templateName != null and templateName != ''">template_name,</if>
<if test=" uploadPeriod != null and uploadPeriod != ''">upload_period,</if>
<if test="processType != null and processType != ''">
process_type,
</if>
<if test="parentId != null and parentId != ''">
parent_id,
</if>
<if test="type != null and type != ''">
type,
</if>
<if test="ancestors != null and ancestors != ''">
ancestors,
</if>
biz_type,
create_by,
create_time
) values(
<if test=" templateId != null and templateId != ''">#{templateId },</if>
<if test=" templateName != null and templateName != ''">#{templateName},</if>
<if test=" uploadPeriod != null and uploadPeriod != ''">#{uploadPeriod},</if>
<if test="processType != null and processType != ''">
#{processType},
</if>
<if test="parentId != null and parentId != ''">
#{parentId},
</if>
<if test="type != null and type != ''">
#{type},
</if>
<if test="ancestors != null and ancestors != ''">
#{ancestors},
</if>
#{bizType},
#{createBy},
sysdate()
)
</insert>
<update id="updateProcessTemplate" parameterType="ProcessTemplate">
update zjwjsb_process_template set
<if test=" templateName != null and templateName != ''">template_name=#{templateName},</if>
<if test=" updateBy != null and updateBy != ''">template_name=#{templateName},</if>
<if test=" uploadPeriod != null and uploadPeriod != ''">upload_period=#{uploadPeriod},</if>
<if test="processType != null and processType != ''">
process_type = #{processType},
</if>
<if test="parentId != null and parentId != ''">
parent_id = #{parentId},
</if>
<if test="type != null and type != ''">
type = #{type},
</if>
<if test="ancestors != null and ancestors != ''">
ancestors = #{ancestors},
</if>
<if test="bizType != null and bizType != ''">
biz_type = #{bizType},
</if>
update_time = sysdate()
where template_id=#{templateId}
</update>
<update id="deleteProcessTemplateById" parameterType="Long">
update zjwjsb_process_template set del_flag = '1' where template_id = #{templateId}
</update>
<select id="selectProcessTemplateById" parameterType="Long" resultType="ProcessTemplate">
select template_id,template_name,upload_period,process_type,biz_type,parent_Id,type,ancestors from zjwjsb_process_template
where del_flag = '0' and template_id=#{templateId}
</select>
<select id="selectProcessType" resultType="ProcessTemplate">
select template_id,template_name,parent_id,type,ancestors from zjwjsb_process_template
where del_flag = '0' and type = 'T'
</select>
</mapper>