<?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 >= DATE_FORMAT(#{salesLedgerDto.entryDateStart},'%Y-%m-%d')
|
</if>
|
<if test="salesLedgerDto.entryDateEnd != null and salesLedgerDto.entryDateEnd != '' ">
|
AND t4.scheduling_date <= DATE_FORMAT(#{salesLedgerDto.entryDateEnd},'%Y-%m-%d')
|
</if>
|
</where>
|
group by t4.id
|
order by t4.update_time desc
|
</select>
|
</mapper>
|