“djh”
2025-12-22 ab0682fb16c1cd1d1f1b054184296bbaae158d2b
multi-system/src/main/resources/mapper/system/ContractReviewMapper.xml
@@ -1,6 +1,9 @@
<?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.gkhy.exam.system.mapper.ContractReviewMapper">
    <update id="updateByUserid">
        update contract_review set status = 1 ,suggest=#{suggest} where id = #{id} and legal_person = #{legalPerson}
    </update>
    <select id="selectReviewList" resultType="com.gkhy.exam.system.domain.ContractReview">
        SELECT
@@ -31,7 +34,10 @@
            cr.`create_by`,
            cr.`create_time`,
            cr.`update_by`,
            cr.`update_time`
            cr.`update_time`,
            cr.`file_name`,
            cr.`file_path`,
            cr.`status`
        FROM
            `contract_review` cr
                LEFT JOIN sys_company sc ON cr.company_id = sc.id
@@ -43,10 +49,50 @@
        <if test="companyId!=null">
            and cr.company_id =#{companyId}
        </if>
        <if test="status !=null">
            and cr.status = #{status}
        </if>
        <if test="type!=null">
            and cr.type = #{type}
        </if>
        ORDER BY
            cr.create_time DESC
    </select>
    <select id="selectByContractId" resultType="java.lang.Integer">
        select count(*) from contract_review where contract_id =#{contractId} and type = 1
    </select>
    <select id="selectByUserId" resultType="com.gkhy.exam.system.domain.vo.ContractReviewVo">
        SELECT
            cr.`id`,
            cr.`type`,
            cl.`contract_name`,
            cr.`file_name`,
            cr.`file_path`
        FROM
            `contract_review` cr
                LEFT JOIN contract_ledger cl ON cr.contract_id = cl.id
                LEFT JOIN contract_review_mess crm ON cr.id = crm.review_id
        WHERE
            cr.`status` = 0
          AND cr.del_flag = 1
          AND (
                    crm.review_user = #{userId}
                AND crm.`status` = 0)
    </select>
    <select id="selectByUserIdMain" resultType="com.gkhy.exam.system.domain.vo.ContractReviewVo">
        SELECT
            cr.`id`,
            cr.`type`,
            cl.`contract_name`,
            cr.`file_name`,
            cr.`file_path`
        FROM
            `contract_review` cr
                LEFT JOIN contract_ledger cl ON cr.contract_id = cl.id
                LEFT JOIN contract_review_mess crm ON cr.id = crm.review_id
        WHERE
            cr.`status` = 0
          AND cr.del_flag = 1
          and cr.legal_person = #{userId}
    </select>
</mapper>