DeviceMapper.xml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.zcxk.meterreadingsystemv2.dao.DeviceMapper">
  4. <select id="getDeviceCustomerInfo" resultType="com.zcxk.meterreadingsystemv2.dto.DeviceCustomerInfo">
  5. select
  6. sd.id as device_id,
  7. sd.device_no as device_no,
  8. concat(b.name,sd.loc_desc) as location,
  9. sil.user_name,
  10. sil.user_phone,
  11. sil.install_time
  12. from sc_device sd
  13. left join sc_install_list sil on (sil.device_id = sd.id and sil.status = 1)
  14. left join sc_building b on (b.id = sd.building_id and b.status = 1)
  15. where sd.status = 1 and sd.sys_id = -99
  16. <if test="communityId != null"> and b.community = #{communityId}</if>
  17. <if test="buildingId != null"> and sd.building_id = #{buildingId}</if>
  18. </select>
  19. <select id="getDeviceCustomerInfoByCustomerId" resultType="com.zcxk.meterreadingsystemv2.dto.DeviceCustomerInfo">
  20. select
  21. sd.id as device_id,
  22. sd.device_no as device_no,
  23. sd.water_meter_no,
  24. sd.loc_desc as location,
  25. sil.user_name,
  26. sil.user_phone,
  27. sil.id_card,
  28. sil.install_time
  29. from sc_device sd
  30. left join sc_install_list sil on (sil.device_id = sd.id and sil.status = 1)
  31. where sd.status = 1
  32. <if test="customerId != null"> and sd.customer_id = #{customerId}</if>
  33. and sd.water_meter_no not in('00000190294024',
  34. '00000190265476',
  35. '00000190294879',
  36. '00000190294421',
  37. '00000190295101',
  38. '00000190294024',
  39. '00000190265476',
  40. '00000190294185',
  41. '00000190294857',
  42. '00000190295028',
  43. '00000190294983',
  44. '00000190295028',
  45. '00000190294225',
  46. '00000190294421',
  47. '00000190294262',
  48. '00000190294609',
  49. '00000190294279',
  50. '00000190294983',
  51. '00000190294225',
  52. '00000190294279')
  53. </select>
  54. </mapper>