SitedtlMapper.xml 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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.bizmatics.persistence.mapper.SitedtlMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.bizmatics.model.Sitedtl">
  6. <id column="id" property="id" />
  7. <result column="account_number" property="accountNumber" />
  8. <result column="rheological_change" property="rheologicalChange" />
  9. <result column="power_capacity" property="powerCapacity" />
  10. <result column="route_id" property="routeId" />
  11. <result column="site_id" property="siteId" />
  12. <result column="supervision_department_id" property="supervisionDepartmentId" />
  13. <result column="cable_hole" property="cableHole" />
  14. <result column="damage" property="damage" />
  15. <result column="water_leakage" property="waterLeakage" />
  16. <result column="annihilator_insufficient_configuration" property="annihilatorInsufficientConfiguration" />
  17. <result column="annihilator_overdue" property="annihilatorOverdue" />
  18. <result column="door_baffle" property="doorBaffle" />
  19. <result column="pile_up_sundries" property="pileUpSundries" />
  20. <result column="serious_ash_deposition" property="seriousAshDeposition" />
  21. <result column="around_environment_humid" property="aroundEnvironmentHumid" />
  22. <result column="around_pile_up_sundries" property="aroundPileUpSundries" />
  23. <result column="no_electrician" property="noElectrician" />
  24. <result column="electrician_lack" property="electricianLack" />
  25. <result column="overdue_electrician_certificate" property="overdueElectricianCertificate" />
  26. <result column="electric_test_overdue" property="electricTestOverdue" />
  27. <result column="high_voltage_cabinet" property="highVoltageCabinet" />
  28. <result column="old_equipment" property="oldEquipment" />
  29. <result column="charged_display" property="chargedDisplay" />
  30. <result column="lighting" property="lighting" />
  31. <result column="blanket_insufficient_configuration" property="blanketInsufficientConfiguration" />
  32. <result column="ground_wire" property="groundWire" />
  33. <result column="analog_screen" property="analogScreen" />
  34. <result column="remarks" property="remarks" />
  35. <result column="creator" property="creator" />
  36. <result column="create_time" property="createTime" />
  37. </resultMap>
  38. <select id="sitedtlVoList" resultType="com.bizmatics.model.vo.SitedtlVo">
  39. SELECT
  40. a.*,b.id AS site_archivesid,b.*,c.site_name,d.route_name,e.supervision_name
  41. FROM
  42. sitedtl AS a
  43. left JOIN site_archives AS b ON a.id = b.sitedtl_id
  44. left join site as c on a.site_id=c.id
  45. left join route as d on d.id=a.route_id
  46. left join supervision as e on e.id=a.supervision_department_id
  47. <where>
  48. <if test="siteId != null and siteId !=0">
  49. a.site_id = #{siteId}
  50. </if>
  51. <if test="electricTestOverdue != null and electricTestOverdue !='' ">
  52. and a.electric_test_overdue LIKE CONCAT(CONCAT('%', #{electricTestOverdue}), '%')
  53. </if>
  54. </where>
  55. ORDER BY
  56. a.id DESC
  57. <if test="startCurrent != null and size !=0">
  58. LIMIT #{startCurrent},
  59. #{size}
  60. </if>
  61. </select>
  62. <select id="sitedtlVoListOne" resultType="com.bizmatics.model.vo.SitedtlVo">
  63. SELECT
  64. a.*,b.id AS site_archivesid,b.*,c.site_name,d.route_name,e.supervision_name
  65. FROM
  66. sitedtl AS a
  67. left JOIN site_archives AS b ON a.id = b.sitedtl_id
  68. left join site as c on a.site_id=c.id
  69. left join route as d on d.id=a.route_id
  70. left join supervision as e on e.id=a.supervision_department_id
  71. <where>
  72. <if test="siteId != null and siteId !=0">
  73. a.site_id = #{siteId}
  74. </if>
  75. <if test="electricTestOverdue != null and electricTestOverdue !='' ">
  76. and a.electric_test_overdue LIKE CONCAT(CONCAT('%', #{electricTestOverdue}), '%')
  77. </if>
  78. </where>
  79. ORDER BY
  80. a.id DESC
  81. <if test="startCurrent != null and size !=0">
  82. LIMIT #{startCurrent},
  83. #{size}
  84. </if>
  85. </select>
  86. </mapper>