BizWaterWorkMapper.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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="com.robot.remote.smartrobotremote.mapper.BizWaterWorkMapper">
  6. <resultMap type="BizWaterWork" id="BizWaterWorkResult">
  7. <result property="worksId" column="works_id" />
  8. <result property="parentId" column="parent_id" />
  9. <result property="ancestors" column="ancestors" />
  10. <result property="worksName" column="works_name" />
  11. <result property="orderNum" column="order_num" />
  12. <result property="worksStatus" column="works_status" />
  13. <result property="delFlag" column="del_flag" />
  14. <result property="createBy" column="create_by" />
  15. <result property="createTime" column="create_time" />
  16. <result property="updateBy" column="update_by" />
  17. <result property="updateTime" column="update_time" />
  18. <result property="worksNo" column="works_no" />
  19. <result property="worksProvince" column="works_province" />
  20. <result property="worksCity" column="works_city" />
  21. <result property="worksArea" column="works_area" />
  22. <result property="worksLongitude" column="works_longitude" />
  23. <result property="worksLatitude" column="works_latitude" />
  24. <result property="worksAddress" column="works_address" />
  25. <result property="worksCount" column="works_count" />
  26. <result property="worksType" column="works_type" />
  27. <result property="worksCenter" column="works_center" />
  28. <result property="worksBelong" column="works_belong" />
  29. <result property="worksMaintainer" column="works_maintainer" />
  30. <result property="worksTel" column="works_tel" />
  31. </resultMap>
  32. <sql id="selectBizWaterWorkVo">
  33. select works_id, parent_id, ancestors, works_name, order_num, works_status, del_flag, create_by, create_time, update_by, update_time, works_no, works_province, works_city, works_area, works_longitude, works_latitude, works_address, works_count, works_type, works_center, works_belong, works_maintainer, works_tel from biz_water_work
  34. </sql>
  35. <select id="selectBizWaterWorkList" parameterType="BizWaterWork" resultMap="BizWaterWorkResult">
  36. <include refid="selectBizWaterWorkVo"/>
  37. <where>
  38. <if test="parentId != null "> and parent_id = #{parentId}</if>
  39. <if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
  40. <if test="worksName != null and worksName != ''"> and works_name like concat('%', #{worksName}, '%')</if>
  41. <if test="orderNum != null "> and order_num = #{orderNum}</if>
  42. <if test="worksStatus != null and worksStatus != ''"> and works_status = #{worksStatus}</if>
  43. <if test="worksNo != null and worksNo != ''"> and works_no = #{worksNo}</if>
  44. <if test="worksProvince != null and worksProvince != ''"> and works_province = #{worksProvince}</if>
  45. <if test="worksCity != null and worksCity != ''"> and works_city = #{worksCity}</if>
  46. <if test="worksArea != null and worksArea != ''"> and works_area = #{worksArea}</if>
  47. <if test="worksLongitude != null and worksLongitude != ''"> and works_longitude = #{worksLongitude}</if>
  48. <if test="worksLatitude != null and worksLatitude != ''"> and works_latitude = #{worksLatitude}</if>
  49. <if test="worksAddress != null and worksAddress != ''"> and works_address = #{worksAddress}</if>
  50. <if test="worksCount != null "> and works_count = #{worksCount}</if>
  51. <if test="worksType != null and worksType != ''"> and works_type = #{worksType}</if>
  52. <if test="worksCenter != null and worksCenter != ''"> and works_center = #{worksCenter}</if>
  53. <if test="worksBelong != null "> and works_belong = #{worksBelong}</if>
  54. <if test="worksMaintainer != null and worksMaintainer != ''"> and works_maintainer = #{worksMaintainer}</if>
  55. <if test="worksTel != null and worksTel != ''"> and works_tel = #{worksTel}</if>
  56. </where>
  57. </select>
  58. <select id="selectBizWaterWorkByWorksId" parameterType="Long" resultMap="BizWaterWorkResult">
  59. <include refid="selectBizWaterWorkVo"/>
  60. where works_id = #{worksId}
  61. </select>
  62. <insert id="insertBizWaterWork" parameterType="BizWaterWork">
  63. insert into biz_water_work
  64. <trim prefix="(" suffix=")" suffixOverrides=",">
  65. <if test="worksId != null">works_id,</if>
  66. <if test="parentId != null">parent_id,</if>
  67. <if test="ancestors != null">ancestors,</if>
  68. <if test="worksName != null">works_name,</if>
  69. <if test="orderNum != null">order_num,</if>
  70. <if test="worksStatus != null">works_status,</if>
  71. <if test="delFlag != null">del_flag,</if>
  72. <if test="createBy != null">create_by,</if>
  73. <if test="createTime != null">create_time,</if>
  74. <if test="updateBy != null">update_by,</if>
  75. <if test="updateTime != null">update_time,</if>
  76. <if test="worksNo != null">works_no,</if>
  77. <if test="worksProvince != null">works_province,</if>
  78. <if test="worksCity != null">works_city,</if>
  79. <if test="worksArea != null">works_area,</if>
  80. <if test="worksLongitude != null">works_longitude,</if>
  81. <if test="worksLatitude != null">works_latitude,</if>
  82. <if test="worksAddress != null">works_address,</if>
  83. <if test="worksCount != null">works_count,</if>
  84. <if test="worksType != null">works_type,</if>
  85. <if test="worksCenter != null">works_center,</if>
  86. <if test="worksBelong != null">works_belong,</if>
  87. <if test="worksMaintainer != null">works_maintainer,</if>
  88. <if test="worksTel != null">works_tel,</if>
  89. </trim>
  90. <trim prefix="values (" suffix=")" suffixOverrides=",">
  91. <if test="worksId != null">#{worksId},</if>
  92. <if test="parentId != null">#{parentId},</if>
  93. <if test="ancestors != null">#{ancestors},</if>
  94. <if test="worksName != null">#{worksName},</if>
  95. <if test="orderNum != null">#{orderNum},</if>
  96. <if test="worksStatus != null">#{worksStatus},</if>
  97. <if test="delFlag != null">#{delFlag},</if>
  98. <if test="createBy != null">#{createBy},</if>
  99. <if test="createTime != null">#{createTime},</if>
  100. <if test="updateBy != null">#{updateBy},</if>
  101. <if test="updateTime != null">#{updateTime},</if>
  102. <if test="worksNo != null">#{worksNo},</if>
  103. <if test="worksProvince != null">#{worksProvince},</if>
  104. <if test="worksCity != null">#{worksCity},</if>
  105. <if test="worksArea != null">#{worksArea},</if>
  106. <if test="worksLongitude != null">#{worksLongitude},</if>
  107. <if test="worksLatitude != null">#{worksLatitude},</if>
  108. <if test="worksAddress != null">#{worksAddress},</if>
  109. <if test="worksCount != null">#{worksCount},</if>
  110. <if test="worksType != null">#{worksType},</if>
  111. <if test="worksCenter != null">#{worksCenter},</if>
  112. <if test="worksBelong != null">#{worksBelong},</if>
  113. <if test="worksMaintainer != null">#{worksMaintainer},</if>
  114. <if test="worksTel != null">#{worksTel},</if>
  115. </trim>
  116. </insert>
  117. <update id="updateBizWaterWork" parameterType="BizWaterWork">
  118. update biz_water_work
  119. <trim prefix="SET" suffixOverrides=",">
  120. <if test="parentId != null">parent_id = #{parentId},</if>
  121. <if test="ancestors != null">ancestors = #{ancestors},</if>
  122. <if test="worksName != null">works_name = #{worksName},</if>
  123. <if test="orderNum != null">order_num = #{orderNum},</if>
  124. <if test="worksStatus != null">works_status = #{worksStatus},</if>
  125. <if test="delFlag != null">del_flag = #{delFlag},</if>
  126. <if test="createBy != null">create_by = #{createBy},</if>
  127. <if test="createTime != null">create_time = #{createTime},</if>
  128. <if test="updateBy != null">update_by = #{updateBy},</if>
  129. <if test="updateTime != null">update_time = #{updateTime},</if>
  130. <if test="worksNo != null">works_no = #{worksNo},</if>
  131. <if test="worksProvince != null">works_province = #{worksProvince},</if>
  132. <if test="worksCity != null">works_city = #{worksCity},</if>
  133. <if test="worksArea != null">works_area = #{worksArea},</if>
  134. <if test="worksLongitude != null">works_longitude = #{worksLongitude},</if>
  135. <if test="worksLatitude != null">works_latitude = #{worksLatitude},</if>
  136. <if test="worksAddress != null">works_address = #{worksAddress},</if>
  137. <if test="worksCount != null">works_count = #{worksCount},</if>
  138. <if test="worksType != null">works_type = #{worksType},</if>
  139. <if test="worksCenter != null">works_center = #{worksCenter},</if>
  140. <if test="worksBelong != null">works_belong = #{worksBelong},</if>
  141. <if test="worksMaintainer != null">works_maintainer = #{worksMaintainer},</if>
  142. <if test="worksTel != null">works_tel = #{worksTel},</if>
  143. </trim>
  144. where works_id = #{worksId}
  145. </update>
  146. <delete id="deleteBizWaterWorkByWorksId" parameterType="Long">
  147. delete from biz_water_work where works_id = #{worksId}
  148. </delete>
  149. <delete id="deleteBizWaterWorkByWorksIds" parameterType="String">
  150. delete from biz_water_work where works_id in
  151. <foreach item="worksId" collection="array" open="(" separator="," close=")">
  152. #{worksId}
  153. </foreach>
  154. </delete>
  155. </mapper>