Lius
2025-03-18 423c836f9a0b15033b048c9d2666d3440fecdca0
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
50
51
<?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.MdcPartProcessInfoMapper">
 
    <select id="pageList" resultType="org.jeecg.modules.mdc.entity.MdcPartProcessInfo">
        SELECT
            *
        FROM
            mdc_part_process_info
        <where>
            <if test="mdcPartProcessInfo.equipmentId != null and mdcPartProcessInfo.equipmentId != ''">
                AND equipment_id = #{ mdcPartProcessInfo.equipmentId }
            </if>
            <if test="mdcPartProcessInfo.partId != null and mdcPartProcessInfo.partId != ''">
                AND part_id = #{ mdcPartProcessInfo.partId }
            </if>
            <if test="mdcPartProcessInfo.theDate != null and mdcPartProcessInfo.theDate != ''">
                AND the_date LIKE CONCAT('%',#{ mdcPartProcessInfo.theDate },'%')
            </if>
            <if test="mdcPartProcessInfo.startTime != null and mdcPartProcessInfo.startTime != ''">
                AND the_date &gt;= #{ mdcPartProcessInfo.startTime }
            </if>
            <if test="mdcPartProcessInfo.endTime != null and mdcPartProcessInfo.endTime != ''">
                AND the_date &lt;= #{mdcPartProcessInfo.endTime }
            </if>
            <if test="mdcPartProcessInfo.equipmentIdList != null and mdcPartProcessInfo.equipmentIdList.size() > 0 ">
                AND equipment_id IN
                <foreach collection="mdcPartProcessInfo.equipmentIdList" item="id" index="index" open="(" close=")" separator=",">
                    #{ id }
                </foreach>
            </if>
        </where>
        ORDER BY the_date DESC, equipment_id ASC
    </select>
 
    <!--查询设备某天总加工时间-->
    <select id="selectTotalProcessLong" resultType="java.lang.Integer">
        SELECT sum(total_process_long) FROM mdc_part_process_info WHERE equipment_id = #{equipmentId} AND the_date = #{validDate}
    </select>
 
    <!--查询设备某天总加工数量-->
    <select id="selectTotalProcessCount" resultType="java.lang.Integer">
        SELECT sum(process_count) FROM mdc_part_process_info WHERE equipment_id = #{equipmentId} AND the_date = #{validDate}
    </select>
 
    <!--查询设备某天总加工合格数量-->
    <select id="selectTotalPassCount" resultType="java.lang.Integer">
        SELECT sum(pass_count) FROM mdc_part_process_info WHERE equipment_id = #{equipmentId} AND the_date = #{validDate}
    </select>
 
</mapper>