maven
2025-12-01 c54f243c9a13ce53e7dc3f7823f585466eab0bd1
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
<?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.SalesLedgerProductionAccountingMapper">
 
    <select id="listPage" resultType="com.ruoyi.production.dto.SalesLedgerProductionAccountingDto">
        SELECT
        t4.id,
        t4.finished_num * t4.work_hours as wages,
        t4.scheduling_user_id,
        t4.scheduling_user_name,
        t4.scheduling_date,
        t4.finished_num,
        t4.work_hours,
        t4.process,
        t3.product_category,
        t3.specification_model,
        t3.unit
        FROM
        sales_ledger_production_accounting t4
        LEFT JOIN production_order t3 on t3.id = t4.sales_ledger_product_id
        <where>
            <if test="salesLedgerDto.schedulingUserName != null and salesLedgerDto.schedulingUserName != '' ">
                AND  t4.scheduling_user_name LIKE CONCAT('%',#{salesLedgerDto.schedulingUserName},'%')
            </if>
            <if test="salesLedgerDto.productCategory != null and salesLedgerDto.productCategory != '' ">
                AND  t3.product_category 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>
        group by t4.id
        order by t4.update_time desc
    </select>
</mapper>