|
@@ -130,9 +130,9 @@
|
|
<select id="getList" resultType="com.bz.smart_city.dto.WarningLogDto">
|
|
<select id="getList" resultType="com.bz.smart_city.dto.WarningLogDto">
|
|
select
|
|
select
|
|
swl.*,
|
|
swl.*,
|
|
- scu.accountnumber as account_number,
|
|
|
|
- scu.username as account_name,
|
|
|
|
- scu.mobile_phone as account_phone,
|
|
|
|
|
|
+ pba.accountnumber as account_number,
|
|
|
|
+ pba.name as account_name,
|
|
|
|
+ pba.mobilephone as account_phone,
|
|
sd.device_no,
|
|
sd.device_no,
|
|
sd.water_meter_no,
|
|
sd.water_meter_no,
|
|
sd.loc_desc,
|
|
sd.loc_desc,
|
|
@@ -142,7 +142,8 @@
|
|
from sc_warning_log swl
|
|
from sc_warning_log swl
|
|
left join sc_device sd on(sd.id = swl.device_id)
|
|
left join sc_device sd on(sd.id = swl.device_id)
|
|
left join sc_building sb on(sb.id = sd.building_id)
|
|
left join sc_building sb on(sb.id = sd.building_id)
|
|
- left join sc_client_user scu on(scu.id = swl.client_user_id)
|
|
|
|
|
|
+ left join pay_base_customerandmeterrela pbc on(pbc.watermeter_id = swl.device_id)
|
|
|
|
+ left join pay_base_account pba on(pba.id = pbc.account_id)
|
|
left join sc_device_type sdt1 on(sdt1.id = sd.device_type)
|
|
left join sc_device_type sdt1 on(sdt1.id = sd.device_type)
|
|
left join sc_device_manufacturer sdm1 on(sdm1.id = sdt1.manufacturer_id)
|
|
left join sc_device_manufacturer sdm1 on(sdm1.id = sdt1.manufacturer_id)
|
|
<if test="programItems != null and programItems.size() != 0">left join sc_device_dimension sdd on (sdd.device_id = sd.id and sdd.status = 1)</if>
|
|
<if test="programItems != null and programItems.size() != 0">left join sc_device_dimension sdd on (sdd.device_id = sd.id and sdd.status = 1)</if>
|
|
@@ -154,7 +155,7 @@
|
|
)</if>
|
|
)</if>
|
|
<if test="warningType != null"> and swl.warning_type = #{warningType}</if>
|
|
<if test="warningType != null"> and swl.warning_type = #{warningType}</if>
|
|
<if test="clientName != null and clientName != ''"> and (
|
|
<if test="clientName != null and clientName != ''"> and (
|
|
- scu.username LIKE concat('%',#{clientName},'%') or scu.mobile_phone LIKE concat('%',#{clientName},'%') or scu.accountnumber LIKE concat('%',#{clientName},'%')
|
|
|
|
|
|
+ pba.name LIKE concat('%',#{clientName},'%') or pba.mobilephone LIKE concat('%',#{clientName},'%') or pba.accountnumber LIKE concat('%',#{clientName},'%')
|
|
)</if>
|
|
)</if>
|
|
<if test="feedbackStatus != null"> and swl.feedback_status = #{feedbackStatus}</if>
|
|
<if test="feedbackStatus != null"> and swl.feedback_status = #{feedbackStatus}</if>
|
|
<if test="provinceId != null"> and sb.province = #{provinceId}</if>
|
|
<if test="provinceId != null"> and sb.province = #{provinceId}</if>
|
|
@@ -188,7 +189,8 @@
|
|
select sd.building_id,count(1) as device_count
|
|
select sd.building_id,count(1) as device_count
|
|
from sc_warning_log swl
|
|
from sc_warning_log swl
|
|
left join sc_device sd on(sd.id = swl.device_id)
|
|
left join sc_device sd on(sd.id = swl.device_id)
|
|
- left join sc_client_user scu on(scu.id = swl.client_user_id)
|
|
|
|
|
|
+ left join pay_base_customerandmeterrela pbc on(pbc.watermeter_id = swl.device_id)
|
|
|
|
+ left join pay_base_account pba on(pba.id = pbc.account_id)
|
|
<if test="programItems != null and programItems.size() != 0">left join sc_device_dimension sdd on (sdd.device_id = sd.id and sdd.status = 1)</if>
|
|
<if test="programItems != null and programItems.size() != 0">left join sc_device_dimension sdd on (sdd.device_id = sd.id and sdd.status = 1)</if>
|
|
where swl.status = 1 and sd.status = 1
|
|
where swl.status = 1 and sd.status = 1
|
|
<if test="siteId != null"> and sd.site_id = #{siteId}</if>
|
|
<if test="siteId != null"> and sd.site_id = #{siteId}</if>
|
|
@@ -198,7 +200,7 @@
|
|
)</if>
|
|
)</if>
|
|
<if test="warningType != null"> and swl.warning_type = #{warningType}</if>
|
|
<if test="warningType != null"> and swl.warning_type = #{warningType}</if>
|
|
<if test="clientName != null and clientName != ''"> and (
|
|
<if test="clientName != null and clientName != ''"> and (
|
|
- scu.username LIKE concat('%',#{clientName},'%') or scu.mobile_phone LIKE concat('%',#{clientName},'%') or scu.accountnumber LIKE concat('%',#{clientName},'%')
|
|
|
|
|
|
+ pba.name LIKE concat('%',#{clientName},'%') or pba.mobilephone LIKE concat('%',#{clientName},'%') or pba.accountnumber LIKE concat('%',#{clientName},'%')
|
|
)</if>
|
|
)</if>
|
|
<if test="feedbackStatus != null"> and swl.feedback_status = #{feedbackStatus}</if>
|
|
<if test="feedbackStatus != null"> and swl.feedback_status = #{feedbackStatus}</if>
|
|
<if test="startDate != null"> and swl.date_create <![CDATA[ >= ]]> #{startDate}</if>
|
|
<if test="startDate != null"> and swl.date_create <![CDATA[ >= ]]> #{startDate}</if>
|
|
@@ -212,4 +214,5 @@
|
|
) t1 on (t1.building_id = b.id)
|
|
) t1 on (t1.building_id = b.id)
|
|
where b.status = 1
|
|
where b.status = 1
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
</mapper>
|
|
</mapper>
|