DanganMapper.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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.ruoyi.system.mapper.DanganMapper">
  6. <resultMap type="Dangan" id="DanganResult">
  7. <result property="danganId" column="dangan_id" />
  8. <result property="danganName" column="dangan_name" />
  9. <result property="danganNo" column="dangan_no" />
  10. <result property="keyId" column="key_id" />
  11. <result property="status" column="status" />
  12. <result property="sysPerson" column="sys_person" />
  13. <result property="fileType" column="file_type" />
  14. <result property="model" column="model" />
  15. <result property="projectId" column="project_id" />
  16. <result property="brand" column="brand" />
  17. <result property="runDeviceId" column="run_device_id" />
  18. <result property="relateDeviceId" column="relate_device_id" />
  19. <result property="maintainItemId" column="maintain_item_id" />
  20. <result property="factoryTime" column="factory_time" />
  21. <result property="projectTime" column="project_time" />
  22. <result property="useUnit" column="use_unit" />
  23. <result property="medium" column="medium" />
  24. <result property="maintainTime" column="maintain_time" />
  25. <result property="pageAddress" column="page_address" />
  26. <result property="testAddress" column="test_address" />
  27. <result property="buildFactory" column="build_factory" />
  28. <result property="buildFactoryTime" column="build_factory_time" />
  29. <result property="factoryPerson" column="factory_person" />
  30. <result property="factoryPersonPhone" column="factory_person_phone" />
  31. <result property="language" column="language" />
  32. <result property="serverIp" column="server_ip" />
  33. <result property="serverLocation" column="server_location" />
  34. <result property="serverInfo" column="server_info" />
  35. <result property="serverBasedYesNo" column="server_based_yes_no" />
  36. <result property="opsPerson" column="ops_person" />
  37. <result property="chargeUnit" column="charge_unit" />
  38. <result property="mode" column="mode" />
  39. <result property="fileInfo" column="file_info" />
  40. <result property="iconInfo" column="icon_info" />
  41. <result property="createBy" column="create_by" />
  42. <result property="createTime" column="create_time" />
  43. <result property="updateBy" column="update_by" />
  44. <result property="updateTime" column="update_time" />
  45. <result property="remark" column="remark" />
  46. <result property="ord" column="ord" />
  47. </resultMap>
  48. <sql id="selectDanganVo">
  49. select dangan_id,
  50. key_id,
  51. dangan_no,dangan_name, status,
  52. sys_person, file_type, model, project_id, brand, run_device_id, relate_device_id, maintain_item_id, factory_time, project_time, use_unit, medium, maintain_time, page_address, test_address, build_factory, build_factory_time, factory_person, factory_person_phone, language, server_ip, server_location, server_info, server_based_yes_no, ops_person, charge_unit, mode, file_info,icon_info, create_by, create_time, update_by, update_time, remark,ord from sys_dangan
  53. </sql>
  54. <select id="selectDanganList" parameterType="Dangan" resultMap="DanganResult">
  55. <include refid="selectDanganVo"/>
  56. <where>
  57. <if test="danganName != null and danganName != ''"> and dangan_name like concat('%', #{danganName}, '%')</if>
  58. <if test="status != null and status != ''"> and status = #{status}</if>
  59. <if test="danganNo != null and danganNo != ''"> and dangan_no = #{danganNo}</if>
  60. <if test="keyId != null and keyId != ''"> and key_id = #{keyId}</if>
  61. <if test="sysPerson != null and sysPerson != ''"> and sys_person = #{sysPerson}</if>
  62. <if test="fileType != null and fileType != ''"> and file_type = #{fileType}</if>
  63. <if test="model != null and model != ''"> and model = #{model}</if>
  64. <if test="projectId != null and projectId != ''"> and project_id = #{projectId}</if>
  65. <if test="brand != null and brand != ''"> and brand = #{brand}</if>
  66. <if test="runDeviceId != null and runDeviceId != ''"> and run_device_id = #{runDeviceId}</if>
  67. <if test="relateDeviceId != null and relateDeviceId != ''"> and relate_device_id = #{relateDeviceId}</if>
  68. <if test="maintainItemId != null and maintainItemId != ''"> and maintain_item_id = #{maintainItemId}</if>
  69. <if test="factoryTime != null and factoryTime != ''"> and factory_time = #{factoryTime}</if>
  70. <if test="projectTime != null and projectTime != ''"> and project_time = #{projectTime}</if>
  71. <if test="useUnit != null and useUnit != ''"> and use_unit = #{useUnit}</if>
  72. <if test="medium != null and medium != ''"> and medium = #{medium}</if>
  73. <if test="maintainTime != null "> and maintain_time = #{maintainTime}</if>
  74. <if test="pageAddress != null and pageAddress != ''"> and page_address = #{pageAddress}</if>
  75. <if test="testAddress != null and testAddress != ''"> and test_address = #{testAddress}</if>
  76. <if test="buildFactory != null and buildFactory != ''"> and build_factory = #{buildFactory}</if>
  77. <if test="buildFactoryTime != null "> and build_factory_time = #{buildFactoryTime}</if>
  78. <if test="factoryPerson != null and factoryPerson != ''"> and factory_person = #{factoryPerson}</if>
  79. <if test="factoryPersonPhone != null and factoryPersonPhone != ''"> and factory_person_phone = #{factoryPersonPhone}</if>
  80. <if test="language != null and language != ''"> and language = #{language}</if>
  81. <if test="serverIp != null and serverIp != ''"> and server_ip = #{serverIp}</if>
  82. <if test="serverLocation != null and serverLocation != ''"> and server_location = #{serverLocation}</if>
  83. <if test="serverInfo != null and serverInfo != ''"> and server_info = #{serverInfo}</if>
  84. <if test="serverBasedYesNo != null and serverBasedYesNo != ''"> and server_based_yes_no = #{serverBasedYesNo}</if>
  85. <if test="opsPerson != null and opsPerson != ''"> and ops_person = #{opsPerson}</if>
  86. <if test="chargeUnit != null and chargeUnit != ''"> and charge_unit = #{chargeUnit}</if>
  87. <if test="mode != null and mode != ''"> and mode = #{mode}</if>
  88. <if test="fileInfo != null and fileInfo != ''"> and file_info = #{fileInfo}</if>
  89. <if test="iconInfo != null and iconInfo != ''"> and icon_info = #{iconInfo}</if>
  90. <if test="ord != null and ord != ''"> and ord = #{ord}</if>
  91. </where>
  92. </select>
  93. <select id="selectDanganById" parameterType="Long" resultMap="DanganResult">
  94. <include refid="selectDanganVo"/>
  95. where dangan_id = #{danganId}
  96. </select>
  97. <insert id="insertDangan" parameterType="Dangan" useGeneratedKeys="true" keyProperty="danganId" keyColumn="dangan_id">
  98. insert into sys_dangan
  99. <trim prefix="(" suffix=")" suffixOverrides=",">
  100. <if test="danganName != null">dangan_name,</if>
  101. <if test="status != null and status != ''">status,</if>
  102. <if test="danganNo != null and danganNo != ''">dangan_no,</if>
  103. <if test="keyId != null and keyId != ''">key_id,</if>
  104. <if test="sysPerson != null">sys_person,</if>
  105. <if test="fileType != null">file_type,</if>
  106. <if test="model != null">model,</if>
  107. <if test="projectId != null">project_id,</if>
  108. <if test="brand != null">brand,</if>
  109. <if test="runDeviceId != null">run_device_id,</if>
  110. <if test="relateDeviceId != null">relate_device_id,</if>
  111. <if test="maintainItemId != null">maintain_item_id,</if>
  112. <if test="factoryTime != null">factory_time,</if>
  113. <if test="projectTime != null">project_time,</if>
  114. <if test="useUnit != null">use_unit,</if>
  115. <if test="medium != null">medium,</if>
  116. <if test="maintainTime != null">maintain_time,</if>
  117. <if test="pageAddress != null">page_address,</if>
  118. <if test="testAddress != null">test_address,</if>
  119. <if test="buildFactory != null">build_factory,</if>
  120. <if test="buildFactoryTime != null">build_factory_time,</if>
  121. <if test="factoryPerson != null">factory_person,</if>
  122. <if test="factoryPersonPhone != null">factory_person_phone,</if>
  123. <if test="language != null">language,</if>
  124. <if test="serverIp != null">server_ip,</if>
  125. <if test="serverLocation != null">server_location,</if>
  126. <if test="serverInfo != null">server_info,</if>
  127. <if test="serverBasedYesNo != null">server_based_yes_no,</if>
  128. <if test="opsPerson != null">ops_person,</if>
  129. <if test="chargeUnit != null">charge_unit,</if>
  130. <if test="mode != null">mode,</if>
  131. <if test="fileInfo != null">file_info,</if>
  132. <if test="iconInfo != null">icon_info,</if>
  133. <if test="createBy != null">create_by,</if>
  134. <if test="createTime != null">create_time,</if>
  135. <if test="updateBy != null">update_by,</if>
  136. <if test="updateTime != null">update_time,</if>
  137. <if test="remark != null">remark,</if>
  138. <if test="ord != null">ord,</if>
  139. </trim>
  140. <trim prefix="values (" suffix=")" suffixOverrides=",">
  141. <if test="danganName != null">#{danganName},</if>
  142. <if test="status != null and status != ''">#{status},</if>
  143. <if test="danganNo != null and danganNo != ''">#{danganNo},</if>
  144. <if test="keyId != null and keyId != ''">#{keyId},</if>
  145. <if test="sysPerson != null">#{sysPerson},</if>
  146. <if test="fileType != null">#{fileType},</if>
  147. <if test="model != null">#{model},</if>
  148. <if test="projectId != null">#{projectId},</if>
  149. <if test="brand != null">#{brand},</if>
  150. <if test="runDeviceId != null">#{runDeviceId},</if>
  151. <if test="relateDeviceId != null">#{relateDeviceId},</if>
  152. <if test="maintainItemId != null">#{maintainItemId},</if>
  153. <if test="factoryTime != null">#{factoryTime},</if>
  154. <if test="projectTime != null">#{projectTime},</if>
  155. <if test="useUnit != null">#{useUnit},</if>
  156. <if test="medium != null">#{medium},</if>
  157. <if test="maintainTime != null">#{maintainTime},</if>
  158. <if test="pageAddress != null">#{pageAddress},</if>
  159. <if test="testAddress != null">#{testAddress},</if>
  160. <if test="buildFactory != null">#{buildFactory},</if>
  161. <if test="buildFactoryTime != null">#{buildFactoryTime},</if>
  162. <if test="factoryPerson != null">#{factoryPerson},</if>
  163. <if test="factoryPersonPhone != null">#{factoryPersonPhone},</if>
  164. <if test="language != null">#{language},</if>
  165. <if test="serverIp != null">#{serverIp},</if>
  166. <if test="serverLocation != null">#{serverLocation},</if>
  167. <if test="serverInfo != null">#{serverInfo},</if>
  168. <if test="serverBasedYesNo != null">#{serverBasedYesNo},</if>
  169. <if test="opsPerson != null">#{opsPerson},</if>
  170. <if test="chargeUnit != null">#{chargeUnit},</if>
  171. <if test="mode != null">#{mode},</if>
  172. <if test="fileInfo != null">#{fileInfo},</if>
  173. <if test="iconInfo != null">#{iconInfo},</if>
  174. <if test="createBy != null">#{createBy},</if>
  175. <if test="createTime != null">#{createTime},</if>
  176. <if test="updateBy != null">#{updateBy},</if>
  177. <if test="updateTime != null">#{updateTime},</if>
  178. <if test="remark != null">#{remark},</if>
  179. <if test="ord != null">#{ord},</if>
  180. </trim>
  181. </insert>
  182. <update id="updateDangan" parameterType="Dangan">
  183. update sys_dangan
  184. <trim prefix="SET" suffixOverrides=",">
  185. <if test="danganName != null">dangan_name = #{danganName},</if>
  186. <if test="status != null and status != ''">status = #{status},</if>
  187. <if test="danganNo != null and danganNo != ''">dangan_no = #{danganNo},</if>
  188. <if test="keyId != null and keyId != ''">key_id = #{keyId},</if>
  189. <if test="sysPerson != null">sys_person = #{sysPerson},</if>
  190. <if test="fileType != null">file_type = #{fileType},</if>
  191. <if test="model != null">model = #{model},</if>
  192. <if test="projectId != null">project_id = #{projectId},</if>
  193. <if test="brand != null">brand = #{brand},</if>
  194. <if test="runDeviceId != null">run_device_id = #{runDeviceId},</if>
  195. <if test="relateDeviceId != null">relate_device_id = #{relateDeviceId},</if>
  196. <if test="maintainItemId != null">maintain_item_id = #{maintainItemId},</if>
  197. <if test="factoryTime != null">factory_time = #{factoryTime},</if>
  198. <if test="projectTime != null">project_time = #{projectTime},</if>
  199. <if test="useUnit != null">use_unit = #{useUnit},</if>
  200. <if test="medium != null">medium = #{medium},</if>
  201. <if test="maintainTime != null">maintain_time = #{maintainTime},</if>
  202. <if test="pageAddress != null">page_address = #{pageAddress},</if>
  203. <if test="testAddress != null">test_address = #{testAddress},</if>
  204. <if test="buildFactory != null">build_factory = #{buildFactory},</if>
  205. <if test="buildFactoryTime != null">build_factory_time = #{buildFactoryTime},</if>
  206. <if test="factoryPerson != null">factory_person = #{factoryPerson},</if>
  207. <if test="factoryPersonPhone != null">factory_person_phone = #{factoryPersonPhone},</if>
  208. <if test="language != null">language = #{language},</if>
  209. <if test="serverIp != null">server_ip = #{serverIp},</if>
  210. <if test="serverLocation != null">server_location = #{serverLocation},</if>
  211. <if test="serverInfo != null">server_info = #{serverInfo},</if>
  212. <if test="serverBasedYesNo != null">server_based_yes_no = #{serverBasedYesNo},</if>
  213. <if test="opsPerson != null">ops_person = #{opsPerson},</if>
  214. <if test="chargeUnit != null">charge_unit = #{chargeUnit},</if>
  215. <if test="mode != null">mode = #{mode},</if>
  216. <if test="fileInfo != null">file_info = #{fileInfo},</if>
  217. <if test="iconInfo != null">icon_info = #{iconInfo},</if>
  218. <if test="createBy != null">create_by = #{createBy},</if>
  219. <if test="createTime != null">create_time = #{createTime},</if>
  220. <if test="updateBy != null">update_by = #{updateBy},</if>
  221. <if test="updateTime != null">update_time = #{updateTime},</if>
  222. <if test="remark != null">remark = #{remark},</if>
  223. <if test="ord != null">ord = #{ord},</if>
  224. </trim>
  225. where dangan_id = #{danganId}
  226. </update>
  227. <delete id="deleteDanganById" parameterType="Long">
  228. delete from sys_dangan where dangan_id = #{danganId}
  229. </delete>
  230. <delete id="deleteDanganByIds" parameterType="String">
  231. delete from sys_dangan where dangan_id::VARCHAR in
  232. <foreach item="danganId" collection="array" open="(" separator="," close=")">
  233. #{danganId}
  234. </foreach>
  235. </delete>
  236. <select id="checkDanganNameUnique" parameterType="String" resultType="int">
  237. select count(1) from sys_dangan where dangan_name=#{danganName} limit 1
  238. </select>
  239. <select id="selectDanganByDanganName" parameterType="String" resultMap="DanganResult">
  240. <include refid="selectDanganVo"/>
  241. where dangan_no = #{danganName}
  242. </select>
  243. </mapper>