183 lines
		
	
	
		
			8.6 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
			
		
		
	
	
			183 lines
		
	
	
		
			8.6 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
<?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" />
 | 
						|
            <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" />
 | 
						|
    </resultMap>
 | 
						|
    
 | 
						|
    <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>
 | 
						|
 | 
						|
    <select id="list" resultType="com.cnbm.packing.dto.WoPackagingBoxSubstrateDTO">
 | 
						|
        select * from t_wo_packaging_box_substrate
 | 
						|
        <where>
 | 
						|
            valid = 1
 | 
						|
            <if test="packagingBoxId != null">
 | 
						|
                and PACKAGING_BOX_ID = #{packagingBoxId}
 | 
						|
            </if>
 | 
						|
        </where>
 | 
						|
        order by slot asc
 | 
						|
    </select>
 | 
						|
    <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>
 | 
						|
 | 
						|
    <resultMap id="ResultMap" type="com.cnbm.packing.vo.SubIdPageVo">
 | 
						|
        <result column="CREATE_TIME" property="createTime" />
 | 
						|
        <result column="SUB_ID" property="subId" />
 | 
						|
        <result column="BOX_NO" property="boxNo" />
 | 
						|
    </resultMap>
 | 
						|
    <update id="updatePackagingBoxIdAndSlotByWoSubstrateId">
 | 
						|
        update t_wo_packaging_box_substrate
 | 
						|
        set PACKAGING_BOX_ID = #{packagingBoxId,jdbcType=VARCHAR},
 | 
						|
            SLOT             = #{slot,jdbcType=NUMERIC}
 | 
						|
        where WO_SUBSTRATE_ID = #{woSubstrateId,jdbcType=VARCHAR}
 | 
						|
    </update>
 | 
						|
 | 
						|
    <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>
 | 
						|
 | 
						|
    <select id="substrateList" resultType="com.cnbm.packing.dto.WoPackagingBoxSubstrateDTO">
 | 
						|
        select
 | 
						|
        twpb.CREATE_TIME as boxCreateTime,twpbs.*,twpb.PRINT_TIME as printTime,
 | 
						|
        twpb.product_grade as productGrade, twpb.pitch_number as pitchNumber, twpb.max_fuse_current as maxFuseCurrent, twpb.cover_name as coverName
 | 
						|
        from t_wo_packaging_box_substrate twpbs
 | 
						|
        left join t_wo_packaging_box twpb on twpbs.PACKAGING_BOX_ID = twpb.BOX_NO
 | 
						|
        <where>
 | 
						|
            twpb.model = #{model}
 | 
						|
            <if test="woSubstrateId != null and woSubstrateId != ''">
 | 
						|
                and twpbs.WO_SUBSTRATE_ID like CONCAT(CONCAT('%',#{woSubstrateId}),'%')
 | 
						|
            </if>
 | 
						|
            <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>
 | 
						|
            AND twpbs.valid = 1
 | 
						|
        </where>
 | 
						|
        order by twpb.CREATE_TIME desc, twpbs.PACKAGING_BOX_ID asc, twpbs.SLOT asc
 | 
						|
    </select>
 | 
						|
 | 
						|
    <select id="substratePage" resultType="com.cnbm.packing.dto.WoPackagingBoxSubstrateDTO">
 | 
						|
        select
 | 
						|
        twpb.CREATE_TIME as boxCreateTime,twpbs.*,twpb.PRINT_TIME as printTime,
 | 
						|
        twpb.product_grade as productGrade, twpb.pitch_number as pitchNumber, twpb.max_fuse_current as maxFuseCurrent, twpb.cover_name as coverName
 | 
						|
        from t_wo_packaging_box_substrate twpbs
 | 
						|
        left join t_wo_packaging_box twpb on twpbs.PACKAGING_BOX_ID = twpb.BOX_NO
 | 
						|
        <where>
 | 
						|
            twpb.model = #{param.model}
 | 
						|
            <if test="param.woSubstrateId != null and param.woSubstrateId != ''">
 | 
						|
                and twpbs.WO_SUBSTRATE_ID like CONCAT(CONCAT('%',#{param.woSubstrateId}),'%')
 | 
						|
            </if>
 | 
						|
            <if test="param.packagingBoxId != null and param.packagingBoxId != ''">
 | 
						|
                and twpbs.PACKAGING_BOX_ID like CONCAT(CONCAT('%',#{param.packagingBoxId}),'%')
 | 
						|
            </if>
 | 
						|
            <if test="param.startTime != null and param.endTime != null">
 | 
						|
                and twpb.CREATE_TIME between #{param.startTime} AND #{param.endTime}
 | 
						|
            </if>
 | 
						|
            AND twpbs.valid = 1
 | 
						|
        </where>
 | 
						|
        order by twpb.CREATE_TIME desc, twpbs.PACKAGING_BOX_ID asc, twpbs.SLOT asc
 | 
						|
    </select>
 | 
						|
 | 
						|
    <select id="subIdPage" resultMap="ResultMap">
 | 
						|
        SELECT
 | 
						|
            twpb.BOX_NO ,twpbs.WO_SUBSTRATE_ID as SUB_ID ,twpb.CREATE_TIME
 | 
						|
        FROM T_WO_PACKAGING_BOX_SUBSTRATE twpbs
 | 
						|
                 LEFT JOIN T_WO_PACKAGING_BOX twpb ON twpbs.PACKAGING_BOX_ID = twpb.BOX_NO
 | 
						|
        <where>
 | 
						|
            <if test="param.boxNo != null">
 | 
						|
                twpb.BOX_NO = #{param.boxNo}
 | 
						|
            </if>
 | 
						|
        </where>
 | 
						|
    </select>
 | 
						|
 | 
						|
 | 
						|
</mapper>
 |