TbAssetInformationMapper.xml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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.asset.mapper.TbAssetInformationMapper">
  6. <resultMap type="TbAssetInformation" id="TbAssetInformationResult">
  7. <result property="id" column="id" />
  8. <result property="code" column="code" />
  9. <result property="name" column="name" />
  10. <result property="number" column="number" />
  11. <result property="imageUrl" column="image_url" />
  12. <result property="categoryNumber" column="category_number" />
  13. <result property="specificationsModel" column="specifications_model" />
  14. <result property="abcCategory" column="abc_category" />
  15. <result property="manageStatus" column="manage_status" />
  16. <result property="userDepartment" column="user_department" />
  17. <result property="department" column="department" />
  18. <result property="responsiblePerson" column="responsible_person" />
  19. <result property="locationNumber" column="location_number" />
  20. <result property="property" column="property" />
  21. <result property="purchaseDate" column="purchase_date" />
  22. <result property="commissioningDate" column="commissioning_date" />
  23. <result property="originalValue" column="original_value" />
  24. <result property="durableYears" column="durable_years" />
  25. <result property="netValue" column="net_value" />
  26. <result property="residualValue" column="residual_value" />
  27. <result property="accumulatedDepreciation" column="accumulated_depreciation" />
  28. <result property="lastDepreciationDate" column="last_depreciation_date" />
  29. <result property="depreciationMethod" column="depreciation_method" />
  30. <result property="contractNumber" column="contract_number" />
  31. <result property="factoryNumber" column="factory_number" />
  32. <result property="manufacturer" column="manufacturer" />
  33. <result property="supplier" column="supplier" />
  34. <result property="purpose" column="purpose" />
  35. <result property="maintenanceDate" column="maintenance_date" />
  36. <result property="maintenanceTel" column="maintenance_tel" />
  37. <result property="maintenanceUser" column="maintenance_user" />
  38. <result property="corporation" column="corporation" />
  39. <result property="recordStatus" column="record_status" />
  40. <result property="remark" column="remark" />
  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="isWhitelist" column="is_whitelist" />
  46. <result property="reservedColumnB" column="reserved_column_b" />
  47. <result property="reservedColumnC" column="reserved_column_c" />
  48. <result property="reservedColumnD" column="reserved_column_d" />
  49. <result property="reservedColumnE" column="reserved_column_e" />
  50. <result property="reservedColumnF" column="reserved_column_f" />
  51. <result property="reservedColumnG" column="reserved_column_g" />
  52. <result property="reservedColumnH" column="reserved_column_h" />
  53. <result property="reservedColumnI" column="reserved_column_i" />
  54. <result property="reservedColumnJ" column="reserved_column_j" />
  55. </resultMap>
  56. <sql id="selectTbAssetInformationVo">
  57. select id, code, name, number, image_url, category_number, specifications_model, abc_category, manage_status, user_department, department, responsible_person, location_number, property, purchase_date, commissioning_date, original_value, durable_years, net_value, residual_value, accumulated_depreciation, last_depreciation_date, depreciation_method, contract_number, factory_number, manufacturer, supplier, purpose, maintenance_date, maintenance_tel, maintenance_user, corporation, record_status, remark, create_by, create_time, update_by, update_time, is_whitelist, reserved_column_b, reserved_column_c, reserved_column_d, reserved_column_e, reserved_column_f, reserved_column_g, reserved_column_h, reserved_column_i, reserved_column_j from tb_asset_information
  58. </sql>
  59. <select id="selectTbAssetInformationList" parameterType="TbAssetInformation" resultMap="TbAssetInformationResult">
  60. <include refid="selectTbAssetInformationVo"/>
  61. <where>
  62. <if test="code != null and code != ''"> and code = #{code}</if>
  63. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  64. <if test="number != null and number != ''"> and number = #{number}</if>
  65. <if test="imageUrl != null and imageUrl != ''"> and image_url = #{imageUrl}</if>
  66. <if test="categoryNumber != null and categoryNumber != ''"> and category_number = #{categoryNumber}</if>
  67. <if test="specificationsModel != null and specificationsModel != ''"> and specifications_model = #{specificationsModel}</if>
  68. <if test="abcCategory != null and abcCategory != ''"> and abc_category = #{abcCategory}</if>
  69. <if test="manageStatus != null "> and manage_status = #{manageStatus}</if>
  70. <if test="userDepartment != null and userDepartment != ''"> and user_department = #{userDepartment}</if>
  71. <if test="department != null and department != ''"> and department = #{department}</if>
  72. <if test="responsiblePerson != null and responsiblePerson != ''"> and responsible_person = #{responsiblePerson}</if>
  73. <if test="locationNumber != null and locationNumber != ''"> and location_number = #{locationNumber}</if>
  74. <if test="property != null and property != ''"> and property = #{property}</if>
  75. <if test="purchaseDate != null "> and purchase_date = #{purchaseDate}</if>
  76. <if test="commissioningDate != null "> and commissioning_date = #{commissioningDate}</if>
  77. <if test="originalValue != null and originalValue != ''"> and original_value = #{originalValue}</if>
  78. <if test="durableYears != null "> and durable_years = #{durableYears}</if>
  79. <if test="netValue != null and netValue != ''"> and net_value = #{netValue}</if>
  80. <if test="residualValue != null and residualValue != ''"> and residual_value = #{residualValue}</if>
  81. <if test="accumulatedDepreciation != null and accumulatedDepreciation != ''"> and accumulated_depreciation = #{accumulatedDepreciation}</if>
  82. <if test="lastDepreciationDate != null "> and last_depreciation_date = #{lastDepreciationDate}</if>
  83. <if test="depreciationMethod != null "> and depreciation_method = #{depreciationMethod}</if>
  84. <if test="contractNumber != null and contractNumber != ''"> and contract_number = #{contractNumber}</if>
  85. <if test="factoryNumber != null and factoryNumber != ''"> and factory_number = #{factoryNumber}</if>
  86. <if test="manufacturer != null and manufacturer != ''"> and manufacturer = #{manufacturer}</if>
  87. <if test="supplier != null and supplier != ''"> and supplier = #{supplier}</if>
  88. <if test="purpose != null and purpose != ''"> and purpose = #{purpose}</if>
  89. <if test="maintenanceDate != null "> and maintenance_date = #{maintenanceDate}</if>
  90. <if test="maintenanceTel != null and maintenanceTel != ''"> and maintenance_tel = #{maintenanceTel}</if>
  91. <if test="maintenanceUser != null and maintenanceUser != ''"> and maintenance_user = #{maintenanceUser}</if>
  92. <if test="corporation != null and corporation != ''"> and corporation = #{corporation}</if>
  93. <if test="recordStatus != null "> and record_status = #{recordStatus}</if>
  94. <if test="isWhitelist != null and isWhitelist != ''"> and is_whitelist = #{isWhitelist}</if>
  95. <if test="reservedColumnB != null and reservedColumnB != ''"> and reserved_column_b = #{reservedColumnB}</if>
  96. <if test="reservedColumnC != null and reservedColumnC != ''"> and reserved_column_c = #{reservedColumnC}</if>
  97. <if test="reservedColumnD != null and reservedColumnD != ''"> and reserved_column_d = #{reservedColumnD}</if>
  98. <if test="reservedColumnE != null and reservedColumnE != ''"> and reserved_column_e = #{reservedColumnE}</if>
  99. <if test="reservedColumnF != null and reservedColumnF != ''"> and reserved_column_f = #{reservedColumnF}</if>
  100. <if test="reservedColumnG != null and reservedColumnG != ''"> and reserved_column_g = #{reservedColumnG}</if>
  101. <if test="reservedColumnH != null and reservedColumnH != ''"> and reserved_column_h = #{reservedColumnH}</if>
  102. <if test="reservedColumnI != null and reservedColumnI != ''"> and reserved_column_i = #{reservedColumnI}</if>
  103. <if test="reservedColumnJ != null and reservedColumnJ != ''"> and reserved_column_j = #{reservedColumnJ}</if>
  104. </where>
  105. </select>
  106. <select id="selectTbAssetInformationById" parameterType="Long" resultMap="TbAssetInformationResult">
  107. <include refid="selectTbAssetInformationVo"/>
  108. where id = #{id}
  109. </select>
  110. <insert id="insertTbAssetInformation" parameterType="TbAssetInformation" useGeneratedKeys="true" keyProperty="id">
  111. insert into tb_asset_information
  112. <trim prefix="(" suffix=")" suffixOverrides=",">
  113. <if test="code != null">code,</if>
  114. <if test="name != null">name,</if>
  115. <if test="number != null and number != ''">number,</if>
  116. <if test="imageUrl != null">image_url,</if>
  117. <if test="categoryNumber != null">category_number,</if>
  118. <if test="specificationsModel != null and specificationsModel != ''">specifications_model,</if>
  119. <if test="abcCategory != null">abc_category,</if>
  120. <if test="manageStatus != null">manage_status,</if>
  121. <if test="userDepartment != null">user_department,</if>
  122. <if test="department != null">department,</if>
  123. <if test="responsiblePerson != null">responsible_person,</if>
  124. <if test="locationNumber != null">location_number,</if>
  125. <if test="property != null">property,</if>
  126. <if test="purchaseDate != null">purchase_date,</if>
  127. <if test="commissioningDate != null">commissioning_date,</if>
  128. <if test="originalValue != null">original_value,</if>
  129. <if test="durableYears != null">durable_years,</if>
  130. <if test="netValue != null">net_value,</if>
  131. <if test="residualValue != null">residual_value,</if>
  132. <if test="accumulatedDepreciation != null">accumulated_depreciation,</if>
  133. <if test="lastDepreciationDate != null">last_depreciation_date,</if>
  134. <if test="depreciationMethod != null">depreciation_method,</if>
  135. <if test="contractNumber != null">contract_number,</if>
  136. <if test="factoryNumber != null">factory_number,</if>
  137. <if test="manufacturer != null">manufacturer,</if>
  138. <if test="supplier != null">supplier,</if>
  139. <if test="purpose != null">purpose,</if>
  140. <if test="maintenanceDate != null">maintenance_date,</if>
  141. <if test="maintenanceTel != null">maintenance_tel,</if>
  142. <if test="maintenanceUser != null">maintenance_user,</if>
  143. <if test="corporation != null">corporation,</if>
  144. <if test="recordStatus != null">record_status,</if>
  145. <if test="remark != null">remark,</if>
  146. <if test="createBy != null">create_by,</if>
  147. <if test="createTime != null">create_time,</if>
  148. <if test="updateBy != null">update_by,</if>
  149. <if test="updateTime != null">update_time,</if>
  150. <if test="isWhitelist != null">is_whitelist,</if>
  151. <if test="reservedColumnB != null">reserved_column_b,</if>
  152. <if test="reservedColumnC != null">reserved_column_c,</if>
  153. <if test="reservedColumnD != null">reserved_column_d,</if>
  154. <if test="reservedColumnE != null">reserved_column_e,</if>
  155. <if test="reservedColumnF != null">reserved_column_f,</if>
  156. <if test="reservedColumnG != null">reserved_column_g,</if>
  157. <if test="reservedColumnH != null">reserved_column_h,</if>
  158. <if test="reservedColumnI != null">reserved_column_i,</if>
  159. <if test="reservedColumnJ != null">reserved_column_j,</if>
  160. </trim>
  161. <trim prefix="values (" suffix=")" suffixOverrides=",">
  162. <if test="code != null">#{code},</if>
  163. <if test="name != null">#{name},</if>
  164. <if test="number != null and number != ''">#{number},</if>
  165. <if test="imageUrl != null">#{imageUrl},</if>
  166. <if test="categoryNumber != null">#{categoryNumber},</if>
  167. <if test="specificationsModel != null and specificationsModel != ''">#{specificationsModel},</if>
  168. <if test="abcCategory != null">#{abcCategory},</if>
  169. <if test="manageStatus != null">#{manageStatus},</if>
  170. <if test="userDepartment != null">#{userDepartment},</if>
  171. <if test="department != null">#{department},</if>
  172. <if test="responsiblePerson != null">#{responsiblePerson},</if>
  173. <if test="locationNumber != null">#{locationNumber},</if>
  174. <if test="property != null">#{property},</if>
  175. <if test="purchaseDate != null">#{purchaseDate},</if>
  176. <if test="commissioningDate != null">#{commissioningDate},</if>
  177. <if test="originalValue != null">#{originalValue},</if>
  178. <if test="durableYears != null">#{durableYears},</if>
  179. <if test="netValue != null">#{netValue},</if>
  180. <if test="residualValue != null">#{residualValue},</if>
  181. <if test="accumulatedDepreciation != null">#{accumulatedDepreciation},</if>
  182. <if test="lastDepreciationDate != null">#{lastDepreciationDate},</if>
  183. <if test="depreciationMethod != null">#{depreciationMethod},</if>
  184. <if test="contractNumber != null">#{contractNumber},</if>
  185. <if test="factoryNumber != null">#{factoryNumber},</if>
  186. <if test="manufacturer != null">#{manufacturer},</if>
  187. <if test="supplier != null">#{supplier},</if>
  188. <if test="purpose != null">#{purpose},</if>
  189. <if test="maintenanceDate != null">#{maintenanceDate},</if>
  190. <if test="maintenanceTel != null">#{maintenanceTel},</if>
  191. <if test="maintenanceUser != null">#{maintenanceUser},</if>
  192. <if test="corporation != null">#{corporation},</if>
  193. <if test="recordStatus != null">#{recordStatus},</if>
  194. <if test="remark != null">#{remark},</if>
  195. <if test="createBy != null">#{createBy},</if>
  196. <if test="createTime != null">#{createTime},</if>
  197. <if test="updateBy != null">#{updateBy},</if>
  198. <if test="updateTime != null">#{updateTime},</if>
  199. <if test="isWhitelist != null">#{isWhitelist},</if>
  200. <if test="reservedColumnB != null">#{reservedColumnB},</if>
  201. <if test="reservedColumnC != null">#{reservedColumnC},</if>
  202. <if test="reservedColumnD != null">#{reservedColumnD},</if>
  203. <if test="reservedColumnE != null">#{reservedColumnE},</if>
  204. <if test="reservedColumnF != null">#{reservedColumnF},</if>
  205. <if test="reservedColumnG != null">#{reservedColumnG},</if>
  206. <if test="reservedColumnH != null">#{reservedColumnH},</if>
  207. <if test="reservedColumnI != null">#{reservedColumnI},</if>
  208. <if test="reservedColumnJ != null">#{reservedColumnJ},</if>
  209. </trim>
  210. </insert>
  211. <update id="updateTbAssetInformation" parameterType="TbAssetInformation">
  212. update tb_asset_information
  213. <trim prefix="SET" suffixOverrides=",">
  214. <if test="code != null">code = #{code},</if>
  215. <if test="name != null">name = #{name},</if>
  216. <if test="number != null and number != ''">number = #{number},</if>
  217. <if test="imageUrl != null">image_url = #{imageUrl},</if>
  218. <if test="categoryNumber != null">category_number = #{categoryNumber},</if>
  219. <if test="specificationsModel != null and specificationsModel != ''">specifications_model = #{specificationsModel},</if>
  220. <if test="abcCategory != null">abc_category = #{abcCategory},</if>
  221. <if test="manageStatus != null">manage_status = #{manageStatus},</if>
  222. <if test="userDepartment != null">user_department = #{userDepartment},</if>
  223. <if test="department != null">department = #{department},</if>
  224. <if test="responsiblePerson != null">responsible_person = #{responsiblePerson},</if>
  225. <if test="locationNumber != null">location_number = #{locationNumber},</if>
  226. <if test="property != null">property = #{property},</if>
  227. <if test="purchaseDate != null">purchase_date = #{purchaseDate},</if>
  228. <if test="commissioningDate != null">commissioning_date = #{commissioningDate},</if>
  229. <if test="originalValue != null">original_value = #{originalValue},</if>
  230. <if test="durableYears != null">durable_years = #{durableYears},</if>
  231. <if test="netValue != null">net_value = #{netValue},</if>
  232. <if test="residualValue != null">residual_value = #{residualValue},</if>
  233. <if test="accumulatedDepreciation != null">accumulated_depreciation = #{accumulatedDepreciation},</if>
  234. <if test="lastDepreciationDate != null">last_depreciation_date = #{lastDepreciationDate},</if>
  235. <if test="depreciationMethod != null">depreciation_method = #{depreciationMethod},</if>
  236. <if test="contractNumber != null">contract_number = #{contractNumber},</if>
  237. <if test="factoryNumber != null">factory_number = #{factoryNumber},</if>
  238. <if test="manufacturer != null">manufacturer = #{manufacturer},</if>
  239. <if test="supplier != null">supplier = #{supplier},</if>
  240. <if test="purpose != null">purpose = #{purpose},</if>
  241. <if test="maintenanceDate != null">maintenance_date = #{maintenanceDate},</if>
  242. <if test="maintenanceTel != null">maintenance_tel = #{maintenanceTel},</if>
  243. <if test="maintenanceUser != null">maintenance_user = #{maintenanceUser},</if>
  244. <if test="corporation != null">corporation = #{corporation},</if>
  245. <if test="recordStatus != null">record_status = #{recordStatus},</if>
  246. <if test="remark != null">remark = #{remark},</if>
  247. <if test="createBy != null">create_by = #{createBy},</if>
  248. <if test="createTime != null">create_time = #{createTime},</if>
  249. <if test="updateBy != null">update_by = #{updateBy},</if>
  250. <if test="updateTime != null">update_time = #{updateTime},</if>
  251. <if test="isWhitelist != null">is_whitelist = #{isWhitelist},</if>
  252. <if test="reservedColumnB != null">reserved_column_b = #{reservedColumnB},</if>
  253. <if test="reservedColumnC != null">reserved_column_c = #{reservedColumnC},</if>
  254. <if test="reservedColumnD != null">reserved_column_d = #{reservedColumnD},</if>
  255. <if test="reservedColumnE != null">reserved_column_e = #{reservedColumnE},</if>
  256. <if test="reservedColumnF != null">reserved_column_f = #{reservedColumnF},</if>
  257. <if test="reservedColumnG != null">reserved_column_g = #{reservedColumnG},</if>
  258. <if test="reservedColumnH != null">reserved_column_h = #{reservedColumnH},</if>
  259. <if test="reservedColumnI != null">reserved_column_i = #{reservedColumnI},</if>
  260. <if test="reservedColumnJ != null">reserved_column_j = #{reservedColumnJ},</if>
  261. </trim>
  262. where id = #{id}
  263. </update>
  264. <delete id="deleteTbAssetInformationById" parameterType="Long">
  265. delete from tb_asset_information where id = #{id}
  266. </delete>
  267. <delete id="deleteTbAssetInformationByIds" parameterType="String">
  268. delete from tb_asset_information where id in
  269. <foreach item="id" collection="array" open="(" separator="," close=")">
  270. #{id}
  271. </foreach>
  272. </delete>
  273. </mapper>