综合办公系统
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.

CmcContractMapper.xml 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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="contractName" column="contract_name" />
  9. <result property="contractCode" column="contract_code" />
  10. <result property="contractNumber" column="contract_number" />
  11. <result property="tenderId" column="tender_id" />
  12. <result property="partyAId" column="party_a_id" />
  13. <result property="amount" column="amount" />
  14. <result property="deposit" column="deposit" />
  15. <result property="contractDocument" column="contract_document" />
  16. <result property="drafter" column="drafter" />
  17. <result property="draftTime" column="draft_time" />
  18. <result property="remark" column="remark" />
  19. <result property="signDate" column="sign_date" />
  20. <result property="signRemark" column="sign_remark" />
  21. <result property="signScan" column="sign_scan" />
  22. <result property="commentType" column="comment_type" />
  23. <result property="managerComment" column="manager_comment" />
  24. <result property="managerUserId" column="manager_user_id" />
  25. <result property="managerTime" column="manager_time" />
  26. <association property="draftUser" javaType="SysUser" resultMap="DraftUserResult" />
  27. <association property="managerUser" javaType="SysUser" resultMap="ManagerUserResult" />
  28. <association property="tender" javaType="CmcTender" resultMap="CmcTenderResult" />
  29. <association property="partyA" javaType="CmcPartyA" resultMap="CmcPartyAResult" />
  30. </resultMap>
  31. <resultMap type="CmcTender" id="CmcTenderResult">
  32. <result property="tenderId" column="tender_id" />
  33. <result property="projectName" column="project_name" />
  34. <result property="partyAId" column="party_a_id" />
  35. <result property="aPerson" column="a_person" />
  36. <result property="aPhone" column="a_phone" />
  37. <result property="agent" column="agent" />
  38. <result property="agentPerson" column="agent_person" />
  39. <result property="agentPhone" column="agent_phone" />
  40. </resultMap>
  41. <resultMap type="SysUser" id="DraftUserResult">
  42. <result property="userId" column="user_id" />
  43. <result property="nickName" column="draft_nick_name" />
  44. </resultMap>
  45. <resultMap type="SysUser" id="ManagerUserResult">
  46. <result property="userId" column="user_id" />
  47. <result property="nickName" column="manager_nick_name" />
  48. </resultMap>
  49. <resultMap type="CmcPartyA" id="CmcPartyAResult">
  50. <result property="partyAId" column="party_a_id" />
  51. <result property="partyAName" column="party_a_name" />
  52. </resultMap>
  53. <sql id="selectCmcContractVo">
  54. select c.contract_id, c.contract_code, c.contract_name, c.contract_number, c.tender_id, c.party_a_id, pa.party_a_name, t.project_name as project_name, t.party_a_id as party_a_id, t.a_person as a_person,
  55. t.a_phone as a_phone, t.agent as agent, t.agent_person as agent_person, t.agent_phone as agent_phone, c.amount, c.deposit, c.contract_document,
  56. c.drafter, u.nick_name as draft_nick_name, c.draft_time, c.remark, c.sign_date, c.sign_remark, c.sign_scan, c.comment_type, c.manager_comment, c.manager_user_id, u1.nick_name as manager_nick_name,
  57. c.manager_time from cmc_contract as c
  58. left join sys_user as u on u.user_id = c.drafter
  59. left join sys_user as u1 on u1.user_id = c.manager_user_id
  60. left join cmc_tender as t on t.tender_id = c.tender_id
  61. left join cmc_party_a as pa on pa.party_a_id = c.party_a_id
  62. </sql>
  63. <select id="selectCmcContractList" parameterType="CmcContract" resultMap="CmcContractResult">
  64. <include refid="selectCmcContractVo"/>
  65. <where>
  66. <if test="contractId != null and contractId != ''"> and c.contract_id like concat('%', #{contractId}, '%')</if>
  67. <if test="contractName!= null and contractName != ''"> and c.contract_name like concat('%', #{contractName}, '%')</if>
  68. <if test="contractCode!= null and contractCode != ''"> and c.contract_code like concat('%', #{contractCode}, '%')</if>
  69. <if test="tenderId != null and tenderId != ''"> and c.tender_id = #{tenderId}</if>
  70. <if test="contractNumber != null and contractNumber != ''"> and c.contract_number = #{contractNumber}</if>
  71. <if test="amount != null "> and c.amount = #{amount}</if>
  72. <if test="deposit != null "> and c.deposit = #{deposit}</if>
  73. <if test="contractDocument != null and contractDocument != ''"> and c.contract_document = #{contractDocument}</if>
  74. <if test="drafter != null "> and c.drafter = #{drafter}</if>
  75. <if test="draftTime != null "> and c.draft_time = #{draftTime}</if>
  76. <if test="signDate != null "> and c.sign_date = #{signDate}</if>
  77. <if test="signRemark != null and signRemark != ''"> and c.sign_remark = #{signRemark}</if>
  78. <if test="signScan != null and signScan != ''"> and c.sign_scan = #{signScan}</if>
  79. <if test="commentType != null and commentType != ''"> and c.comment_type = #{commentType}</if>
  80. </where>
  81. order by c.draft_time desc
  82. </select>
  83. <select id="selectCmcContractByContractId" parameterType="String" resultMap="CmcContractResult">
  84. <include refid="selectCmcContractVo"/>
  85. where c.contract_id = #{contractId}
  86. </select>
  87. <insert id="insertCmcContract" parameterType="CmcContract">
  88. insert into cmc_contract
  89. <trim prefix="(" suffix=")" suffixOverrides=",">
  90. <if test="contractId != null">contract_id,</if>
  91. <if test="contractName != null">contract_name,</if>
  92. <if test="contractCode != null">contract_code,</if>
  93. <if test="tenderId != null">tender_id,</if>
  94. <if test="partyAId != null">party_a_id,</if>
  95. <if test="contractNumber != null">contract_number,</if>
  96. <if test="amount != null">amount,</if>
  97. <if test="deposit != null">deposit,</if>
  98. <if test="contractDocument != null">contract_document,</if>
  99. <if test="drafter != null">drafter,</if>
  100. <if test="draftTime != null">draft_time,</if>
  101. <if test="remark != null">remark,</if>
  102. <if test="signDate != null">sign_date,</if>
  103. <if test="signRemark != null">sign_remark,</if>
  104. <if test="signScan != null">sign_scan,</if>
  105. <if test="commentType != null">comment_type,</if>
  106. <if test="managerComment != null">manager_comment,</if>
  107. <if test="managerUserId != null">manager_user_id,</if>
  108. <if test="managerTime != null">manager_time,</if>
  109. </trim>
  110. <trim prefix="values (" suffix=")" suffixOverrides=",">
  111. <if test="contractId != null">#{contractId},</if>
  112. <if test="contractName != null">#{contractName},</if>
  113. <if test="contractCode != null">#{contractCode},</if>
  114. <if test="tenderId != null">#{tenderId},</if>
  115. <if test="partyAId != null">#{partyAId},</if>
  116. <if test="contractNumber != null">#{contractNumber},</if>
  117. <if test="amount != null">#{amount},</if>
  118. <if test="deposit != null">#{deposit},</if>
  119. <if test="contractDocument != null">#{contractDocument},</if>
  120. <if test="drafter != null">#{drafter},</if>
  121. <if test="draftTime != null">#{draftTime},</if>
  122. <if test="remark != null">#{remark},</if>
  123. <if test="signDate != null">#{signDate},</if>
  124. <if test="signRemark != null">#{signRemark},</if>
  125. <if test="signScan != null">#{signScan},</if>
  126. <if test="commentType != null">#{commentType},</if>
  127. <if test="managerComment != null">#{managerComment},</if>
  128. <if test="managerUserId != null">#{managerUserId},</if>
  129. <if test="managerTime != null">#{managerTime},</if>
  130. </trim>
  131. </insert>
  132. <update id="updateCmcContract" parameterType="CmcContract">
  133. update cmc_contract
  134. <trim prefix="SET" suffixOverrides=",">
  135. <if test="contractCode != null">contract_code = #{contractCode},</if>
  136. <if test="contractName != null">contract_name = #{contractName},</if>
  137. <if test="tenderId != null">tender_id = #{tenderId},</if>
  138. <if test="partyAId != null">party_a_id = #{partyAId},</if>
  139. <if test="contractNumber != null">contract_number = #{contractNumber},</if>
  140. <if test="amount != null">amount = #{amount},</if>
  141. <if test="deposit != null">deposit = #{deposit},</if>
  142. <if test="contractDocument != null">contract_document = #{contractDocument},</if>
  143. <if test="drafter != null">drafter = #{drafter},</if>
  144. <if test="draftTime != null">draft_time = #{draftTime},</if>
  145. <if test="remark != null">remark = #{remark},</if>
  146. <if test="signDate != null">sign_date = #{signDate},</if>
  147. <if test="signRemark != null">sign_remark = #{signRemark},</if>
  148. <if test="signScan != null">sign_scan = #{signScan},</if>
  149. <if test="commentType != null">comment_type = #{commentType},</if>
  150. <if test="managerComment != null">manager_comment = #{managerComment},</if>
  151. <if test="managerUserId != null">manager_user_id = #{managerUserId},</if>
  152. <if test="managerTime != null">manager_time = #{managerTime},</if>
  153. </trim>
  154. where contract_id = #{contractId}
  155. </update>
  156. <delete id="deleteCmcContractByContractId" parameterType="String">
  157. delete from cmc_contract where contract_id = #{contractId}
  158. </delete>
  159. <delete id="deleteCmcContractByContractIds" parameterType="String">
  160. delete from cmc_contract where contract_id in
  161. <foreach item="contractId" collection="array" open="(" separator="," close=")">
  162. #{contractId}
  163. </foreach>
  164. </delete>
  165. </mapper>