cigs4/ym-packing/src/main/resources/mapper/WoPackagingBoxSubstrateMapper.xml

144 lines
6.5 KiB
XML
Raw Normal View History

2023-02-22 15:59:13 +08:00
<?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.cnbm.packing.mapper.WoPackagingBoxSubstrateMapper">
<resultMap type="com.cnbm.packing.entity.WoPackagingBoxSubstrate" id="WoPackagingBoxSubstrateMap">
<id column="ID" property="id" />
<id column="PACKAGING_BOX_ID" property="packagingBoxId" />
<id column="WO_SUBSTRATE_ID" property="woSubstrateId" />
<id column="CREATOR_ID" property="creatorId" />
<id column="CREATOR_NAME" property="creatorName" />
<id column="CREATE_TIME" property="createTime" />
<id column="UPDATER_ID" property="updaterId" />
<id column="UPDATER_NAME" property="updaterName" />
<id column="UPDATE_TIME" property="updateTime" />
<id column="VERSION" property="version" />
<id column="SLOT" property="slot" />
<id column="INPUT_TIME" property="inputTime" />
<id column="VALID" property="valid" />
<id column="SAP_MATERIAL" property="sapMaterial" />
<id column="LINE_BODY" property="lineBody" />
<id column="POWER_LEVEL" property="powerLevel" />
2023-02-23 14:24:29 +08:00
<id column="LAST_UPDATE_TIME" property="lastUpdateTime" />
<id column="PMPP" property="pmpp" />
<id column="ORDER_NAME" property="orderName" />
<id column="BINCLASS_FL1" property="binclassFl1" />
<id column="BINCLASS_FL2" property="binclassFl2" />
<id column="ETA_FL1" property="etaFl1" />
<id column="ETA_FL2" property="etaFl2" />
<id column="FF_FL1" property="ffFl1" />
<id column="FF_FL2" property="ffFl2" />
<id column="IMPP_FL1" property="imppFl1" />
<id column="IMPP_FL2" property="imppFl2" />
<id column="InsolFlashControl_FL1" property="insolflashcontrolFl1" />
<id column="InsolFlashControl_FL2" property="insolflashcontrolFl2" />
<id column="InsolMPP_FL1" property="insolmppFl1" />
<id column="InsolMPP_FL2" property="insolmppFl2" />
<id column="InsolVoc_FL1" property="insolvocFl1" />
<id column="InsolVoc_FL2" property="insolvocFl2" />
<id column="Insol_FL1" property="insolFl1" />
<id column="Insol_FL2" property="insolFl2" />
<id column="ISC_FL1" property="iscFl1" />
<id column="ISC_FL2" property="iscFl2" />
<id column="MEAS_TIME_FL1" property="measTimeFl1" />
<id column="MEAS_TIME_FL2" property="measTimeFl2" />
<id column="PMPP_FL1" property="pmppFl1" />
<id column="PMPP_FL2" property="pmppFl2" />
<id column="Tcell_FL1" property="tcellFl1" />
<id column="Tcell_FL2" property="tcellFl2" />
<id column="Tmonicell_FL1" property="tmonicellFl1" />
<id column="Tmonicell_FL2" property="tmonicellFl2" />
<id column="UMPP_FL1" property="umppFl1" />
<id column="UMPP_FL2" property="umppFl2" />
<id column="UOC_FL1" property="uocFl1" />
<id column="UOC_FL2" property="uocFl2" />
2023-02-22 15:59:13 +08:00
</resultMap>
2023-03-06 11:24:16 +08:00
<resultMap id="ResultMapPowerRe" type="com.cnbm.packing.dto.PowerReportDTO">
<result column="sub_num" property="subNum" />
<result column="sub_level" property="subLevel" />
<result column="sum_pmpp" property="sumPMPP" />
</resultMap>
2023-02-22 15:59:13 +08:00
<select id="list" resultType="com.cnbm.packing.dto.WoPackagingBoxSubstrateDTO">
select * from t_wo_packaging_box_substrate
2023-02-23 18:51:03 +08:00
<where>
valid = 1
<if test="packagingBoxId != null">
and PACKAGING_BOX_ID = #{packagingBoxId}
</if>
</where>
order by slot asc
2023-02-22 15:59:13 +08:00
</select>
2023-02-23 14:28:05 +08:00
<select id="getOneByWoSubstrateId" resultMap="WoPackagingBoxSubstrateMap">
select
*
from t_wo_packaging_box_substrate
where
valid = 1 and
WO_SUBSTRATE_ID = #{woSubstrateId,jdbcType=VARCHAR}
limit 1
</select>
2023-03-03 14:33:18 +08:00
<update id="updatePackagingBoxIdAndSlotByWoSubstrateId">
2023-02-23 14:28:05 +08:00
update t_wo_packaging_box_substrate
2023-03-03 14:33:18 +08:00
set PACKAGING_BOX_ID = #{packagingBoxId,jdbcType=VARCHAR},
SLOT = #{slot,jdbcType=NUMERIC}
2023-02-23 14:28:05 +08:00
where WO_SUBSTRATE_ID = #{woSubstrateId,jdbcType=VARCHAR}
</update>
2023-02-22 15:59:13 +08:00
2023-03-06 11:24:16 +08:00
<select id="powerReport" resultMap="ResultMapPowerRe">
select
COUNT(twpbs.WO_SUBSTRATE_ID) as sub_num,twpbs.POWER_LEVEL as sub_level,sum(twpbs.PMPP) as sum_pmpp
from t_wo_packaging_box_substrate twpbs
left join t_wo_packaging_box twpb on twpbs.PACKAGING_BOX_ID = twpb.BOX_NO
<where>
twpbs.PACKAGING_BOX_ID != '0'
<if test="queryParam.begin != null and queryParam.end != null">
and twpb.CREATE_TIME between #{queryParam.begin} AND #{queryParam.end}
</if>
<if test="queryParam.orderName != null">
and twpbs.ORDER_NAME = #{queryParam.orderName}
</if>
<if test="queryParam.model != null">
and twpb.model = #{queryParam.model}
</if>
</where>
group by twpbs.POWER_LEVEL
</select>
<select id="orderNameList" resultType="string">
select
twpbs.ORDER_NAME as orderName
from t_wo_packaging_box_substrate twpbs
where
twpbs.PACKAGING_BOX_ID != '0'
and twpbs.ORDER_NAME != ''
group by twpbs.ORDER_NAME
</select>
2023-03-07 10:27:24 +08:00
<select id="substrateList" resultType="com.cnbm.packing.dto.WoPackagingBoxSubstrateDTO">
select
twpb.CREATE_TIME as boxCreateTime,twpbs.*,twpb.PRINT_TIME as printTime
from t_wo_packaging_box_substrate twpbs
left join t_wo_packaging_box twpb on twpbs.PACKAGING_BOX_ID = twpb.BOX_NO
<where>
2023-03-16 09:55:43 +08:00
twpb.model = #{model}
2023-03-07 10:27:24 +08:00
<if test="woSubstrateId != null and woSubstrateId != ''">
and twpbs.WO_SUBSTRATE_ID like CONCAT(CONCAT('%',#{woSubstrateId}),'%')
</if>
2023-03-16 09:55:43 +08:00
<if test="packagingBoxId != null and packagingBoxId != ''">
and twpbs.PACKAGING_BOX_ID like CONCAT(CONCAT('%',#{packagingBoxId}),'%')
</if>
<if test="startTime != null and endTime != null">
and twpb.CREATE_TIME between #{startTime} AND #{endTime}
</if>
2023-03-07 10:27:24 +08:00
AND twpbs.valid = 1
</where>
order by twpb.CREATE_TIME desc
</select>
2023-02-22 15:59:13 +08:00
</mapper>