MachineTranslateV1ServiceDaoImplMapper.xml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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="machineTranslateV1ServiceDaoImpl">
  6. <!-- 保存物联网同步信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveMachineTranslateInfo" parameterType="Map">
  8. insert into machine_translate(
  9. machine_code,obj_b_id,update_time,machine_cmd,remark,obj_name,machine_id,type_cd,machine_translate_id,obj_id,state,community_id
  10. ) values (
  11. #{machineCode},#{objBId},#{updateTime},#{machineCmd},#{remark},#{objName},#{machineId},#{typeCd},#{machineTranslateId},#{objId},#{state},#{communityId}
  12. )
  13. </insert>
  14. <!-- 查询物联网同步信息 add by wuxw 2018-07-03 -->
  15. <select id="getMachineTranslateInfo" parameterType="Map" resultType="Map">
  16. select t.machine_code,t.machine_code machineCode,t.obj_b_id,t.obj_b_id objBId,t.status_cd,t.status_cd
  17. statusCd,t.update_time,t.update_time updateTime,t.machine_cmd,t.machine_cmd
  18. machineCmd,t.remark,t.obj_name,t.obj_name objName,t.machine_id,t.machine_id machineId,t.type_cd,t.type_cd
  19. typeCd,t.machine_translate_id,t.machine_translate_id machineTranslateId,t.obj_id,t.obj_id
  20. objId,t.state,t.community_id,t.community_id communityId
  21. from machine_translate t
  22. where 1 =1
  23. <if test="machineCode !=null and machineCode != ''">
  24. and t.machine_code= #{machineCode}
  25. </if>
  26. <if test="objBId !=null and objBId != ''">
  27. and t.obj_b_id= #{objBId}
  28. </if>
  29. <if test="statusCd !=null and statusCd != ''">
  30. and t.status_cd= #{statusCd}
  31. </if>
  32. <if test="updateTime !=null and updateTime != ''">
  33. and t.update_time= #{updateTime}
  34. </if>
  35. <if test="machineCmd !=null and machineCmd != ''">
  36. and t.machine_cmd= #{machineCmd}
  37. </if>
  38. <if test="remark !=null and remark != ''">
  39. and t.remark= #{remark}
  40. </if>
  41. <if test="objName !=null and objName != ''">
  42. and t.obj_name= #{objName}
  43. </if>
  44. <if test="machineId !=null and machineId != ''">
  45. and t.machine_id= #{machineId}
  46. </if>
  47. <if test="typeCd !=null and typeCd != ''">
  48. and t.type_cd= #{typeCd}
  49. </if>
  50. <if test="machineTranslateId !=null and machineTranslateId != ''">
  51. and t.machine_translate_id= #{machineTranslateId}
  52. </if>
  53. <if test="objId !=null and objId != ''">
  54. and t.obj_id= #{objId}
  55. </if>
  56. <if test="state !=null and state != ''">
  57. and t.state= #{state}
  58. </if>
  59. <if test="communityId !=null and communityId != ''">
  60. and t.community_id= #{communityId}
  61. </if>
  62. order by t.create_time desc
  63. <if test="page != -1 and page != null ">
  64. limit #{page}, #{row}
  65. </if>
  66. </select>
  67. <!-- 修改物联网同步信息 add by wuxw 2018-07-03 -->
  68. <update id="updateMachineTranslateInfo" parameterType="Map">
  69. update machine_translate t set t.status_cd = #{statusCd}
  70. <if test="newBId != null and newBId != ''">
  71. ,t.b_id = #{newBId}
  72. </if>
  73. <if test="machineCode !=null and machineCode != ''">
  74. , t.machine_code= #{machineCode}
  75. </if>
  76. <if test="objBId !=null and objBId != ''">
  77. , t.obj_b_id= #{objBId}
  78. </if>
  79. <if test="updateTime !=null and updateTime != ''">
  80. , t.update_time= #{updateTime}
  81. </if>
  82. <if test="machineCmd !=null and machineCmd != ''">
  83. , t.machine_cmd= #{machineCmd}
  84. </if>
  85. <if test="remark !=null and remark != ''">
  86. , t.remark= #{remark}
  87. </if>
  88. <if test="objName !=null and objName != ''">
  89. , t.obj_name= #{objName}
  90. </if>
  91. <if test="machineId !=null and machineId != ''">
  92. , t.machine_id= #{machineId}
  93. </if>
  94. <if test="typeCd !=null and typeCd != ''">
  95. , t.type_cd= #{typeCd}
  96. </if>
  97. <if test="objId !=null and objId != ''">
  98. , t.obj_id= #{objId}
  99. </if>
  100. <if test="state !=null and state != ''">
  101. , t.state= #{state}
  102. </if>
  103. <if test="communityId !=null and communityId != ''">
  104. , t.community_id= #{communityId}
  105. </if>
  106. where 1=1
  107. <if test="machineTranslateId !=null and machineTranslateId != ''">
  108. and t.machine_translate_id= #{machineTranslateId}
  109. </if>
  110. </update>
  111. <!-- 查询物联网同步数量 add by wuxw 2018-07-03 -->
  112. <select id="queryMachineTranslatesCount" parameterType="Map" resultType="Map">
  113. select count(1) count
  114. from machine_translate t
  115. where 1 =1
  116. <if test="machineCode !=null and machineCode != ''">
  117. and t.machine_code= #{machineCode}
  118. </if>
  119. <if test="objBId !=null and objBId != ''">
  120. and t.obj_b_id= #{objBId}
  121. </if>
  122. <if test="statusCd !=null and statusCd != ''">
  123. and t.status_cd= #{statusCd}
  124. </if>
  125. <if test="updateTime !=null and updateTime != ''">
  126. and t.update_time= #{updateTime}
  127. </if>
  128. <if test="machineCmd !=null and machineCmd != ''">
  129. and t.machine_cmd= #{machineCmd}
  130. </if>
  131. <if test="remark !=null and remark != ''">
  132. and t.remark= #{remark}
  133. </if>
  134. <if test="objName !=null and objName != ''">
  135. and t.obj_name= #{objName}
  136. </if>
  137. <if test="machineId !=null and machineId != ''">
  138. and t.machine_id= #{machineId}
  139. </if>
  140. <if test="typeCd !=null and typeCd != ''">
  141. and t.type_cd= #{typeCd}
  142. </if>
  143. <if test="machineTranslateId !=null and machineTranslateId != ''">
  144. and t.machine_translate_id= #{machineTranslateId}
  145. </if>
  146. <if test="objId !=null and objId != ''">
  147. and t.obj_id= #{objId}
  148. </if>
  149. <if test="state !=null and state != ''">
  150. and t.state= #{state}
  151. </if>
  152. <if test="communityId !=null and communityId != ''">
  153. and t.community_id= #{communityId}
  154. </if>
  155. </select>
  156. </mapper>