McVisitUserMapper.xml
13.4 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<?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.schsf.mapper.McVisitUserMapper">
<resultMap type="com.chinagas.modules.schsf.domain.McVisitUser" id="McVisitUserResult">
<result property="id" column="id" />
<result property="userCode" column="user_code" />
<result property="userName" column="user_name" />
<result property="userPhone" column="user_phone" />
<result property="residenceType" column="residence_type" />
<result property="familyMembers" column="family_members" />
<result property="incomeSource" column="income_source" />
<result property="houseCondition" column="house_condition" />
<result property="originalAppliances" column="original_appliances" />
<result property="decorationStatus" column="decoration_status" />
<result property="currentCookingEnergy" column="current_cooking_energy" />
<result property="currentHeatingEnergy" column="current_heating_energy" />
<result property="isIntent" column="is_intent" />
<result property="regionName" column="region_name" />
<result property="regionCode" column="region_code" />
<result property="budgetOwner" column="budget_owner" />
<result property="companyName" column="company_name" />
<result property="companyCode" column="company_code" />
<result property="province" column="province" />
<result property="city" column="city" />
<result property="district" column="district" />
<result property="street" column="street" />
<result property="detailedAddress" column="detailed_address" />
<result property="township" column="township" />
<result property="village" column="village" />
<result property="vlgOrCmty" column="vlg_or_cmty" />
<result property="userAge" column="user_age" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="defFlag" column="def_flag" />
</resultMap>
<sql id="selectMcVisitUserVo">
select id, user_code, user_name, user_phone, residence_type, family_members, income_source, house_condition, original_appliances, decoration_status, current_cooking_energy, current_heating_energy, is_intent, region_name, region_code, budget_owner, company_name, company_code, province, city, district, street, detailed_address, township, village, vlg_or_cmty, user_age, create_time, create_by, def_flag from mc_visit_user
</sql>
<select id="selectMcVisitUserList" parameterType="com.chinagas.modules.schsf.domain.McVisitUser" resultMap="McVisitUserResult">
<include refid="selectMcVisitUserVo"/>
<where>
<if test="userCode != null and userCode != ''"> and user_code = #{userCode}</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="userPhone != null and userPhone != ''"> and user_phone = #{userPhone}</if>
<if test="residenceType != null and residenceType != ''"> and residence_type = #{residenceType}</if>
<if test="familyMembers != null and familyMembers != ''"> and family_members = #{familyMembers}</if>
<if test="incomeSource != null and incomeSource != ''"> and income_source = #{incomeSource}</if>
<if test="houseCondition != null and houseCondition != ''"> and house_condition = #{houseCondition}</if>
<if test="originalAppliances != null and originalAppliances != ''"> and original_appliances = #{originalAppliances}</if>
<if test="decorationStatus != null and decorationStatus != ''"> and decoration_status = #{decorationStatus}</if>
<if test="currentCookingEnergy != null and currentCookingEnergy != ''"> and current_cooking_energy = #{currentCookingEnergy}</if>
<if test="currentHeatingEnergy != null and currentHeatingEnergy != ''"> and current_heating_energy = #{currentHeatingEnergy}</if>
<if test="isIntent != null and isIntent != ''"> and is_intent = #{isIntent}</if>
<if test="regionName != null and regionName != ''"> and region_name like concat('%', #{regionName}, '%')</if>
<if test="regionCode != null and regionCode != ''"> and region_code = #{regionCode}</if>
<if test="budgetOwner != null and budgetOwner != ''"> and budget_owner = #{budgetOwner}</if>
<if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
<if test="companyCode != null and companyCode != ''"> and company_code = #{companyCode}</if>
<if test="province != null and province != ''"> and province = #{province}</if>
<if test="city != null and city != ''"> and city = #{city}</if>
<if test="district != null and district != ''"> and district = #{district}</if>
<if test="street != null and street != ''"> and street = #{street}</if>
<if test="detailedAddress != null and detailedAddress != ''"> and detailed_address = #{detailedAddress}</if>
<if test="township != null and township != ''"> and township = #{township}</if>
<if test="village != null and village != ''"> and village = #{village}</if>
<if test="vlgOrCmty != null and vlgOrCmty != ''"> and vlg_or_cmty = #{vlgOrCmty}</if>
<if test="userAge != null and userAge != ''"> and user_age = #{userAge}</if>
<if test="defFlag != null and defFlag != ''"> and def_flag = #{defFlag}</if>
</where>
</select>
<select id="selectMcVisitUserById" parameterType="Long" resultMap="McVisitUserResult">
<include refid="selectMcVisitUserVo"/>
where id = #{id}
</select>
<insert id="insertMcVisitUser" parameterType="com.chinagas.modules.schsf.domain.McVisitUser">
insert into mc_visit_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="userCode != null and userCode != ''">user_code,</if>
<if test="userName != null and userName != ''">user_name,</if>
<if test="userPhone != null and userPhone != ''">user_phone,</if>
<if test="residenceType != null and residenceType != ''">residence_type,</if>
<if test="familyMembers != null">family_members,</if>
<if test="incomeSource != null">income_source,</if>
<if test="houseCondition != null">house_condition,</if>
<if test="originalAppliances != null">original_appliances,</if>
<if test="decorationStatus != null">decoration_status,</if>
<if test="currentCookingEnergy != null">current_cooking_energy,</if>
<if test="currentHeatingEnergy != null">current_heating_energy,</if>
<if test="isIntent != null">is_intent,</if>
<if test="regionName != null and regionName != ''">region_name,</if>
<if test="regionCode != null and regionCode != ''">region_code,</if>
<if test="budgetOwner != null and budgetOwner != ''">budget_owner,</if>
<if test="companyName != null and companyName != ''">company_name,</if>
<if test="companyCode != null and companyCode != ''">company_code,</if>
<if test="province != null">province,</if>
<if test="city != null">city,</if>
<if test="district != null">district,</if>
<if test="street != null">street,</if>
<if test="detailedAddress != null">detailed_address,</if>
<if test="township != null">township,</if>
<if test="village != null">village,</if>
<if test="vlgOrCmty != null">vlg_or_cmty,</if>
<if test="userAge != null">user_age,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="defFlag != null and defFlag != ''">def_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="userCode != null and userCode != ''">#{userCode},</if>
<if test="userName != null and userName != ''">#{userName},</if>
<if test="userPhone != null and userPhone != ''">#{userPhone},</if>
<if test="residenceType != null and residenceType != ''">#{residenceType},</if>
<if test="familyMembers != null">#{familyMembers},</if>
<if test="incomeSource != null">#{incomeSource},</if>
<if test="houseCondition != null">#{houseCondition},</if>
<if test="originalAppliances != null">#{originalAppliances},</if>
<if test="decorationStatus != null">#{decorationStatus},</if>
<if test="currentCookingEnergy != null">#{currentCookingEnergy},</if>
<if test="currentHeatingEnergy != null">#{currentHeatingEnergy},</if>
<if test="isIntent != null">#{isIntent},</if>
<if test="regionName != null and regionName != ''">#{regionName},</if>
<if test="regionCode != null and regionCode != ''">#{regionCode},</if>
<if test="budgetOwner != null and budgetOwner != ''">#{budgetOwner},</if>
<if test="companyName != null and companyName != ''">#{companyName},</if>
<if test="companyCode != null and companyCode != ''">#{companyCode},</if>
<if test="province != null">#{province},</if>
<if test="city != null">#{city},</if>
<if test="district != null">#{district},</if>
<if test="street != null">#{street},</if>
<if test="detailedAddress != null">#{detailedAddress},</if>
<if test="township != null">#{township},</if>
<if test="village != null">#{village},</if>
<if test="vlgOrCmty != null">#{vlgOrCmty},</if>
<if test="userAge != null">#{userAge},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="defFlag != null and defFlag != ''">#{defFlag},</if>
</trim>
</insert>
<update id="updateMcVisitUser" parameterType="com.chinagas.modules.schsf.domain.McVisitUser">
update mc_visit_user
<trim prefix="SET" suffixOverrides=",">
<if test="userCode != null and userCode != ''">user_code = #{userCode},</if>
<if test="userName != null and userName != ''">user_name = #{userName},</if>
<if test="userPhone != null and userPhone != ''">user_phone = #{userPhone},</if>
<if test="residenceType != null and residenceType != ''">residence_type = #{residenceType},</if>
<if test="familyMembers != null">family_members = #{familyMembers},</if>
<if test="incomeSource != null">income_source = #{incomeSource},</if>
<if test="houseCondition != null">house_condition = #{houseCondition},</if>
<if test="originalAppliances != null">original_appliances = #{originalAppliances},</if>
<if test="decorationStatus != null">decoration_status = #{decorationStatus},</if>
<if test="currentCookingEnergy != null">current_cooking_energy = #{currentCookingEnergy},</if>
<if test="currentHeatingEnergy != null">current_heating_energy = #{currentHeatingEnergy},</if>
<if test="isIntent != null">is_intent = #{isIntent},</if>
<if test="regionName != null and regionName != ''">region_name = #{regionName},</if>
<if test="regionCode != null and regionCode != ''">region_code = #{regionCode},</if>
<if test="budgetOwner != null and budgetOwner != ''">budget_owner = #{budgetOwner},</if>
<if test="companyName != null and companyName != ''">company_name = #{companyName},</if>
<if test="companyCode != null and companyCode != ''">company_code = #{companyCode},</if>
<if test="province != null">province = #{province},</if>
<if test="city != null">city = #{city},</if>
<if test="district != null">district = #{district},</if>
<if test="street != null">street = #{street},</if>
<if test="detailedAddress != null">detailed_address = #{detailedAddress},</if>
<if test="township != null">township = #{township},</if>
<if test="village != null">village = #{village},</if>
<if test="vlgOrCmty != null">vlg_or_cmty = #{vlgOrCmty},</if>
<if test="userAge != null">user_age = #{userAge},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="defFlag != null and defFlag != ''">def_flag = #{defFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMcVisitUserById" parameterType="Long">
delete from mc_visit_user where id = #{id}
</delete>
<delete id="deleteMcVisitUserByIds" parameterType="String">
delete from mc_visit_user where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>