“djh”
2025-11-20 a14b9718755aeeb26b3035065a5e36c9dd1e1555
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?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">
 
    <select id="selectReviewList" resultType="com.gkhy.exam.system.domain.ContractReview">
        SELECT
            cr.`id`,
            cr.`company_id`,
            cr.`type`,
            cr.`contract_id`,
            cl.contract_name,
            cl.number,
            cl.sign_date,
            cr.`record_time`,
            cr.`registrant_id`,
            su1.`name` as registrant_name,
            cr.`customer_name`,
            cr.`customer_user`,
            cr.`costomer_phone`,
            cr.`delivery_time`,
            cr.`delivery_addr`,
            cr.`delivery_type`,
            cr.`pay_type`,
            cr.`product_mess`,
            cr.`risk_mess`,
            cr.`suggest`,
            cr.`legal_person`,
            su2.`name` as legal_name,
            cr.`legal_time`,
            cr.`del_flag`,
            cr.`create_by`,
            cr.`create_time`,
            cr.`update_by`,
            cr.`update_time`
        FROM
            `contract_review` cr
                LEFT JOIN sys_company sc ON cr.company_id = sc.id
                LEFT JOIN sys_user su1 ON cr.registrant_id = su1.id
                LEFT JOIN sys_user su2 ON cr.legal_person = su2.id
                LEFT JOIN contract_ledger cl ON cr.contract_id = cl.id
        WHERE
            cr.del_flag = 1
        <if test="companyId!=null">
            and cr.company_id =#{companyId}
        </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>
</mapper>