综合办公系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CmcContractPaymentMapper.xml 4.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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.oa.mapper.CmcContractPaymentMapper">
  6. <resultMap type="CmcContractPayment" id="CmcContractPaymentResult">
  7. <result property="paymentId" column="payment_id" />
  8. <result property="contractId" column="contract_id" />
  9. <result property="paymentCondition" column="payment_condition" />
  10. <result property="paymentPercentage" column="payment_percentage" />
  11. <result property="paymentAmount" column="payment_amount" />
  12. <result property="paymentTime" column="payment_time" />
  13. <result property="remark" column="remark" />
  14. </resultMap>
  15. <sql id="selectCmcContractPaymentVo">
  16. select payment_id, contract_id, payment_condition, payment_percentage, payment_amount, payment_time, remark from cmc_contract_payment
  17. </sql>
  18. <select id="selectCmcContractPaymentList" parameterType="CmcContractPayment" resultMap="CmcContractPaymentResult">
  19. <include refid="selectCmcContractPaymentVo"/>
  20. <where>
  21. <if test="contractId != null and contractId != ''"> and contract_id like concat('%', #{contractId}, '%')</if>
  22. <if test="paymentCondition != null and paymentCondition != ''"> and payment_condition = #{paymentCondition}</if>
  23. <if test="paymentPercentage != null and paymentPercentage != ''"> and payment_percentage = #{paymentPercentage}</if>
  24. <if test="paymentAmount != null and paymentAmount != ''"> and payment_amount = #{paymentAmount}</if>
  25. <if test="paymentTime != null "> and payment_time = #{paymentTime}</if>
  26. </where>
  27. </select>
  28. <select id="selectCmcContractPaymentByPaymentId" parameterType="String" resultMap="CmcContractPaymentResult">
  29. <include refid="selectCmcContractPaymentVo"/>
  30. where payment_id = #{paymentId}
  31. </select>
  32. <insert id="insertCmcContractPayment" parameterType="CmcContractPayment">
  33. insert into cmc_contract_payment
  34. <trim prefix="(" suffix=")" suffixOverrides=",">
  35. <if test="paymentId != null">payment_id,</if>
  36. <if test="contractId != null">contract_id,</if>
  37. <if test="paymentCondition != null">payment_condition,</if>
  38. <if test="paymentPercentage != null">payment_percentage,</if>
  39. <if test="paymentAmount != null">payment_amount,</if>
  40. <if test="paymentTime != null">payment_time,</if>
  41. <if test="remark != null">remark,</if>
  42. </trim>
  43. <trim prefix="values (" suffix=")" suffixOverrides=",">
  44. <if test="paymentId != null">#{paymentId},</if>
  45. <if test="contractId != null">#{contractId},</if>
  46. <if test="paymentCondition != null">#{paymentCondition},</if>
  47. <if test="paymentPercentage != null">#{paymentPercentage},</if>
  48. <if test="paymentAmount != null">#{paymentAmount},</if>
  49. <if test="paymentTime != null">#{paymentTime},</if>
  50. <if test="remark != null">#{remark},</if>
  51. </trim>
  52. </insert>
  53. <update id="updateCmcContractPayment" parameterType="CmcContractPayment">
  54. update cmc_contract_payment
  55. <trim prefix="SET" suffixOverrides=",">
  56. <if test="contractId != null">contract_id = #{contractId},</if>
  57. <if test="paymentCondition != null">payment_condition = #{paymentCondition},</if>
  58. <if test="paymentPercentage != null">payment_percentage = #{paymentPercentage},</if>
  59. <if test="paymentAmount != null">payment_amount = #{paymentAmount},</if>
  60. <if test="paymentTime != null">payment_time = #{paymentTime},</if>
  61. <if test="remark != null">remark = #{remark},</if>
  62. </trim>
  63. where payment_id = #{paymentId}
  64. </update>
  65. <delete id="deleteCmcContractPaymentByPaymentId" parameterType="String">
  66. delete from cmc_contract_payment where payment_id = #{paymentId}
  67. </delete>
  68. <delete id="deleteCmcContractPaymentByPaymentIds" parameterType="String">
  69. delete from cmc_contract_payment where payment_id in
  70. <foreach item="paymentId" collection="array" open="(" separator="," close=")">
  71. #{paymentId}
  72. </foreach>
  73. </delete>
  74. </mapper>