NewBuildingItemMapper.xml
7.92 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?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.insight.mapper.NewBuildingItemMapper">
<resultMap type="com.chinagas.modules.insight.domian.NewBuildingItem" id="NewBuildingItemResult">
<result property="id" column="id" />
<result property="reportNo" column="report_no" />
<result property="fiscalYear" column="fiscal_year" />
<result property="buildingName" column="building_name" />
<result property="buildingType" column="building_type" />
<result property="developerName" column="developer_name" />
<result property="predictPipelineNumber" column="predict_pipeline_number" />
<result property="signTime" column="sign_time" />
<result property="predictInstallTime" column="predict_install_time" />
<result property="sysCtime" column="sys_ctime" />
<result property="sysUtime" column="sys_utime" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="deleteFlag" column="delete_flag" />
<result property="yearClassify" column="year_classify" />
</resultMap>
<sql id="selectNewBuildingItemVo">
select id, report_no, fiscal_year, building_name, building_type, developer_name, predict_pipeline_number,
sign_time, predict_install_time, sys_ctime, sys_utime, create_by, update_by,
delete_flag, year_classify from new_building_item
</sql>
<select id="selectNewBuildingItemList" parameterType="com.chinagas.modules.insight.domian.NewBuildingItem" resultMap="NewBuildingItemResult">
<include refid="selectNewBuildingItemVo"/>
<where>
<if test="reportNo != null and reportNo != ''"> and report_no = #{reportNo}</if>
<if test="fiscalYear != null "> and fiscal_year = #{fiscalYear}</if>
<if test="buildingName != null and buildingName != ''"> and building_name like concat('%', #{buildingName}, '%')</if>
<if test="buildingType != null and buildingType != ''"> and building_type = #{buildingType}</if>
<if test="developerName != null and developerName != ''"> and developer_name like concat('%', #{developerName}, '%')</if>
<if test="predictPipelineNumber != null "> and predict_pipeline_number = #{predictPipelineNumber}</if>
<if test="signTime != null and signTime != '' "> and sign_time = #{signTime}</if>
<if test="predictInstallTime != null and predictInstallTime != ''"> and predict_install_time = #{predictInstallTime}</if>
<if test="sysCtime != null "> and sys_ctime = #{sysCtime}</if>
<if test="sysUtime != null "> and sys_utime = #{sysUtime}</if>
<if test="yearClassify != null "> and year_classify = #{yearClassify}</if>
and delete_flag = 0
</where>
</select>
<select id="selectNewBuildingItemById" resultMap="NewBuildingItemResult">
<include refid="selectNewBuildingItemVo"/>
where report_no = #{reportNo}
and delete_flag = 0
</select>
<insert id="insertNewBuildingItem" parameterType="com.chinagas.modules.insight.domian.NewBuildingItem">
insert into new_building_item
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="reportNo != null and reportNo != ''">report_no,</if>
<if test="fiscalYear != null">fiscal_year,</if>
<if test="buildingName != null and buildingName != ''">building_name,</if>
<if test="buildingType != null and buildingType != ''">building_type,</if>
<if test="developerName != null and developerName != ''">developer_name,</if>
<if test="predictPipelineNumber != null">predict_pipeline_number,</if>
<if test="signTime != null and signTime != ''">sign_time,</if>
<if test="predictInstallTime != null and predictInstallTime != ''">predict_install_time,</if>
<if test="sysCtime != null">sys_ctime,</if>
<if test="sysUtime != null">sys_utime,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="deleteFlag != null">delete_flag,</if>
<if test="yearClassify != null">year_classify,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="reportNo != null and reportNo != ''">#{reportNo},</if>
<if test="fiscalYear != null">#{fiscalYear},</if>
<if test="buildingName != null and buildingName != ''">#{buildingName},</if>
<if test="buildingType != null and buildingType != ''">#{buildingType},</if>
<if test="developerName != null and developerName != ''">#{developerName},</if>
<if test="predictPipelineNumber != null">#{predictPipelineNumber},</if>
<if test="signTime != null and signTime != ''">#{signTime},</if>
<if test="predictInstallTime != null and predictInstallTime != ''">#{predictInstallTime},</if>
<if test="sysCtime != null">#{sysCtime},</if>
<if test="sysUtime != null">#{sysUtime},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="deleteFlag != null">#{deleteFlag},</if>
<if test="yearClassify != null">#{yearClassify},</if>
</trim>
</insert>
<update id="updateNewBuildingItem" parameterType="com.chinagas.modules.insight.domian.NewBuildingItem">
update new_building_item
<trim prefix="SET" suffixOverrides=",">
<if test="reportNo != null and reportNo != ''">report_no = #{reportNo},</if>
<if test="fiscalYear != null">fiscal_year = #{fiscalYear},</if>
<if test="buildingName != null and buildingName != ''">building_name = #{buildingName},</if>
<if test="buildingType != null and buildingType != ''">building_type = #{buildingType},</if>
<if test="developerName != null and developerName != ''">developer_name = #{developerName},</if>
<if test="predictPipelineNumber != null">predict_pipeline_number = #{predictPipelineNumber},</if>
<if test="signTime != null and signTime != ''">sign_time = #{signTime},</if>
<if test="predictInstallTime != null and predictInstallTime != ''">predict_install_time = #{predictInstallTime},</if>
<if test="sysCtime != null">sys_ctime = #{sysCtime},</if>
<if test="sysUtime != null">sys_utime = #{sysUtime},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="deleteFlag != null">delete_flag = #{deleteFlag},</if>
<if test="yearClassify != null">year_classify = #{yearClassify},</if>
</trim>
where id = #{id}
</update>
<update id="deleteNewBuildingItemById" parameterType="com.chinagas.modules.insight.domian.NewBuildingItem">
update new_building_item
<trim prefix="SET" suffixOverrides=",">
delete_flag = 1
</trim>
where report_no = #{reportNo}
</update>
<delete id="deleteNewBuildingItemByIds" parameterType="String">
delete from new_building_item where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteNewBuildingItemByReportNo" parameterType="String">
delete from new_building_item where report_no = #{reportNo}
</delete>
</mapper>