123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.ruoyi.oa.mapper.CmcContractMapper">
-
- <resultMap type="CmcContract" id="CmcContractResult">
- <result property="contractId" column="contract_id" />
- <result property="contractName" column="contract_name" />
- <result property="contractCode" column="contract_code" />
- <result property="contractNumber" column="contract_number" />
- <result property="tenderId" column="tender_id" />
- <result property="partyAId" column="party_a_id" />
- <result property="amount" column="amount" />
- <result property="deposit" column="deposit" />
- <result property="contractDocument" column="contract_document" />
- <result property="drafter" column="drafter" />
- <result property="draftTime" column="draft_time" />
- <result property="remark" column="remark" />
- <result property="signDate" column="sign_date" />
- <result property="signRemark" column="sign_remark" />
- <result property="signScan" column="sign_scan" />
- <result property="commentType" column="comment_type" />
- <result property="managerComment" column="manager_comment" />
- <result property="managerUserId" column="manager_user_id" />
- <result property="managerTime" column="manager_time" />
- <association property="draftUser" javaType="SysUser" resultMap="DraftUserResult" />
- <association property="managerUser" javaType="SysUser" resultMap="ManagerUserResult" />
- <association property="tender" javaType="CmcTender" resultMap="CmcTenderResult" />
- <association property="partyA" javaType="CmcPartyA" resultMap="CmcPartyAResult" />
- </resultMap>
-
- <resultMap type="CmcTender" id="CmcTenderResult">
- <result property="tenderId" column="tender_id" />
- <result property="projectName" column="project_name" />
- <result property="partyAId" column="party_a_id" />
- <result property="aPerson" column="a_person" />
- <result property="aPhone" column="a_phone" />
- <result property="agent" column="agent" />
- <result property="agentPerson" column="agent_person" />
- <result property="agentPhone" column="agent_phone" />
- </resultMap>
-
- <resultMap type="SysUser" id="DraftUserResult">
- <result property="userId" column="user_id" />
- <result property="nickName" column="draft_nick_name" />
- </resultMap>
-
- <resultMap type="SysUser" id="ManagerUserResult">
- <result property="userId" column="user_id" />
- <result property="nickName" column="manager_nick_name" />
- </resultMap>
-
- <resultMap type="CmcPartyA" id="CmcPartyAResult">
- <result property="partyAId" column="party_a_id" />
- <result property="partyAName" column="party_a_name" />
- </resultMap>
-
- <sql id="selectCmcContractVo">
- 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,
- 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,
- 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,
- c.manager_time from cmc_contract as c
- left join sys_user as u on u.user_id = c.drafter
- left join sys_user as u1 on u1.user_id = c.manager_user_id
- left join cmc_tender as t on t.tender_id = c.tender_id
- left join cmc_party_a as pa on pa.party_a_id = c.party_a_id
- </sql>
-
- <select id="selectCmcContractList" parameterType="CmcContract" resultMap="CmcContractResult">
- <include refid="selectCmcContractVo"/>
- <where>
- <if test="contractId != null and contractId != ''"> and c.contract_id like concat('%', #{contractId}, '%')</if>
- <if test="contractName!= null and contractName != ''"> and c.contract_name like concat('%', #{contractName}, '%')</if>
- <if test="contractCode!= null and contractCode != ''"> and c.contract_code like concat('%', #{contractCode}, '%')</if>
- <if test="tenderId != null and tenderId != ''"> and c.tender_id = #{tenderId}</if>
- <if test="contractNumber != null and contractNumber != ''"> and c.contract_number = #{contractNumber}</if>
- <if test="amount != null "> and c.amount = #{amount}</if>
- <if test="deposit != null "> and c.deposit = #{deposit}</if>
- <if test="contractDocument != null and contractDocument != ''"> and c.contract_document = #{contractDocument}</if>
- <if test="drafter != null "> and c.drafter = #{drafter}</if>
- <if test="draftTime != null "> and c.draft_time = #{draftTime}</if>
- <if test="signDate != null "> and c.sign_date = #{signDate}</if>
- <if test="signRemark != null and signRemark != ''"> and c.sign_remark = #{signRemark}</if>
- <if test="signScan != null and signScan != ''"> and c.sign_scan = #{signScan}</if>
- <if test="commentType != null and commentType != ''"> and c.comment_type = #{commentType}</if>
- </where>
- order by c.draft_time desc
- </select>
-
- <select id="selectCmcContractByContractId" parameterType="String" resultMap="CmcContractResult">
- <include refid="selectCmcContractVo"/>
- where c.contract_id = #{contractId}
- </select>
-
- <insert id="insertCmcContract" parameterType="CmcContract">
- insert into cmc_contract
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="contractId != null">contract_id,</if>
- <if test="contractName != null">contract_name,</if>
- <if test="contractCode != null">contract_code,</if>
- <if test="tenderId != null">tender_id,</if>
- <if test="partyAId != null">party_a_id,</if>
- <if test="contractNumber != null">contract_number,</if>
- <if test="amount != null">amount,</if>
- <if test="deposit != null">deposit,</if>
- <if test="contractDocument != null">contract_document,</if>
- <if test="drafter != null">drafter,</if>
- <if test="draftTime != null">draft_time,</if>
- <if test="remark != null">remark,</if>
- <if test="signDate != null">sign_date,</if>
- <if test="signRemark != null">sign_remark,</if>
- <if test="signScan != null">sign_scan,</if>
- <if test="commentType != null">comment_type,</if>
- <if test="managerComment != null">manager_comment,</if>
- <if test="managerUserId != null">manager_user_id,</if>
- <if test="managerTime != null">manager_time,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="contractId != null">#{contractId},</if>
- <if test="contractName != null">#{contractName},</if>
- <if test="contractCode != null">#{contractCode},</if>
- <if test="tenderId != null">#{tenderId},</if>
- <if test="partyAId != null">#{partyAId},</if>
- <if test="contractNumber != null">#{contractNumber},</if>
- <if test="amount != null">#{amount},</if>
- <if test="deposit != null">#{deposit},</if>
- <if test="contractDocument != null">#{contractDocument},</if>
- <if test="drafter != null">#{drafter},</if>
- <if test="draftTime != null">#{draftTime},</if>
- <if test="remark != null">#{remark},</if>
- <if test="signDate != null">#{signDate},</if>
- <if test="signRemark != null">#{signRemark},</if>
- <if test="signScan != null">#{signScan},</if>
- <if test="commentType != null">#{commentType},</if>
- <if test="managerComment != null">#{managerComment},</if>
- <if test="managerUserId != null">#{managerUserId},</if>
- <if test="managerTime != null">#{managerTime},</if>
- </trim>
- </insert>
-
- <update id="updateCmcContract" parameterType="CmcContract">
- update cmc_contract
- <trim prefix="SET" suffixOverrides=",">
- <if test="contractCode != null">contract_code = #{contractCode},</if>
- <if test="contractName != null">contract_name = #{contractName},</if>
- <if test="tenderId != null">tender_id = #{tenderId},</if>
- <if test="partyAId != null">party_a_id = #{partyAId},</if>
- <if test="contractNumber != null">contract_number = #{contractNumber},</if>
- <if test="amount != null">amount = #{amount},</if>
- <if test="deposit != null">deposit = #{deposit},</if>
- <if test="contractDocument != null">contract_document = #{contractDocument},</if>
- <if test="drafter != null">drafter = #{drafter},</if>
- <if test="draftTime != null">draft_time = #{draftTime},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="signDate != null">sign_date = #{signDate},</if>
- <if test="signRemark != null">sign_remark = #{signRemark},</if>
- <if test="signScan != null">sign_scan = #{signScan},</if>
- <if test="commentType != null">comment_type = #{commentType},</if>
- <if test="managerComment != null">manager_comment = #{managerComment},</if>
- <if test="managerUserId != null">manager_user_id = #{managerUserId},</if>
- <if test="managerTime != null">manager_time = #{managerTime},</if>
- </trim>
- where contract_id = #{contractId}
- </update>
-
- <delete id="deleteCmcContractByContractId" parameterType="String">
- delete from cmc_contract where contract_id = #{contractId}
- </delete>
-
- <delete id="deleteCmcContractByContractIds" parameterType="String">
- delete from cmc_contract where contract_id in
- <foreach item="contractId" collection="array" open="(" separator="," close=")">
- #{contractId}
- </foreach>
- </delete>
- </mapper>
|