综合办公系统
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

CmcContractMapper.xml 8.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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.CmcContractMapper">
  6. <resultMap type="CmcContract" id="CmcContractResult">
  7. <result property="contractId" column="contract_id" />
  8. <result property="contractNumber" column="contract_number" />
  9. <result property="contractName" column="contract_name" />
  10. <result property="partyA" column="party_a" />
  11. <result property="contactPerson" column="contact_person" />
  12. <result property="telephone" column="telephone" />
  13. <result property="projectType" column="project_type" />
  14. <result property="projectSource" column="project_source" />
  15. <result property="undertakingDept" column="undertaking_dept" />
  16. <result property="amount" column="amount" />
  17. <result property="deposit" column="deposit" />
  18. <result property="contractDocument" column="contract_document" />
  19. <result property="drafter" column="drafter" />
  20. <result property="draftTime" column="draft_time" />
  21. <result property="projectIds" column="project_ids" />
  22. <result property="remark" column="remark" />
  23. <result property="signDate" column="sign_date" />
  24. <result property="signRemark" column="sign_remark" />
  25. <result property="signScan" column="sign_scan" />
  26. <result property="commentType" column="comment_type" />
  27. </resultMap>
  28. <sql id="selectCmcContractVo">
  29. select contract_id, contract_number, contract_name, party_a, contact_person, telephone, project_type, project_source, undertaking_dept, amount, deposit, contract_document, drafter, draft_time, project_ids, remark, sign_date, sign_remark, sign_scan, comment_type from cmc_contract
  30. </sql>
  31. <select id="selectCmcContractList" parameterType="CmcContract" resultMap="CmcContractResult">
  32. <include refid="selectCmcContractVo"/>
  33. <where>
  34. <if test="contractNumber != null and contractNumber != ''"> and contract_number like concat('%', #{contractNumber}, '%')</if>
  35. <if test="contractName != null and contractName != ''"> and contract_name like concat('%', #{contractName}, '%')</if>
  36. <if test="partyA != null and partyA != ''"> and party_a like concat('%', #{partyA}, '%')</if>
  37. <if test="contactPerson != null and contactPerson != ''"> and contact_person like concat('%', #{contactPerson}, '%')</if>
  38. <if test="telephone != null and telephone != ''"> and telephone like concat('%', #{telephone}, '%')</if>
  39. <if test="projectType != null and projectType != ''"> and project_type like concat('%', #{projectType}, '%')</if>
  40. <if test="projectSource != null and projectSource != ''"> and project_source = #{projectSource}</if>
  41. <if test="undertakingDept != null and undertakingDept != ''"> and undertaking_dept = #{undertakingDept}</if>
  42. <if test="amount != null "> and amount = #{amount}</if>
  43. <if test="deposit != null "> and deposit = #{deposit}</if>
  44. <if test="contractDocument != null and contractDocument != ''"> and contract_document = #{contractDocument}</if>
  45. <if test="drafter != null "> and drafter = #{drafter}</if>
  46. <if test="draftTime != null "> and draft_time = #{draftTime}</if>
  47. <if test="projectIds != null and projectIds != ''"> and project_ids = #{projectIds}</if>
  48. <if test="signDate != null "> and sign_date = #{signDate}</if>
  49. <if test="signRemark != null and signRemark != ''"> and sign_remark = #{signRemark}</if>
  50. <if test="signScan != null and signScan != ''"> and sign_scan = #{signScan}</if>
  51. <if test="commentType != null and commentType != ''"> and comment_type = #{commentType}</if>
  52. </where>
  53. </select>
  54. <select id="selectCmcContractByContractId" parameterType="String" resultMap="CmcContractResult">
  55. <include refid="selectCmcContractVo"/>
  56. where contract_id = #{contractId}
  57. </select>
  58. <insert id="insertCmcContract" parameterType="CmcContract">
  59. insert into cmc_contract
  60. <trim prefix="(" suffix=")" suffixOverrides=",">
  61. <if test="contractId != null">contract_id,</if>
  62. <if test="contractNumber != null">contract_number,</if>
  63. <if test="contractName != null">contract_name,</if>
  64. <if test="partyA != null">party_a,</if>
  65. <if test="contactPerson != null">contact_person,</if>
  66. <if test="telephone != null">telephone,</if>
  67. <if test="projectType != null">project_type,</if>
  68. <if test="projectSource != null">project_source,</if>
  69. <if test="undertakingDept != null">undertaking_dept,</if>
  70. <if test="amount != null">amount,</if>
  71. <if test="deposit != null">deposit,</if>
  72. <if test="contractDocument != null">contract_document,</if>
  73. <if test="drafter != null">drafter,</if>
  74. <if test="draftTime != null">draft_time,</if>
  75. <if test="projectIds != null">project_ids,</if>
  76. <if test="remark != null">remark,</if>
  77. <if test="signDate != null">sign_date,</if>
  78. <if test="signRemark != null">sign_remark,</if>
  79. <if test="signScan != null">sign_scan,</if>
  80. <if test="commentType != null">comment_type,</if>
  81. </trim>
  82. <trim prefix="values (" suffix=")" suffixOverrides=",">
  83. <if test="contractId != null">#{contractId},</if>
  84. <if test="contractNumber != null">#{contractNumber},</if>
  85. <if test="contractName != null">#{contractName},</if>
  86. <if test="partyA != null">#{partyA},</if>
  87. <if test="contactPerson != null">#{contactPerson},</if>
  88. <if test="telephone != null">#{telephone},</if>
  89. <if test="projectType != null">#{projectType},</if>
  90. <if test="projectSource != null">#{projectSource},</if>
  91. <if test="undertakingDept != null">#{undertakingDept},</if>
  92. <if test="amount != null">#{amount},</if>
  93. <if test="deposit != null">#{deposit},</if>
  94. <if test="contractDocument != null">#{contractDocument},</if>
  95. <if test="drafter != null">#{drafter},</if>
  96. <if test="draftTime != null">#{draftTime},</if>
  97. <if test="projectIds != null">#{projectIds},</if>
  98. <if test="remark != null">#{remark},</if>
  99. <if test="signDate != null">#{signDate},</if>
  100. <if test="signRemark != null">#{signRemark},</if>
  101. <if test="signScan != null">#{signScan},</if>
  102. <if test="commentType != null">#{commentType},</if>
  103. </trim>
  104. </insert>
  105. <update id="updateCmcContract" parameterType="CmcContract">
  106. update cmc_contract
  107. <trim prefix="SET" suffixOverrides=",">
  108. <if test="contractNumber != null">contract_number = #{contractNumber},</if>
  109. <if test="contractName != null">contract_name = #{contractName},</if>
  110. <if test="partyA != null">party_a = #{partyA},</if>
  111. <if test="contactPerson != null">contact_person = #{contactPerson},</if>
  112. <if test="telephone != null">telephone = #{telephone},</if>
  113. <if test="projectType != null">project_type = #{projectType},</if>
  114. <if test="projectSource != null">project_source = #{projectSource},</if>
  115. <if test="undertakingDept != null">undertaking_dept = #{undertakingDept},</if>
  116. <if test="amount != null">amount = #{amount},</if>
  117. <if test="deposit != null">deposit = #{deposit},</if>
  118. <if test="contractDocument != null">contract_document = #{contractDocument},</if>
  119. <if test="drafter != null">drafter = #{drafter},</if>
  120. <if test="draftTime != null">draft_time = #{draftTime},</if>
  121. <if test="projectIds != null">project_ids = #{projectIds},</if>
  122. <if test="remark != null">remark = #{remark},</if>
  123. <if test="signDate != null">sign_date = #{signDate},</if>
  124. <if test="signRemark != null">sign_remark = #{signRemark},</if>
  125. <if test="signScan != null">sign_scan = #{signScan},</if>
  126. <if test="commentType != null">comment_type = #{commentType},</if>
  127. </trim>
  128. where contract_id = #{contractId}
  129. </update>
  130. <delete id="deleteCmcContractByContractId" parameterType="String">
  131. delete from cmc_contract where contract_id = #{contractId}
  132. </delete>
  133. <delete id="deleteCmcContractByContractIds" parameterType="String">
  134. delete from cmc_contract where contract_id in
  135. <foreach item="contractId" collection="array" open="(" separator="," close=")">
  136. #{contractId}
  137. </foreach>
  138. </delete>
  139. </mapper>