ChargeMachinePortV1ServiceDaoImplMapper.xml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="chargeMachinePortV1ServiceDaoImpl">
  6. <!-- 保存充电插口信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveChargeMachinePortInfo" parameterType="Map">
  8. insert into charge_machine_port(
  9. machine_id,port_name,state,port_id,port_code,community_id
  10. ) values (
  11. #{machineId},#{portName},#{state},#{portId},#{portCode},#{communityId}
  12. )
  13. </insert>
  14. <!-- 查询充电插口信息 add by wuxw 2018-07-03 -->
  15. <select id="getChargeMachinePortInfo" parameterType="Map" resultType="Map">
  16. select t.machine_id,t.machine_id machineId,t.status_cd,t.status_cd statusCd,t.port_name,t.port_name
  17. portName,t.state,t.port_id,t.port_id portId,t.port_code,t.port_code portCode,t.community_id,t.community_id
  18. communityId,td.`name` stateName
  19. from charge_machine_port t
  20. left join t_dict td on t.state = td.status_cd and td.table_name = 'charge_machine_port' and td.table_columns = 'state'
  21. where 1 =1
  22. <if test="machineId !=null and machineId != ''">
  23. and t.machine_id= #{machineId}
  24. </if>
  25. <if test="statusCd !=null and statusCd != ''">
  26. and t.status_cd= #{statusCd}
  27. </if>
  28. <if test="portName !=null and portName != ''">
  29. and t.port_name= #{portName}
  30. </if>
  31. <if test="state !=null and state != ''">
  32. and t.state= #{state}
  33. </if>
  34. <if test="portId !=null and portId != ''">
  35. and t.port_id= #{portId}
  36. </if>
  37. <if test="portCode !=null and portCode != ''">
  38. and t.port_code= #{portCode}
  39. </if>
  40. <if test="communityId !=null and communityId != ''">
  41. and t.community_id= #{communityId}
  42. </if>
  43. order by t.port_code
  44. <if test="page != -1 and page != null ">
  45. limit #{page}, #{row}
  46. </if>
  47. </select>
  48. <!-- 修改充电插口信息 add by wuxw 2018-07-03 -->
  49. <update id="updateChargeMachinePortInfo" parameterType="Map">
  50. update charge_machine_port t set t.status_cd = #{statusCd}
  51. <if test="newBId != null and newBId != ''">
  52. ,t.b_id = #{newBId}
  53. </if>
  54. <if test="machineId !=null and machineId != ''">
  55. , t.machine_id= #{machineId}
  56. </if>
  57. <if test="portName !=null and portName != ''">
  58. , t.port_name= #{portName}
  59. </if>
  60. <if test="state !=null and state != ''">
  61. , t.state= #{state}
  62. </if>
  63. <if test="portCode !=null and portCode != ''">
  64. , t.port_code= #{portCode}
  65. </if>
  66. <if test="communityId !=null and communityId != ''">
  67. , t.community_id= #{communityId}
  68. </if>
  69. where 1=1
  70. <if test="portId !=null and portId != ''">
  71. and t.port_id= #{portId}
  72. </if>
  73. </update>
  74. <!-- 查询充电插口数量 add by wuxw 2018-07-03 -->
  75. <select id="queryChargeMachinePortsCount" parameterType="Map" resultType="Map">
  76. select count(1) count
  77. from charge_machine_port t
  78. where 1 =1
  79. <if test="machineId !=null and machineId != ''">
  80. and t.machine_id= #{machineId}
  81. </if>
  82. <if test="statusCd !=null and statusCd != ''">
  83. and t.status_cd= #{statusCd}
  84. </if>
  85. <if test="portName !=null and portName != ''">
  86. and t.port_name= #{portName}
  87. </if>
  88. <if test="state !=null and state != ''">
  89. and t.state= #{state}
  90. </if>
  91. <if test="portId !=null and portId != ''">
  92. and t.port_id= #{portId}
  93. </if>
  94. <if test="portCode !=null and portCode != ''">
  95. and t.port_code= #{portCode}
  96. </if>
  97. <if test="communityId !=null and communityId != ''">
  98. and t.community_id= #{communityId}
  99. </if>
  100. </select>
  101. </mapper>