NewBuildingInfoMapper.xml
6.16 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
<?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.NewBuildingInfoMapper">
<resultMap type="com.chinagas.modules.insight.domian.NewBuildingInfo" id="NewBuildingInfoResult">
<result property="id" column="id" />
<result property="reportNo" column="report_no" />
<result property="fiscalYear" column="fiscal_year" />
<result property="communityName" column="community_name" />
<result property="householdNumber" column="household_number" />
<result property="predictInstallNumber" column="predict_install_number" />
<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="classify" column="classify" />
</resultMap>
<sql id="selectNewBuildingInfoVo">
select id, report_no, fiscal_year, community_name, household_number, predict_install_number,
sys_ctime, sys_utime, create_by, update_by, delete_flag, classify from new_building_info
</sql>
<select id="selectNewBuildingInfoList" parameterType="com.chinagas.modules.insight.domian.NewBuildingInfo" resultMap="NewBuildingInfoResult">
<include refid="selectNewBuildingInfoVo"/>
<where>
<if test="reportNo != null and reportNo != ''"> and report_no = #{reportNo}</if>
<if test="fiscalYear != null "> and fiscal_year = #{fiscalYear}</if>
<if test="communityName != null and communityName != ''"> and community_name like concat('%', #{communityName}, '%')</if>
<if test="householdNumber != null "> and household_number = #{householdNumber}</if>
<if test="predictInstallNumber != null "> and predict_install_number = #{predictInstallNumber}</if>
<if test="sysCtime != null "> and sys_ctime = #{sysCtime}</if>
<if test="sysUtime != null "> and sys_utime = #{sysUtime}</if>
and delete_flag = 0
</where>
</select>
<select id="selectNewBuildingInfoById" resultMap="NewBuildingInfoResult">
<include refid="selectNewBuildingInfoVo"/>
where report_no = #{reportNo}
</select>
<insert id="insertNewBuildingInfo" parameterType="com.chinagas.modules.insight.domian.NewBuildingInfo">
insert into new_building_info
<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="communityName != null and communityName != ''">community_name,</if>
<if test="householdNumber != null">household_number,</if>
<if test="predictInstallNumber != null">predict_install_number,</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="classify != null">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="communityName != null and communityName != ''">#{communityName},</if>
<if test="householdNumber != null">#{householdNumber},</if>
<if test="predictInstallNumber != null">#{predictInstallNumber},</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="classify != null">#{classify},</if>
</trim>
</insert>
<update id="updateNewBuildingInfo" parameterType="com.chinagas.modules.insight.domian.NewBuildingInfo">
update new_building_info
<trim prefix="SET" suffixOverrides=",">
<if test="reportNo != null and reportNo != ''">report_no = #{reportNo},</if>
<if test="fiscalYear != null">fiscal_year = #{fiscalYear},</if>
<if test="communityName != null and communityName != ''">community_name = #{communityName},</if>
<if test="householdNumber != null">household_number = #{householdNumber},</if>
<if test="predictInstallNumber != null">predict_install_number = #{predictInstallNumber},</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>
</trim>
where id = #{id}
</update>
<update id="deleteNewBuildingInfoById" parameterType="com.chinagas.modules.insight.domian.NewBuildingInfo">
update new_building_info
<trim prefix="SET" suffixOverrides=",">
delete_flag = 1
</trim>
where report_no = #{reportNo}
</update>
<delete id="deleteNewBuildingInfoByIds" parameterType="String">
delete from new_building_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteNewBuildingInfoByReportNo" parameterType="String">
delete from new_building_info where report_no = #{reportNo}
</delete>
</mapper>