ProjectBillsHistoryMapper.xml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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.orderPlan.mapper.ProjectBillsHistoryMapper">
  6. <resultMap type="ProjectBillsHistory" id="ProjectBillsHistoryResult">
  7. <result property="id" column="id"/>
  8. <result property="actId" column="act_id"/>
  9. <result property="projectId" column="project_id"/>
  10. <result property="serialNumber" column="serial_number"/>
  11. <result property="modifyReason" column="modify_reason"/>
  12. <result property="historyUser" column="history_user"/>
  13. <result property="historyDate" column="history_date"/>
  14. <result property="historyBody1" column="history_body1"/>
  15. <result property="historyBody2" column="history_body2"/>
  16. <result property="historyBody3" column="history_body3"/>
  17. <result property="historyBody4" column="history_body4"/>
  18. <result property="historyBody5" column="history_body5"/>
  19. </resultMap>
  20. <sql id="selectProjectBillsHistoryVo">
  21. select id, act_id, project_id, serial_number, modify_reason, history_user, history_date, history_body1, history_body2, history_body3, history_body4, history_body5 from project_bills_history
  22. </sql>
  23. <select id="selectProjectBillsHistoryList" parameterType="ProjectBillsHistory"
  24. resultMap="ProjectBillsHistoryResult">
  25. <include refid="selectProjectBillsHistoryVo"/>
  26. <where>
  27. <if test="actId != null ">and act_id = #{actId}</if>
  28. <if test="projectId != null ">and project_id = #{projectId}</if>
  29. <if test="serialNumber != null and serialNumber != ''">and serial_number = #{serialNumber}</if>
  30. <if test="modifyReason != null and modifyReason != ''">and modify_reason = #{modifyReason}</if>
  31. <if test="historyUser != null ">and history_user = #{historyUser}</if>
  32. <if test="historyDate != null ">and history_date = #{historyDate}</if>
  33. <if test="historyBody1 != null and historyBody1 != ''">and history_body1 = #{historyBody1}</if>
  34. <if test="historyBody2 != null and historyBody2 != ''">and history_body2 = #{historyBody2}</if>
  35. <if test="historyBody3 != null and historyBody3 != ''">and history_body3 = #{historyBody3}</if>
  36. <if test="historyBody4 != null and historyBody4 != ''">and history_body4 = #{historyBody4}</if>
  37. <if test="historyBody5 != null and historyBody5 != ''">and history_body5 = #{historyBody5}</if>
  38. </where>
  39. </select>
  40. <select id="selectProjectBillsHistoryById" parameterType="Long" resultMap="ProjectBillsHistoryResult">
  41. <include refid="selectProjectBillsHistoryVo"/>
  42. where id = #{id}
  43. </select>
  44. <insert id="insertProjectBillsHistory" parameterType="ProjectBillsHistory" useGeneratedKeys="true" keyProperty="id">
  45. insert into project_bills_history
  46. <trim prefix="(" suffix=")" suffixOverrides=",">
  47. <if test="actId != null">act_id,</if>
  48. <if test="projectId != null">project_id,</if>
  49. <if test="serialNumber != null">serial_number,</if>
  50. <if test="modifyReason != null">modify_reason,</if>
  51. <if test="historyUser != null">history_user,</if>
  52. <if test="historyDate != null">history_date,</if>
  53. <if test="historyBody1 != null">history_body1,</if>
  54. <if test="historyBody2 != null">history_body2,</if>
  55. <if test="historyBody3 != null">history_body3,</if>
  56. <if test="historyBody4 != null">history_body4,</if>
  57. <if test="historyBody5 != null">history_body5,</if>
  58. </trim>
  59. <trim prefix="values (" suffix=")" suffixOverrides=",">
  60. <if test="actId != null">#{actId},</if>
  61. <if test="projectId != null">#{projectId},</if>
  62. <if test="serialNumber != null">#{serialNumber},</if>
  63. <if test="modifyReason != null">#{modifyReason},</if>
  64. <if test="historyUser != null">#{historyUser},</if>
  65. <if test="historyDate != null">#{historyDate},</if>
  66. <if test="historyBody1 != null">#{historyBody1},</if>
  67. <if test="historyBody2 != null">#{historyBody2},</if>
  68. <if test="historyBody3 != null">#{historyBody3},</if>
  69. <if test="historyBody4 != null">#{historyBody4},</if>
  70. <if test="historyBody5 != null">#{historyBody5},</if>
  71. </trim>
  72. </insert>
  73. <update id="updateProjectBillsHistory" parameterType="ProjectBillsHistory">
  74. update project_bills_history
  75. <trim prefix="SET" suffixOverrides=",">
  76. <if test="actId != null">act_id = #{actId},</if>
  77. <if test="projectId != null">project_id = #{projectId},</if>
  78. <if test="serialNumber != null">serial_number = #{serialNumber},</if>
  79. <if test="modifyReason != null">modify_reason = #{modifyReason},</if>
  80. <if test="historyUser != null">history_user = #{historyUser},</if>
  81. <if test="historyDate != null">history_date = #{historyDate},</if>
  82. <if test="historyBody1 != null">history_body1 = #{historyBody1},</if>
  83. <if test="historyBody2 != null">history_body2 = #{historyBody2},</if>
  84. <if test="historyBody3 != null">history_body3 = #{historyBody3},</if>
  85. <if test="historyBody4 != null">history_body4 = #{historyBody4},</if>
  86. <if test="historyBody5 != null">history_body5 = #{historyBody5},</if>
  87. </trim>
  88. where id = #{id}
  89. </update>
  90. <delete id="deleteProjectBillsHistoryById" parameterType="Long">
  91. delete from project_bills_history where id = #{id}
  92. </delete>
  93. <delete id="deleteProjectBillsHistoryByIds" parameterType="String">
  94. delete from project_bills_history where id in
  95. <foreach item="id" collection="array" open="(" separator="," close=")">
  96. #{id}
  97. </foreach>
  98. </delete>
  99. </mapper>