123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640 |
- <?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.steerinfo.dil.mapper.WmspRestackScanResultMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.WmspRestackScanResult">
- <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
- <result column="RESULT_RESTACK_ID" jdbcType="DECIMAL" property="resultRestackId" />
- <result column="LOADER_ID" jdbcType="DECIMAL" property="loaderId" />
- <result column="RESULT_SCAN_TAG" jdbcType="VARCHAR" property="resultScanTag" />
- <result column="RESULT_LOADER_AUDIT" jdbcType="DECIMAL" property="resultLoaderAudit" />
- <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
- <result column="MATERIAL_ONLY_CODE" jdbcType="VARCHAR" property="materialOnlyCode" />
-
- <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
- <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
- <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
- <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
- <result column="ISSUE_TIME" jdbcType="TIMESTAMP" property="issueTime" />
- </resultMap>
- <sql id="columns">
- RESULT_ID, RESULT_RESTACK_ID, LOADER_ID, RESULT_SCAN_TAG, RESULT_LOADER_AUDIT, INSERT_USERNAME, MATERIAL_ONLY_CODE,
- INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, ISSUE_TIME
- </sql>
- <sql id="columns_alias">
- t.RESULT_ID, t.RESULT_RESTACK_ID, t.LOADER_ID, t.RESULT_SCAN_TAG, t.RESULT_LOADER_AUDIT,
- t.INSERT_USERNAME,t.MATERIAL_ONLY_CODE, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK,
- t.ISSUE_TIME
- </sql>
- <sql id="select">
- SELECT <include refid="columns"/> FROM WMSP_RESTACK_SCAN_RESULT
- </sql>
- <sql id="select_alias">
- SELECT <include refid="columns_alias"/> FROM WMSP_RESTACK_SCAN_RESULT t
- </sql>
- <sql id="where">
- <where>
- <if test="resultId != null">
- and RESULT_ID = #{resultId}
- </if>
- <if test="resultRestackId != null">
- and RESULT_RESTACK_ID = #{resultRestackId}
- </if>
- <if test="loaderId != null">
- and LOADER_ID = #{loaderId}
- </if>
- <if test="resultScanTag != null and resultScanTag != ''">
- and RESULT_SCAN_TAG = #{resultScanTag}
- </if>
- <if test="resultLoaderAudit != null">
- and RESULT_LOADER_AUDIT = #{resultLoaderAudit}
- </if>
- <if test="insertUsername != null and insertUsername != ''">
- and INSERT_USERNAME = #{insertUsername}
- </if>
- <if test="materialOnlyCode != null and materialOnlyCode != ''">
- and MATERIAL_ONLY_CODE = #{materialOnlyCode}
- </if>
- <if test="insertTime != null">
- and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
- </if>
- <if test="updateUsername != null and updateUsername != ''">
- and UPDATE_USERNAME = #{updateUsername}
- </if>
- <if test="updateTime != null">
- and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
- </if>
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
- and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
- </if>
- <if test="issueTime != null">
- and TO_CHAR(ISSUE_TIME,'yyyy-MM-dd') = #{issueTime}
- </if>
- </where>
- </sql>
- <sql id="whereLike">
- <where>
- <if test="resultId != null">
- and RESULT_ID = #{resultId}
- </if>
- <if test="resultRestackId != null">
- and RESULT_RESTACK_ID = #{resultRestackId}
- </if>
- <if test="loaderId != null">
- and LOADER_ID = #{loaderId}
- </if>
- <if test="resultScanTag != null and resultScanTag != ''">
- and RESULT_SCAN_TAG LIKE '%${resultScanTag}%'
- </if>
- <if test="resultLoaderAudit != null">
- and RESULT_LOADER_AUDIT = #{resultLoaderAudit}
- </if>
- <if test="insertUsername != null and insertUsername != ''">
- and INSERT_USERNAME LIKE '%${insertUsername}%'
- </if>
- <if test="materialOnlyCode != null and materialOnlyCode != ''">
- and MATERIAL_ONLY_CODE LIKE '%${materialOnlyCode}%'
- </if>
- <if test="insertTime != null">
- and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
- </if>
- <if test="updateUsername != null and updateUsername != ''">
- and UPDATE_USERNAME LIKE '%${updateUsername}%'
- </if>
- <if test="updateTime != null">
- and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
- </if>
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
- and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
- </if>
- <if test="issueTime != null">
- and TO_CHAR(ISSUE_TIME,'yyyy-MM-dd') = #{issueTime}
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
- delete from WMSP_RESTACK_SCAN_RESULT
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from WMSP_RESTACK_SCAN_RESULT
- where 1!=1
- <if test="resultRestackId != null">
- or RESULT_RESTACK_ID = #{resultRestackId}
- </if>
- <if test="loaderId != null">
- or LOADER_ID = #{loaderId}
- </if>
- <if test="resultScanTag != null and resultScanTag != ''">
- or RESULT_SCAN_TAG = #{resultScanTag}
- </if>
- <if test="resultLoaderAudit != null">
- or RESULT_LOADER_AUDIT = #{resultLoaderAudit}
- </if>
- <if test="insertUsername != null and insertUsername != ''">
- or INSERT_USERNAME = #{insertUsername}
- </if>
- <if test="materialOnlyCode != null and materialOnlyCode != ''">
- or MATERIAL_ONLY_CODE = #{materialOnlyCode}
- </if>
- <if test="insertTime != null">
- or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
- </if>
- <if test="updateUsername != null and updateUsername != ''">
- or UPDATE_USERNAME = #{updateUsername}
- </if>
- <if test="updateTime != null">
- or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
- </if>
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
- or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
- </if>
- <if test="issueTime != null">
- or TO_CHAR(ISSUE_TIME,'yyyy-MM-dd') = '#{issueTime}'
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.dil.model.WmspRestackScanResult">
- insert into WMSP_RESTACK_SCAN_RESULT (RESULT_ID, RESULT_RESTACK_ID, LOADER_ID,
- RESULT_SCAN_TAG, RESULT_LOADER_AUDIT, INSERT_USERNAME,MATERIAL_ONLY_CODE,
- INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
- INSERT_UPDATE_REMARK, ISSUE_TIME)
- values (#{resultId,jdbcType=DECIMAL}, #{resultRestackId,jdbcType=DECIMAL}, #{loaderId,jdbcType=DECIMAL},
- #{resultScanTag,jdbcType=VARCHAR}, #{resultLoaderAudit,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{materialOnlyCode,jdbcType=VARCHAR},
- #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
- #{insertUpdateRemark,jdbcType=VARCHAR}, #{issueTime,jdbcType=TIMESTAMP})
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.dil.model.WmspRestackScanResult">
- insert into WMSP_RESTACK_SCAN_RESULT
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="resultId != null">
- RESULT_ID,
- </if>
- <if test="resultRestackId != null">
- RESULT_RESTACK_ID,
- </if>
- <if test="loaderId != null">
- LOADER_ID,
- </if>
- <if test="resultScanTag != null">
- RESULT_SCAN_TAG,
- </if>
- <if test="resultLoaderAudit != null">
- RESULT_LOADER_AUDIT,
- </if>
- <if test="insertUsername != null">
- INSERT_USERNAME,
- </if>
- <if test="materialOnlyCode != null">
- MATERIAL_ONLY_CODE,
- </if>
- <if test="insertTime != null">
- INSERT_TIME,
- </if>
- <if test="updateUsername != null">
- UPDATE_USERNAME,
- </if>
- <if test="updateTime != null">
- UPDATE_TIME,
- </if>
- <if test="insertUpdateRemark != null">
- INSERT_UPDATE_REMARK,
- </if>
- <if test="issueTime != null">
- ISSUE_TIME,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="resultId != null">
- #{resultId,jdbcType=DECIMAL},
- </if>
- <if test="resultRestackId != null">
- #{resultRestackId,jdbcType=DECIMAL},
- </if>
- <if test="loaderId != null">
- #{loaderId,jdbcType=DECIMAL},
- </if>
- <if test="resultScanTag != null">
- #{resultScanTag,jdbcType=VARCHAR},
- </if>
- <if test="resultLoaderAudit != null">
- #{resultLoaderAudit,jdbcType=DECIMAL},
- </if>
- <if test="insertUsername != null">
- #{insertUsername,jdbcType=VARCHAR},
- </if>
- <if test="materialOnlyCode != null">
- #{materialOnlyCode,jdbcType=VARCHAR},
- </if>
- <if test="insertTime != null">
- #{insertTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateUsername != null">
- #{updateUsername,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null">
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="insertUpdateRemark != null">
- #{insertUpdateRemark,jdbcType=VARCHAR},
- </if>
- <if test="issueTime != null">
- #{issueTime,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.WmspRestackScanResult">
- update WMSP_RESTACK_SCAN_RESULT
- set RESULT_RESTACK_ID = #{resultRestackId,jdbcType=DECIMAL},
- LOADER_ID = #{loaderId,jdbcType=DECIMAL},
- RESULT_SCAN_TAG = #{resultScanTag,jdbcType=VARCHAR},
- RESULT_LOADER_AUDIT = #{resultLoaderAudit,jdbcType=DECIMAL},
- INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
- MATERIAL_ONLY_CODE = #{materialOnlyCode,jdbcType=VARCHAR},
- INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
- UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
- UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
- INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
- ISSUE_TIME = #{issueTime,jdbcType=TIMESTAMP}
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.WmspRestackScanResult">
- update WMSP_RESTACK_SCAN_RESULT
- <set>
- <if test="resultRestackId != null">
- RESULT_RESTACK_ID = #{resultRestackId,jdbcType=DECIMAL},
- </if>
- <if test="loaderId != null">
- LOADER_ID = #{loaderId,jdbcType=DECIMAL},
- </if>
- <if test="resultScanTag != null">
- RESULT_SCAN_TAG = #{resultScanTag,jdbcType=VARCHAR},
- </if>
- <if test="resultLoaderAudit != null">
- RESULT_LOADER_AUDIT = #{resultLoaderAudit,jdbcType=DECIMAL},
- </if>
- <if test="insertUsername != null">
- INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
- </if>
- <if test="materialOnlyCode != null">
- MATERIAL_ONLY_CODE = #{materialOnlyCode,jdbcType=VARCHAR},
- </if>
- <if test="insertTime != null">
- INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateUsername != null">
- UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null">
- UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="insertUpdateRemark != null">
- INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
- </if>
- <if test="issueTime != null">
- ISSUE_TIME = #{issueTime,jdbcType=TIMESTAMP},
- </if>
- </set>
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </update>
- <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
- <include refid="select"/>
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </select>
- <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- <include refid="select"/>
- <include refid="where"/>
- </select>
- <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- <include refid="select"/>
- <include refid="whereLike"/>
- </select>
- <insert id="batchInsert" parameterType="java.util.List">
- insert into WMSP_RESTACK_SCAN_RESULT
- (RESULT_ID,
- RESULT_RESTACK_ID, LOADER_ID, RESULT_SCAN_TAG,
- RESULT_LOADER_AUDIT, INSERT_USERNAME,MATERIAL_ONLY_CODE,
- INSERT_TIME, UPDATE_USERNAME,
- UPDATE_TIME, INSERT_UPDATE_REMARK,
- ISSUE_TIME)
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.resultId,jdbcType=DECIMAL},
- #{item.resultRestackId,jdbcType=DECIMAL}, #{item.loaderId,jdbcType=DECIMAL}, #{item.resultScanTag,jdbcType=VARCHAR},
- #{item.resultLoaderAudit,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR},#{item.materialOnlyCode,jdbcType=VARCHAR},
- #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
- #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
- #{item.issueTime,jdbcType=TIMESTAMP} from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update WMSP_RESTACK_SCAN_RESULT
- set
- RESULT_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_RESTACK_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultRestackId,jdbcType=DECIMAL}
- </foreach>
- ,LOADER_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.loaderId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_SCAN_TAG=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultScanTag,jdbcType=VARCHAR}
- </foreach>
- ,RESULT_LOADER_AUDIT=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultLoaderAudit,jdbcType=DECIMAL}
- </foreach>
- ,INSERT_USERNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
- </foreach>
- ,MATERIAL_ONLY_CODE=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.materialOnlyCode,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
- </foreach>
- ,UPDATE_USERNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
- </foreach>
- ,UPDATE_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
- </foreach>
- ,INSERT_UPDATE_REMARK=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
- </foreach>
- ,ISSUE_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.issueTime,jdbcType=TIMESTAMP}
- </foreach>
- where RESULT_ID in
- <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
- #{item.resultId,jdbcType=DECIMAL}
- </foreach>
- </update>
- <delete id="batchDelete" parameterType="java.util.List">
- delete from WMSP_RESTACK_SCAN_RESULT
- where RESULT_ID in
- <foreach collection="list" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- <!--根据装卸工id查找数据 -->
- <select id="selectByLoaderId" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
- select *
- from (
- select
- t4.RESULT_STACK_NUMBER "stackNumber",
- t1.INSERT_TIME "insertTime",
- t3.PERSONNEL_NAME "personnelName",
- t9.MATERIAL_FURNACE_NUMBER "materialFunaceNumber",
- t8.MATERIAL_CODE "materialCode",
- t8.MATERIAL_NAME "materialName",
- t8.MATERIAL_SPECIFICATION "materialSpecifition",
- t9.MATERIAL_PRODUCTION_DATE "materialProductionDate",
- t9.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
- t7.MAKE_MATERIAL_NUMBER "makematerialNumber"
- from WMSP_RESTACK_SCAN_RESULT t1
- left join RMS_PERSONNEL t3
- on t3.PERSONNEL_ID=t1.LOADER_ID
- left join WMSP_RESTACK_MAKE_RESULT t4
- on t4.RESULT_ID=t1.RESULT_ID
- left join RMS_WAREHOUSE t6
- on t6.WAREHOUSE_ID=t4.AFTER_WAREHOUSE_ID
- left join WMSP_RESTACK_MAKE_MATERIAL t7
- on t4.RESULT_ID = t7.MAKE_RESULT_ID
- left join RMS_MATERIAL_STEEL t9
- on t9.MATERIAL_STEEL_ID=t7.MATERIAL_ID
- left join RMS_MATERIAL t8
- on t8.MATERIAL_ID=t9.MATERIAL_ID
- where t1.RESULT_SCAN_TAG='null'
- and t1.LOADER_ID=#{loaderId}
- )
- <if test="stackNumber != null">
- and
- <foreach collection="stackNumber" item="item" open="(" separator="or" close=")">
- "stackNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="insertTime != null">
- and
- <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
- "insertTime" like '%${item}%'
- </foreach>
- </if>
- <if test="personnelName != null">
- and
- <foreach collection="personnelName" item="item" open="(" separator="or" close=")">
- "personnelName" like '%${item}%'
- </foreach>
- </if>
- <if test="materialFunaceNumber != null">
- and
- <foreach collection="materialFunaceNumber" item="item" open="(" separator="or" close=")">
- "materialFunaceNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="materialCode != null">
- and
- <foreach collection="materialCode" item="item" open="(" separator="or" close=")">
- "materialCode" like '%${item}%'
- </foreach>
- </if>
- <if test="materialName != null">
- and
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="materialSpecifition != null">
- and
- <foreach collection="materialSpecifition" item="item" open="(" separator="or" close=")">
- "materialSpecifition" like '%${item}%'
- </foreach>
- </if>
- <if test="materialProductionDate != null">
- and
- <foreach collection="materialProductionDate" item="item" open="(" separator="or" close=")">
- "materialProductionDate" like '%${item}%'
- </foreach>
- </if>
- <if test="materialTheoreticalWeight != null">
- and
- <foreach collection="materialTheoreticalWeight" item="item" open="(" separator="or" close=")">
- "materialTheoreticalWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="makematerialNumber != null">
- and
- <foreach collection="makematerialNumber" item="item" open="(" separator="or" close=")">
- "makematerialNumber" like '%${item}%'
- </foreach>
- </if>
- </select>
- <!-- 查询最大id-->
- <!-- <select id="selectMaxId" parameterType="int" resultType="DECIMAL">-->
- <!-- select MAX(RESULT_ID) FROM WMSP_RESTACK_SCAN_RESULT-->
- <!-- </select>-->
- <!-- 根据物资唯一编码查询钢材物资表主键id -->
- <select id="selectRestackAudit" parameterType="java.lang.String" resultType="java.lang.Integer">
- SELECT
- gcwz.MATERIAL_STEEL_ID
- FROM
- RMS_MATERIAL_STEEL gcwz
- WHERE
- gcwz.MATERIAL_ONLY_CODE = #{materialOnlyCode}
- </select>
- <!-- 根据物资编码查找钢材物资id -->
- <select id="selectMaterialSteelId" parameterType="java.lang.String" resultType="java.lang.Integer">
- select RMS.MATERIAL_STEEL_ID "mateialsteelId"
- from RMS_MATERIAL RM
- left join RMS_MATERIAL_STEEL RMS
- on RMS.MATERIAL_STEEL_ID=RM.MATERIAL_ID
- WHERE RMS.MATERIAL_ONLY_CODE=#{materialOnlyCode}
- </select>
- <!-- 根据倒垛单实绩id查找物资id-->
- <select id="selectMaterialIdByResultId" parameterType="java.lang.Integer" resultType="java.util.Map">
- SELECT
- gcwz.MATERIAL_STEEL_ID
- FROM
- WMSP_RESTACK_MAKE_RESULT d
- LEFT JOIN WMSP_RESTACK_MAKE_MATERIAL dwz ON d.RESULT_ID = dwz.MAKE_RESULT_ID
- LEFT JOIN RMS_MATERIAL_STEEL gcwz ON dwz.MATERIAL_ID = gcwz.MATERIAL_STEEL_ID
- WHERE
- d.RESULT_ID = #{retultId}
- </select>
- <!--根据稽核结果进行统计订单数量-->
- <select id="CountByAuditResult" parameterType="java.lang.Integer" resultType="java.lang.Integer">
- SELECT
- COUNT( * )
- FROM
- WMSP_RESTACK_SCAN_RESULT sm
- WHERE
- sm.RESULT_RESTACK_ID = #{retultId}
- AND sm.RESULT_LOADER_AUDIT = 1
- </select>
- <!-- 查询垛位已堆放物资件数-->
- <select id="selectNumber" parameterType="int" resultType="int" >
- select RS.STACKING_MATERIAL_NUMBER "materialNumber"
- from RMS_STACKING RS
- where RS.STACKING_ID=#{stackingId1}
- </select>
- <!-- 根据稽核成功查询物资信息列表-->
- <select id="selectListByAuditResult" parameterType="java.lang.Integer" resultType="java.util.LinkedHashMap" >
- select *
- from (select
- RMS.MATERIAL_FURNACE_NUMBER "materialFurnaceNumber",
- RM.MATERIAL_CODE "materialCode",
- RM.MATERIAL_NAME "materialName",
- RM.MATERIAL_SPECIFICATION "materialSpecocation",
- RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
- RM.MATERIAL_SPECIFICATION "materialSpecification",
- RM.MATERIAL_LENGTH "materialLength"
- from RMS_MATERIAL RM
- left join RMS_MATERIAL_STEEL RMS
- on RM.MATERIAL_ID=RMS.MATERIAL_ID
- where RM.MATERIAL_ID=#{mateialId}
- )
- <where>
- <if test="materialFurnaceNumber != null">
- and
- <foreach collection="materialFurnaceNumber" item="item" open="(" separator="or" close=")">
- "materialFurnaceNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="materialCode != null">
- and
- <foreach collection="materialCode" item="item" open="(" separator="or" close=")">
- "materialCode" like '%${item}%'
- </foreach>
- </if>
- <if test="materialName != null">
- and
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="materialSpecocation != null">
- and
- <foreach collection="materialSpecocation" item="item" open="(" separator="or" close=")">
- "materialSpecocation" like '%${item}%'
- </foreach>
- </if>
- <if test="materialLength != null">
- and
- <foreach collection="materialLength" item="item" open="(" separator="or" close=")">
- "materialLength" like '%${item}%'
- </foreach>
- </if>
- </where>
- </select>
- <!-- 根据垛位和层次以及层序及仓库id计算倒垛后的仓库网格id -->
- <select id="selectGridIdByStakingNoAndGrandationnumber" parameterType="java.util.Map" resultType="java.lang.Integer">
- SELECT RPG.GRID_ID "gridId"
- FROM RMS_PWAREHOUSE_GRID RPG
- LEFT JOIN RMS_WAREHOUSE RW
- ON RW.WAREHOUSE_ID=RPG.WAREHOUSE_ID
- LEFT JOIN RMS_STACKING RS
- ON RPG.STACKING_ID = RS.STACKING_ID
- WHERE RW.WAREHOUSE_ID=#{warehouseId}
- and RS.STACKING_ID=#{stakingId}
- and RPG.GRID_GRADATION_NUMBER=#{gradationNumber}
- and RPG.GRID_SEQUENCE_NUMBER=#{sequenceNumber}
- </select>
- <!-- 根据实绩id查找倒垛后的仓库和垛位 -->
- <select id="selectWarehouseIdAndStakingId" resultType="java.util.LinkedHashMap" parameterType="DECIMAL">
- SELECT WRMR.AFTER_WAREHOUSE_ID "warehouseId",
- WRMR.AFTER_STACKING_ID "stakingId"
- FROM WMSP_RESTACK_MAKE_RESULT WRMR
- WHERE WRMR.RESULT_ID=#{resultId}
- </select>
- <!-- 根据实绩id查找倒垛后的仓库和垛位 -->
- <select id="selectResultScanTag" resultType="java.lang.Integer" parameterType="java.lang.String">
- SELECT
- count( * )
- FROM WMSP_RESTACK_SCAN_RESULT sm
- WHERE sm.RESULT_SCAN_TAG = #{resultScanTag}
- </select>
- <!--根据网格id和物资id查找主键id -->
- <select id="selectGmIdByGridIdAndMaterialId" parameterType="java.lang.Integer" resultType="java.lang.Integer">
- select WGM.GM_ID "gmId"
- from WMSP_GRID_MATERIAL WGM
- where WGM.GRID_ID=#{gridId} and WGM.MATERIAL_ID=#{materialId}
- </select>
- <!-- 根据实绩id查找倒垛前的仓储网格id -->
- <select id="selectGridIdByResultId" parameterType="java.lang.Integer" resultType="java.lang.Integer">
- select WRMM.BEFORE_GRID_ID "BeforegridId"
- from WMSP_RESTACK_MAKE_MATERIAL WRMM
- where WRMM.MAKE_RESULT_ID=#{resultId}
- </select>
- <!--根据网格id查找倒垛前的物资-->
- <select id="selectMaterialIdByGridId" parameterType="java.lang.Integer" resultType="java.lang.Integer">
- select WGM.MATERIAL_ID "materialId"
- from WMSP_GRID_MATERIAL WGM
- where WGM.GRID_ID=#{gridId}
- </select>
- <select id="selectTagByResultId" parameterType="java.lang.Integer" resultType="java.util.Map">
- select WRSR.RESULT_SCAN_TAG "tag"
- from WMSP_RESTACK_SCAN_RESULT WRSR
- where WRSR.RESULT_RESTACK_ID=#{resultId} AND WRSR.RESULT_LOADER_AUDIT=1
- </select>
- <select id="getWmspRestackScanResultCount" resultType="java.lang.Integer">
- select count(*) from WMSP_RESTACK_SCAN_RESULT WRSR
- where WRSR.MATERIAL_ONLY_CODE=#{onlyCode}
- </select>
- </mapper>
|