maven
2025-11-26 da8d45df31aebdf0eda2c57155d1a915e2e1e89f
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
<?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.production.mapper.SalesLedgerWorkMapper">
 
    <select id="listPage" resultType="com.ruoyi.production.dto.SalesLedgerWorkDto">
        SELECT
        t4.id,
        t4.status,
        t4.scheduling_user_id,
        t4.scheduling_user_name,
        t4.scheduling_date,
        t4.scheduling_num,
        t4.finished_num,
        t4.work_hours,
        t4.process,
        t4.type,
        t4.receive,
        t4.loss,
        t4.remark,
        t3.product_category,
        t3.specification_model,
        t3.unit,
        t3.order_no
        FROM
        sales_ledger_work t4
        LEFT JOIN production_order t3 on t3.id = t4.sales_ledger_product_id
        <where>
            <if test="salesLedgerDto.status != null and salesLedgerDto.status != '' ">
                AND  t4.status = #{salesLedgerDto.status}
            </if>
            <if test="salesLedgerDto.orderNo != null and salesLedgerDto.orderNo != '' ">
                AND  t3.order_no LIKE CONCAT('%',#{salesLedgerDto.orderNo},'%')
            </if>
            <if test="salesLedgerDto.productCategory != null and salesLedgerDto.productCategory !='' ">
                AND  t3.productCategory LIKE CONCAT('%',#{salesLedgerDto.productCategory},'%')
            </if>
            <if test="salesLedgerDto.entryDateStart != null and salesLedgerDto.entryDateStart != '' ">
                AND t4.scheduling_date &gt;= DATE_FORMAT(#{salesLedgerDto.entryDateStart},'%Y-%m-%d')
            </if>
            <if test="salesLedgerDto.entryDateEnd != null and salesLedgerDto.entryDateEnd != '' ">
                AND  t4.scheduling_date &lt;= DATE_FORMAT(#{salesLedgerDto.entryDateEnd},'%Y-%m-%d')
            </if>
        </where>
        order by t4.update_time desc
    </select>
</mapper>