maven
4 天以前 47200ddd17698ae4afefd0d25c6b1b9551bcf14f
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
<?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 sales_ledger_product t3 on t4.sales_ledger_product_id = t3.id and t3.type = 3
        <where>
            <if test="salesLedgerDto.schedulingUserName != null and salesLedgerDto.schedulingUserName != '' ">
                AND t4.scheduling_user_name LIKE CONCAT('%',#{salesLedgerDto.schedulingUserName},'%')
            </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.scheduling_date desc
    </select>
</mapper>