heheng
2025-11-26 5011ebf747ddfa41840b352c9e39cf369a8f047c
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
<?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.ContractLedgerMapper">
 
    <select id="selectLedgerList" resultType="com.gkhy.exam.system.domain.ContractLedger">
        SELECT
            cl.`id`,
            cl.`company_id`,
            sc.`name` AS company_name,
            cl.`number`,
            cl.`contract_name`,
            cl.`sign_date`,
            cl.`del_flag`,
            cl.`create_by`,
            cl.`create_time`,
            cl.`update_by`,
            cl.`update_time`,
            cl.`deliver`
        FROM
            `contract_ledger` cl
                LEFT JOIN sys_company sc ON cl.company_id = sc.id
        WHERE
            cl.del_flag = 1
            <if test="companyId!=null">
                and cl.company_id = #{companyId}
            </if>
        ORDER BY
            cl.create_time DESC
    </select>
</mapper>