hyingbo
6 天以前 e935889261ef38c8eaef31e54cbfc466d63d2ef4
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
47
48
49
<?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="org.jeecg.modules.mdc.mapper.MdcPassRateMapper">
 
    <!--分页查询-->
    <select id="pageList" resultType="org.jeecg.modules.mdc.entity.MdcPassRate">
        SELECT * FROM mdc_pass_rate
        <where>
            <if test="mdcPassRate.equipmentName != null and mdcPassRate.equipmentName != '' ">
                AND equipment_name LIKE CONCAT(CONCAT('%',#{mdcPassRate.equipmentName}),'%')
            </if>
            <if test="mdcPassRate.equipmentId != null and mdcPassRate.equipmentId != '' ">
                AND equipment_id LIKE CONCAT(CONCAT('%',#{mdcPassRate.equipmentId}),'%')
            </if>
            <if test="mdcPassRate.startTime != null and mdcPassRate.endTime != null">
                AND efficient_date BETWEEN #{ mdcPassRate.startTime } AND #{ mdcPassRate.endTime }
            </if>
            <if test="mdcPassRate.mdcSectionIds != null and mdcPassRate.mdcSectionIds.size() > 0 ">
                AND equipment_id IN
                <foreach collection="mdcPassRate.mdcSectionIds" item="id" index="index" open="(" close=")" separator=",">
                    #{ id }
                </foreach>
            </if>
        </where>
        ORDER BY equipment_name ASC, efficient_date DESC
    </select>
 
    <!--计算加工数量-->
    <select id="findProcessQuantity" resultType="java.lang.Integer">
        SELECT
            SUM( process_quantity )
        FROM
            mdc_pass_rate
        WHERE
            equipment_id = #{ equipmentId }
            AND efficient_date BETWEEN #{ startTime } AND #{endTime}
    </select>
 
    <!--计算废品数量-->
    <select id="findUnqualifiedQuantity" resultType="java.lang.Integer">
        SELECT
            SUM( unqualified_quantity )
        FROM
            mdc_pass_rate
        WHERE
            equipment_id = #{ equipmentId }
            AND efficient_date BETWEEN #{ startTime } AND #{endTime}
    </select>
</mapper>