TbAssetOrderMapper.xml 5.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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.change.mapper.TbAssetOrderMapper">
  6. <resultMap type="TbAssetOrder" id="TbAssetOrderResult">
  7. <result property="id" column="id" />
  8. <result property="orderNumber" column="order_number" />
  9. <result property="assetTotalOriginalValue" column="asset_total_original_value" />
  10. <result property="assetTotalNetValue" column="asset_total_net_value" />
  11. <result property="applicationDate" column="application_date" />
  12. <result property="applicationDepartment" column="application_department" />
  13. <result property="reason" column="reason" />
  14. <result property="preparedBy" column="prepared_by" />
  15. <result property="preparedDepartment" column="prepared_department" />
  16. <result property="corporation" column="corporation" />
  17. <result property="recordStatus" column="record_status" />
  18. </resultMap>
  19. <sql id="selectTbAssetOrderVo">
  20. select id, order_number, asset_total_original_value, asset_total_net_value, application_date, application_department, reason, prepared_by, prepared_department, corporation, record_status from tb_asset_order
  21. </sql>
  22. <select id="selectTbAssetOrderList" parameterType="TbAssetOrder" resultMap="TbAssetOrderResult">
  23. <include refid="selectTbAssetOrderVo"/>
  24. <where>
  25. <if test="orderNumber != null and orderNumber != ''"> and order_number = #{orderNumber}</if>
  26. <if test="applicationDate != null "> and application_date = #{applicationDate}</if>
  27. <if test="applicationDepartment != null and applicationDepartment != ''"> and application_department = #{applicationDepartment}</if>
  28. <if test="preparedBy != null and preparedBy != ''"> and prepared_by = #{preparedBy}</if>
  29. <if test="preparedDepartment != null and preparedDepartment != ''"> and prepared_department = #{preparedDepartment}</if>
  30. <if test="corporation != null and corporation != ''"> and corporation = #{corporation}</if>
  31. <if test="recordStatus != null "> and record_status = #{recordStatus}</if>
  32. </where>
  33. </select>
  34. <select id="selectTbAssetOrderById" parameterType="Long" resultMap="TbAssetOrderResult">
  35. <include refid="selectTbAssetOrderVo"/>
  36. where id = #{id}
  37. </select>
  38. <insert id="insertTbAssetOrder" parameterType="TbAssetOrder" useGeneratedKeys="true" keyProperty="id">
  39. insert into tb_asset_order
  40. <trim prefix="(" suffix=")" suffixOverrides=",">
  41. <if test="orderNumber != null and orderNumber != ''">order_number,</if>
  42. <if test="assetTotalOriginalValue != null">asset_total_original_value,</if>
  43. <if test="assetTotalNetValue != null">asset_total_net_value,</if>
  44. <if test="applicationDate != null">application_date,</if>
  45. <if test="applicationDepartment != null">application_department,</if>
  46. <if test="reason != null">reason,</if>
  47. <if test="preparedBy != null and preparedBy != ''">prepared_by,</if>
  48. <if test="preparedDepartment != null">prepared_department,</if>
  49. <if test="corporation != null">corporation,</if>
  50. <if test="recordStatus != null">record_status,</if>
  51. </trim>
  52. <trim prefix="values (" suffix=")" suffixOverrides=",">
  53. <if test="orderNumber != null and orderNumber != ''">#{orderNumber},</if>
  54. <if test="assetTotalOriginalValue != null">#{assetTotalOriginalValue},</if>
  55. <if test="assetTotalNetValue != null">#{assetTotalNetValue},</if>
  56. <if test="applicationDate != null">#{applicationDate},</if>
  57. <if test="applicationDepartment != null">#{applicationDepartment},</if>
  58. <if test="reason != null">#{reason},</if>
  59. <if test="preparedBy != null and preparedBy != ''">#{preparedBy},</if>
  60. <if test="preparedDepartment != null">#{preparedDepartment},</if>
  61. <if test="corporation != null">#{corporation},</if>
  62. <if test="recordStatus != null">#{recordStatus},</if>
  63. </trim>
  64. </insert>
  65. <update id="updateTbAssetOrder" parameterType="TbAssetOrder">
  66. update tb_asset_order
  67. <trim prefix="SET" suffixOverrides=",">
  68. <if test="orderNumber != null and orderNumber != ''">order_number = #{orderNumber},</if>
  69. <if test="assetTotalOriginalValue != null">asset_total_original_value = #{assetTotalOriginalValue},</if>
  70. <if test="assetTotalNetValue != null">asset_total_net_value = #{assetTotalNetValue},</if>
  71. <if test="applicationDate != null">application_date = #{applicationDate},</if>
  72. <if test="applicationDepartment != null">application_department = #{applicationDepartment},</if>
  73. <if test="reason != null">reason = #{reason},</if>
  74. <if test="preparedBy != null and preparedBy != ''">prepared_by = #{preparedBy},</if>
  75. <if test="preparedDepartment != null">prepared_department = #{preparedDepartment},</if>
  76. <if test="corporation != null">corporation = #{corporation},</if>
  77. <if test="recordStatus != null">record_status = #{recordStatus},</if>
  78. </trim>
  79. where id = #{id}
  80. </update>
  81. <delete id="deleteTbAssetOrderById" parameterType="Long">
  82. delete from tb_asset_order where id = #{id}
  83. </delete>
  84. <delete id="deleteTbAssetOrderByIds" parameterType="String">
  85. delete from tb_asset_order where id in
  86. <foreach item="id" collection="array" open="(" separator="," close=")">
  87. #{id}
  88. </foreach>
  89. </delete>
  90. </mapper>