12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?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.zcxk.meterreadingsystemv2.dao.DeviceMapper">
- <select id="getDeviceCustomerInfo" resultType="com.zcxk.meterreadingsystemv2.dto.DeviceCustomerInfo">
- select
- sd.id as device_id,
- sd.device_no as device_no,
- concat(b.name,sd.loc_desc) as location,
- sil.user_name,
- sil.user_phone,
- sil.install_time
- from sc_device sd
- left join sc_install_list sil on (sil.device_id = sd.id and sil.status = 1)
- left join sc_building b on (b.id = sd.building_id and b.status = 1)
- where sd.status = 1 and sd.sys_id = -99
- <if test="communityId != null"> and b.community = #{communityId}</if>
- <if test="buildingId != null"> and sd.building_id = #{buildingId}</if>
- </select>
- <select id="getDeviceCustomerInfoByCustomerId" resultType="com.zcxk.meterreadingsystemv2.dto.DeviceCustomerInfo">
- select
- sd.id as device_id,
- sd.device_no as device_no,
- sd.water_meter_no,
- sd.loc_desc as location,
- sil.user_name,
- sil.user_phone,
- sil.id_card,
- sil.install_time
- from sc_device sd
- left join sc_install_list sil on (sil.device_id = sd.id and sil.status = 1)
- where sd.status = 1
- <if test="customerId != null"> and sd.customer_id = #{customerId}</if>
- and sd.water_meter_no not in('00000190294024',
- '00000190265476',
- '00000190294879',
- '00000190294421',
- '00000190295101',
- '00000190294024',
- '00000190265476',
- '00000190294185',
- '00000190294857',
- '00000190295028',
- '00000190294983',
- '00000190295028',
- '00000190294225',
- '00000190294421',
- '00000190294262',
- '00000190294609',
- '00000190294279',
- '00000190294983',
- '00000190294225',
- '00000190294279')
- </select>
- </mapper>
|