<?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>
|