<?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.ld.igds.inout.mapper.InoutRecordMapper">
|
<!-- 基本返回信息 -->
|
<sql id="BASE_COLUMN">
|
ID_ as id,
|
COMPANY_ID_ as companyId,
|
DEPT_ID_ as deptId,
|
NOTICE_ID_ as noticeId,
|
DEPOT_ID_ as depotId,
|
TYPE_ as type,
|
PROGRESS_ as progress,
|
RECORD_STATUS_ as recordStatus,
|
CUSTOMER_NAME_ as customerName,
|
INTEL_CARD_ as intelCard,
|
REGISTER_TIME_ as registerTime,
|
REGISTER_USER_ as registerUser,
|
USER_NAME_ as userName,
|
USER_CONTACT_ as userContact,
|
USER_ID_ as userId,
|
USER_BIRTHDAY_ as userBirthday,
|
USER_SEX_ as userSex,
|
USER_NATION_ as userNation,
|
USER_ADDRESS_ as userAddress,
|
PLATE_NUM_ as plateNum,
|
TRANS_TYPE_ as transType,
|
FOOD_VARIETY_ as foodVariety,
|
FOOD_TYPE_ as foodType,
|
FOOD_LEVEL_ as foodLevel,
|
FOOD_LOCATION_ID_ as foodLocationId,
|
FOOD_LOCATION_ as foodLocation,
|
FOOD_YEAR_ as foodYear,
|
CHECK_STATUS_ as checkStatus,
|
CHECK_USER_ as checkUser,
|
CHECK_TIME_ as checkTime,
|
SAMPLE_USER_ as sampleUser,
|
SAMPLE_TIME_ as sampleTime,
|
SAMPLE_TYPE_ as sampleType,
|
CHECK_ID_ as checkId,
|
DE_CHECK_ as deCheck,
|
ADD_CHECK_ as addCheck,
|
jjlx as jjlx,
|
FULL_WEIGHT_ as fullWeight,
|
FULL_WEIGHT_TIME_ as fullWeightTime,
|
FULL_WEIGHT_USER_ as fullWeightUser,
|
EMPTY_WEIGHT_ as emptyWeight,
|
EMPTY_WEIGHT_TIME_ as emptyWeightTime,
|
EMPTY_WEIGHT_USER_ as emptyWeightUser,
|
NET_WEIGHT_ as netWeight,
|
DE_HANDLE_ as deHandle,
|
DE_PACKAGE_ as dePackage,
|
DE_OTHER_ as deOther,
|
DE_OTHER_INTO_ as deOtherInfo,
|
SETTLE_WEIGHT_ as settleWeight,
|
RECORD_WEIGHT_ as recordWeight,
|
PRICE_ as price,
|
SETTLE_MONEY_ as settleMoney,
|
SETTLE_ID_ as settleId,
|
HANDLE_USER_ as handleUser,
|
COMPLETE_TIME_ as completeTime,
|
COMPLETE_USER_ as completeUser,
|
REMARKS_ as remarks,
|
bzw as bzw,
|
dbz as dbz,
|
bzbjs as bzbjs
|
</sql>
|
|
<!-- 根据条件查询,数据必须是流程中的数据 -->
|
<select id="inoutProgressQuery" resultType="com.ld.igds.inout.dto.InoutData"
|
parameterType="com.ld.igds.inout.dto.InoutParam">
|
select
|
<include refid="BASE_COLUMN"/>
|
from
|
D_INOUT_RECORD
|
<where>
|
<if test="param.companyId != null and param.companyId != '' ">AND COMPANY_ID_ = #{param.companyId}</if>
|
<if test="param.type != null and param.type != '' ">AND TYPE_ = #{param.type}</if>
|
<if test="param.plateNum != null and param.plateNum != '' ">AND PLATE_NUM_ = #{param.plateNum}</if>
|
<if test="param.intelCard != null and param.intelCard != '' ">AND INTEL_CARD_ = #{param.intelCard}</if>
|
<if test="param.id != null and param.id != '' ">AND ID_ = #{param.id}</if>
|
<if test="param.progress != null and param.progress != '' ">AND PROGRESS_ = #{param.progress}</if>
|
|
AND PROGRESS_ != 'RECORD'
|
AND RECORD_STATUS_ != 'ERROR'
|
AND RECORD_STATUS_ != 'DEL'
|
</where>
|
</select>
|
|
<!-- 根据条件查询,要求时间条件必须,必须是正常数据 -->
|
<select id="listRecordData" resultType="com.ld.igds.inout.dto.InoutData"
|
parameterType="com.ld.igds.inout.dto.InoutParam">
|
select
|
<include refid="BASE_COLUMN"/>
|
from
|
D_INOUT_RECORD
|
<where>
|
<if test="param.companyId != null and param.companyId != '' ">AND COMPANY_ID_ = #{param.companyId}</if>
|
<if test="param.depotId != null and param.depotId != '' ">AND DEPOT_ID_ = #{param.depotId}</if>
|
<if test="param.type != null and param.type != '' ">AND TYPE_ = #{param.type}</if>
|
<if test="param.plateNum != null and param.plateNum != '' ">AND PLATE_NUM_ = #{param.plateNum}</if>
|
<if test="param.intelCard != null and param.intelCard != '' ">AND INTEL_CARD_ = #{param.intelCard}</if>
|
<if test="param.id != null and param.id != '' ">AND ID_ = #{param.id}</if>
|
<if test="param.progress != null and param.progress != '' ">AND PROGRESS_ = #{param.progress}</if>
|
<if test="param.end != null">AND
|
COMPLETE_TIME_ <![CDATA[ < ]]>#{param.end,jdbcType=TIMESTAMP}
|
</if>
|
<if test="param.start != null">AND
|
COMPLETE_TIME_ <![CDATA[ > ]]>#{param.start,jdbcType=TIMESTAMP}
|
</if>
|
AND PROGRESS_ = 'RECORD'
|
AND RECORD_STATUS_ != 'ERROR'
|
AND RECORD_STATUS_ != 'DEL'
|
ORDER BY COMPLETE_TIME_
|
</where>
|
</select>
|
|
<!-- 根据条件查询,根据主键查询 -->
|
<select id="inoutQueryById" resultType="com.ld.igds.inout.dto.InoutData"
|
parameterType="com.ld.igds.inout.dto.InoutParam">
|
select
|
<include refid="BASE_COLUMN"/>
|
from
|
D_INOUT_RECORD
|
<where>
|
<if test="param.companyId != null and param.companyId != '' ">AND COMPANY_ID_ = #{param.companyId}</if>
|
<if test="param.type != null and param.type != '' ">AND TYPE_ = #{param.type}</if>
|
<if test="param.plateNum != null and param.plateNum != '' ">AND PLATE_NUM_ = #{param.plateNum}</if>
|
<if test="param.intelCard != null and param.intelCard != '' ">AND INTEL_CARD_ = #{param.intelCard}</if>
|
<if test="param.progress != null and param.progress != '' ">AND PROGRESS_ = #{param.progress}</if>
|
</where>
|
AND ID_ = #{param.id}
|
</select>
|
|
<!-- 根据条件查询,获取最后一车信息 -->
|
<select id="getLastRecord" resultType="com.ld.igds.inout.dto.InoutData"
|
parameterType="com.ld.igds.inout.dto.InoutParam">
|
select
|
<include refid="BASE_COLUMN"/>
|
from
|
D_INOUT_RECORD
|
<where>
|
<if test="param.companyId != null and param.companyId != '' ">AND COMPANY_ID_ = #{param.companyId}</if>
|
<if test="param.depotId != null and param.depotId != '' ">AND DEPOT_ID_ = #{param.depotId}</if>
|
<if test="param.end != null">AND
|
COMPLETE_TIME_ <![CDATA[ < ]]>#{param.end,jdbcType=TIMESTAMP}
|
</if>
|
<if test="param.curStorage > 0">AND CUR_STORAGE_ > 0</if>
|
</where>
|
AND PROGRESS_ = 'RECORD'
|
AND RECORD_STATUS_ != 'ERROR'
|
AND RECORD_STATUS_ != 'DEL'
|
ORDER BY COMPLETE_TIME_ DESC
|
LIMIT 1
|
</select>
|
|
<!--根据参数获取系统中的个数 -->
|
<select id="validateInoutData" parameterType="com.ld.igds.inout.dto.InoutParam"
|
resultType="java.lang.Integer">
|
select count(1) from D_INOUT_RECORD
|
<where>
|
<if test="param.companyId != null">AND COMPANY_ID_ = #{param.companyId}</if>
|
<if test="param.intelCard != null and param.plateNum != null">
|
AND ( INTEL_CARD_ = #{param.intelCard} OR PLATE_NUM_ = #{param.plateNum} )
|
</if>
|
and PROGRESS_ <> 'RECORD' and RECORD_STATUS_ != 'DEL' and RECORD_STATUS_ != 'ERROR'
|
</where>
|
</select>
|
|
<update id="deleteData" parameterType="com.ld.igds.inout.dto.InoutParam">
|
update D_INOUT_RECORD
|
<set>
|
RECORD_STATUS_ ='DEL',
|
PROGRESS_ = 'RECORD',
|
<if test="param.msg != null and param.msg != '' ">REMARKS_ = concat(REMARKS_,#{param.msg})</if>
|
</set>
|
where COMPANY_ID_ = #{param.companyId}
|
AND ID_ = #{param.id}
|
</update>
|
|
<update id="inoutStop" parameterType="com.ld.igds.inout.dto.InoutParam">
|
update D_INOUT_RECORD
|
<set>
|
RECORD_STATUS_ ='ERROR',
|
PROGRESS_ = 'RECORD',
|
<if test="param.checkStatus != null and param.checkStatus != '' ">CHECK_STATUS_ = #{param.checkStatus},</if>
|
<if test="param.msg != null and param.msg != '' ">REMARKS_ = concat(REMARKS_,#{param.msg})</if>
|
</set>
|
<where>
|
<if test="param.companyId != null and param.companyId != '' ">COMPANY_ID_ = #{param.companyId}</if>
|
<if test="param.id != null and param.id != '' ">AND ID_ = #{param.id}</if>
|
</where>
|
|
</update>
|
|
|
<select id="getMaxId" parameterType="java.lang.String"
|
resultType="java.util.Map">
|
select MAX(ID_) AS maxId
|
from
|
D_INOUT_RECORD
|
where company_Id_
|
=#{companyId} and id_ like #{likeKey}
|
</select>
|
|
<update id="updateData" parameterType="com.ld.igds.inout.dto.InoutData">
|
update D_INOUT_RECORD set
|
TYPE_ = #{data.type},
|
<if test="data.depotId != null">DEPOT_ID_ = #{data.depotId},</if>
|
<if test="data.noticeId != null">NOTICE_ID_ = #{data.noticeId},</if>
|
<if test="data.recordStatus != null">RECORD_STATUS_ = #{data.recordStatus},</if>
|
<if test="data.checkStatus != null">CHECK_STATUS_ = #{data.checkStatus},</if>
|
<if test="data.checkId != null">CHECK_ID_ = #{data.checkId},</if>
|
<if test="data.checkUser != null">CHECK_USER_ = #{data.checkUser},</if>
|
<if test="data.registerTime != null">REGISTER_TIME_ = #{data.registerTime},</if>
|
<if test="data.registerUser != null">REGISTER_USER_ = #{data.registerUser},</if>
|
<if test="data.userName != null">USER_NAME_ = #{data.userName},</if>
|
<if test="data.userBirthday != null">USER_BIRTHDAY_ = #{data.userBirthday},</if>
|
<if test="data.userSex != null">USER_SEX_ = #{data.userSex},</if>
|
<if test="data.userNation != null">USER_NATION_ = #{data.userNation},</if>
|
<if test="data.userId != null">USER_ID_ = #{data.userId},</if>
|
<if test="data.userContact != null">USER_CONTACT_ = #{data.userContact},</if>
|
<if test="data.userAddress != null">USER_ADDRESS_ = #{data.userAddress},</if>
|
<if test="data.intelCard != null">INTEL_CARD_ = #{data.intelCard},</if>
|
<if test="data.plateNum != null">PLATE_NUM_ = #{data.plateNum},</if>
|
<if test="data.transType != null">TRANS_TYPE_ = #{data.transType},</if>
|
<if test="data.specType != null">SPEC_TYPE_ = #{data.specType},</if>
|
<if test="data.customerId != null">CUSTOMER_ID_ = #{data.customerId},</if>
|
<if test="data.customerName != null">CUSTOMER_NAME_ = #{data.customerName},</if>
|
<if test="data.foodVariety != null">FOOD_VARIETY_ = #{data.foodVariety},</if>
|
<if test="data.foodLevel != null">FOOD_LEVEL_ = #{data.foodLevel},</if>
|
<if test="data.foodLocation != null">FOOD_LOCATION_ = #{data.foodLocation},</if>
|
<if test="data.foodYear != null">FOOD_YEAR_ = #{data.foodYear},</if>
|
<if test="data.impurity != null">IMPURITY_ = #{data.impurity},</if>
|
<if test="data.deImpurity != null">DE_IMPURITY_ = #{data.deImpurity},</if>
|
<if test="data.wet != null">WET_ = #{data.wet},</if>
|
<if test="data.deWet != null">DE_WET_ = #{data.deWet},</if>
|
<if test="data.deHandle != null">DE_HANDLE_ = #{data.deHandle},</if>
|
<if test="data.deOther != null">DE_OTHER_ = #{data.deOther},</if>
|
<if test="data.deSum != null">DE_SUM_ = #{data.deSum},</if>
|
<if test="data.fullWeight != null">FULL_WEIGHT_ = #{data.fullWeight},</if>
|
<if test="data.fullWeightTime != null">FULL_WEIGHT_TIME_ = #{data.fullWeightTime},</if>
|
<if test="data.fullWeightUser != null">FULL_WEIGHT_USER_ = #{data.fullWeightUser},</if>
|
<if test="data.emptyWeight != null">EMPTY_WEIGHT_ = #{data.emptyWeight},</if>
|
<if test="data.emptyWeightTime != null">EMPTY_WEIGHT_TIME_ = #{data.emptyWeightTime},</if>
|
<if test="data.emptyWeightUser != null">EMPTY_WEIGHT_USER_ = #{data.emptyWeightUser},</if>
|
<if test="data.netWeight != null">NET_WEIGHT_ = #{data.netWeight},</if>
|
<if test="data.settleWeight != null">SETTLE_WEIGHT_ = #{data.settleWeight},</if>
|
<if test="data.recordWeight != null">RECORD_WEIGHT_ = #{data.recordWeight},</if>
|
<if test="data.handleStart != null">HANDLE_START_ = #{data.handleStart},</if>
|
<if test="data.handleEnd != null">HANDLE_END_ = #{data.handleEnd},</if>
|
<if test="data.handleUser != null">HANDLE_USER_ = #{data.handleUser},</if>
|
<if test="data.completeTime != null">COMPLETE_TIME_ = #{data.completeTime},</if>
|
<if test="data.completeUser != null">COMPLETE_USER_ = #{data.completeUser},</if>
|
<if test="data.remarks != null">REMARKS_ = #{data.remarks},</if>
|
<if test="data.curStorage != null">CUR_STORAGE_ = #{data.curStorage},</if>
|
<if test="data.foodType != null">FOOD_TYPE_ = #{data.foodType},</if>
|
<if test="data.price != null">PRICE_ = #{data.price},</if>
|
<if test="data.settleMoney != null">SETTLE_MONEY_ = #{data.settleMoney},</if>
|
PROGRESS_ = #{data.progress}
|
where
|
company_id_ =#{data.companyId}
|
and id_=#{data.id}
|
</update>
|
|
|
<!-- 新增数据 -->
|
<insert id="insertData" parameterType="com.ld.igds.inout.dto.InoutData">
|
insert into
|
D_INOUT_RECORD(
|
ID_,
|
COMPANY_ID_,
|
DEPT_ID_,
|
NOTICE_ID_,
|
DEPOT_ID_,
|
TYPE_,
|
PROGRESS_,
|
RECORD_STATUS_,
|
CUSTOMER_NAME_,
|
INTEL_CARD_,
|
REGISTER_TIME_,
|
REGISTER_USER_,
|
USER_NAME_,
|
USER_CONTACT_,
|
USER_ID_,
|
USER_BIRTHDAY_,
|
USER_SEX_,
|
USER_NATION_,
|
USER_ADDRESS_,
|
PLATE_NUM_,
|
TRANS_TYPE_,
|
FOOD_VARIETY_,
|
FOOD_TYPE_,
|
FOOD_LEVEL_,
|
FOOD_LOCATION_ID_,
|
FOOD_LOCATION_,
|
FOOD_YEAR_,
|
CHECK_STATUS_,
|
CHECK_USER_,
|
CHECK_TIME_,
|
SAMPLE_USER_,
|
SAMPLE_TIME_,
|
SAMPLE_TYPE_,
|
CHECK_ID_,
|
DE_CHECK_,
|
ADD_CHECK_,
|
jjlx,
|
FULL_WEIGHT_,
|
FULL_WEIGHT_TIME_,
|
FULL_WEIGHT_USER_,
|
EMPTY_WEIGHT_,
|
EMPTY_WEIGHT_TIME_,
|
EMPTY_WEIGHT_USER_,
|
NET_WEIGHT_,
|
DE_HANDLE_,
|
DE_PACKAGE_,
|
DE_OTHER_,
|
DE_OTHER_INTO_,
|
SETTLE_WEIGHT_,
|
RECORD_WEIGHT_,
|
PRICE_,
|
SETTLE_MONEY_,
|
SETTLE_ID_,
|
HANDLE_USER_,
|
COMPLETE_TIME_,
|
COMPLETE_USER_,
|
REMARKS_,
|
bzw,
|
dbz,
|
bzbjs,
|
UPDATE_TIME_
|
)
|
values
|
(
|
#{data.id},
|
#{data.companyId},
|
#{data.deptId},
|
#{data.noticeId},
|
#{data.depotId},
|
#{data.type},
|
#{data.progress},
|
#{data.recordStatus},
|
#{data.customerName},
|
#{data.intelCard},
|
#{data.registerTime},
|
#{data.registerUser},
|
#{data.userName},
|
#{data.userContact},
|
#{data.userId},
|
#{data.userBirthday},
|
#{data.userSex},
|
#{data.userNation},
|
#{data.userAddress},
|
#{data.plateNum},
|
#{data.transType},
|
#{data.foodVariety},
|
#{data.foodType},
|
#{data.foodLevel},
|
#{data.foodLocationId},
|
#{data.foodLocation},
|
#{data.foodYear},
|
#{data.checkStatus},
|
#{data.checkUser},
|
#{data.checkTime},
|
#{data.sampleUser},
|
#{data.sampleTime},
|
#{data.sampleType},
|
#{data.checkId},
|
#{data.deCheck},
|
#{data.addCheck},
|
#{data.jjlx},
|
#{data.fullWeight},
|
#{data.fullWeightTime},
|
#{data.fullWeightUser},
|
#{data.emptyWeight},
|
#{data.emptyWeightTime},
|
#{data.emptyWeightUser},
|
#{data.netWeight},
|
#{data.deHandle},
|
#{data.dePackage},
|
#{data.deOther},
|
#{data.deOtherInfo},
|
#{data.settleWeight},
|
#{data.recordWeight},
|
#{data.price},
|
#{data.settleMoney},
|
#{data.settleId},
|
#{data.handleUser},
|
#{data.completeTime},
|
#{data.completeUser},
|
#{data.remarks},
|
#{data.bzw},
|
#{data.dbz},
|
#{data.bzbjs},
|
#{data.updateTime}
|
)
|
</insert>
|
|
<select id="pageRecordData" resultType="com.ld.igds.inout.dto.InoutData"
|
parameterType="com.ld.igds.inout.dto.InoutParam">
|
select
|
<include refid="BASE_COLUMN"/>
|
from
|
D_INOUT_RECORD
|
<where>
|
<if test="param.companyId != null and param.companyId != '' ">AND COMPANY_ID_ = #{param.companyId}</if>
|
<if test="param.type != null and param.type != '' ">AND TYPE_ = #{param.type}</if>
|
<if test="param.foodVariety != null and param.foodVariety != '' ">AND FOOD_VARIETY_ = #{param.foodVariety}
|
</if>
|
<if test="param.plateNum != null and param.plateNum != '' ">AND PLATE_NUM_ like #{param.plateNum}</if>
|
<if test="param.customerId != null and param.customerId != '' ">AND CUSTOMER_ID_ = #{param.customerId}</if>
|
<if test="param.progress != null and param.progress != '' ">AND PROGRESS_ = #{param.progress}</if>
|
<if test="param.recordStatus != null and param.recordStatus != '' ">AND RECORD_STATUS_ =
|
#{param.recordStatus}
|
</if>
|
<if test="param.userId != null and param.userId != '' ">AND USER_ID_ like #{param.userId}</if>
|
<if test="param.id != null and param.id != '' ">AND ID_ = #{param.id}</if>
|
<if test="param.checkId != null and param.checkId != '' ">AND CHECK_ID_ = #{param.checkId}</if>
|
<if test="param.start != null">AND
|
REGISTER_TIME_ <![CDATA[ >= ]]>#{param.start,jdbcType=TIMESTAMP}
|
</if>
|
<if test="param.end != null">AND
|
REGISTER_TIME_ <![CDATA[ <= ]]>#{param.end,jdbcType=TIMESTAMP}
|
</if>
|
<if test="param.depotId != null and param.depotId != '' ">AND DEPOT_ID_ = #{param.depotId}</if>
|
<if test="param.deptId != null and param.deptId != '' ">AND DEPT_ID_ = #{param.deptId}</if>
|
<if
|
test="param.customerName != null and param.customerName != '' and param.customerId == null ">AND
|
CUSTOMER_NAME_ like CONCAT('%',#{param.customerName},'%')
|
</if>
|
|
<if test="param.checkStatus != null and param.checkStatus != 'NONE' ">AND CHECK_STATUS_ != 'NONE' AND
|
CHECK_STATUS_ IS NOT NULL
|
</if>
|
<if test="param.checkStatus != null and param.checkStatus == 'NONE' ">AND CHECK_STATUS_ = 'NONE'</if>
|
|
</where>
|
AND RECORD_STATUS_ != 'DEL'
|
|
<choose>
|
<when test="param.orderTag != null and param.orderTag == 'ASC' ">
|
ORDER BY ID_ ASC
|
</when>
|
|
<otherwise>
|
ORDER BY ID_ DESC
|
</otherwise>
|
</choose>
|
|
</select>
|
|
|
<!-- 完成出入库-->
|
<update id="toComplete" parameterType="com.ld.igds.inout.dto.InoutParam">
|
update D_INOUT_RECORD
|
set PROGRESS_ = #{param.progress},
|
COMPLETE_TIME_ =#{param.completeTime},
|
<if test="param.fullWeight != null and param.fullWeight > 0">FULL_WEIGHT_ = #{param.fullWeight},</if>
|
<if test="param.fullWeightUser != null">FULL_WEIGHT_USER_ = #{param.fullWeightUser},</if>
|
<if test="param.fullWeightTime != null">FULL_WEIGHT_TIME_ = #{param.fullWeightTime},</if>
|
<if test="param.emptyWeight != null and param.fullWeight > 0">EMPTY_WEIGHT_ = #{param.emptyWeight},</if>
|
<if test="param.emptyWeightTime != null">EMPTY_WEIGHT_TIME_ = #{param.emptyWeightTime},</if>
|
<if test="param.emptyWeightUser != null">EMPTY_WEIGHT_USER_ = #{param.emptyWeightUser},</if>
|
<if test="param.netWeight != null and param.fullWeight > 0">NET_WEIGHT_ = #{param.netWeight},</if>
|
<if test="param.settleWeight != null and param.settleWeight > 0">SETTLE_WEIGHT_ = #{param.settleWeight},</if>
|
<if test="param.recordWeight != null and param.recordWeight > 0">RECORD_WEIGHT_ = #{param.recordWeight},</if>
|
<if test="param.de != null and param.de > 0">DE_SUM_ = #{param.de},</if>
|
<if test="param.depotId != null and param.depotId != ''">DEPOT_ID_ = #{param.depotId},</if>
|
<if test="param.price != null and param.price > 0">PRICE_ = #{param.price},</if>
|
<if test="param.settleMoney != null and param.settleMoney > 0">SETTLE_MONEY_ = #{param.settleMoney},</if>
|
COMPLETE_USER_ = #{param.userId}
|
where ID_ = #{param.id}
|
and TYPE_ = #{param.type}
|
and COMPANY_ID_ = #{param.companyId}
|
and RECORD_STATUS_ != 'DEL'
|
and RECORD_STATUS_ != 'ERROR'
|
</update>
|
|
<!-- 查询流程未完成的流水信息 -->
|
<select id="pageUnCompleteData" resultType="com.ld.igds.inout.dto.InoutData"
|
parameterType="com.ld.igds.inout.dto.InoutParam">
|
select
|
<include refid="BASE_COLUMN"/>
|
from
|
D_INOUT_RECORD
|
<where>
|
<if test="param.companyId != null and param.companyId != '' ">AND COMPANY_ID_ = #{param.companyId}</if>
|
<if test="param.deptId != null and param.deptId != '' ">AND DEPT_ID_ = #{param.deptId}</if>
|
<if test="param.type != null and param.type != '' ">AND TYPE_ = #{param.type}</if>
|
<if test="param.depotId != null and param.depotId != '' ">AND DEPOT_ID_ = #{param.depotId}</if>
|
<if test="param.customerName != null and param.customerName != '' ">AND CUSTOMER_NAME_ like
|
#{param.customerName}
|
</if>
|
<if test="param.id != null and param.id != '' ">AND ID_ like #{param.id}</if>
|
<if test="param.start != null">AND
|
REGISTER_TIME_ <![CDATA[ >= ]]>#{param.start,jdbcType=TIMESTAMP}
|
</if>
|
<if test="param.end != null">AND
|
REGISTER_TIME_ <![CDATA[ <= ]]>#{param.end,jdbcType=TIMESTAMP}
|
</if>
|
</where>
|
AND RECORD_STATUS_ != 'DEL'
|
AND PROGRESS_ != 'RECORD'
|
AND PROGRESS_ != 'PAY'
|
AND RECORD_STATUS_ != 'ERROR'
|
</select>
|
|
|
<!-- 获取开始周期-截至周期内,出入库入库重量汇总合计 -->
|
<select id="sumRecordWeight" resultType="com.ld.igds.data.CommonData"
|
parameterType="com.ld.igds.inout.dto.InoutParam">
|
select SUM(RECORD_WEIGHT_) as numValue1
|
from D_INOUT_RECORD
|
where
|
PROGRESS_ = 'RECORD'
|
AND RECORD_STATUS_ != 'DEL'
|
AND RECORD_STATUS_ != 'ERROR'
|
<if test="param.type != null and param.type != ''">AND TYPE_ = #{param.type}</if>
|
<if test="param.companyId != null and param.companyId != ''">AND COMPANY_ID_ = #{param.companyId}</if>
|
<if test="param.deptId != null and param.deptId != ''">AND DEPT_ID_ = #{param.deptId}</if>
|
<if test="param.depotId != null and param.depotId != ''">AND DEPOT_ID_ = #{param.depotId}</if>
|
<if test="param.customerId != null and param.customerId != ''">AND CUSTOMER_ID_ = #{param.customerId}</if>
|
<if test="param.foodVariety != null and param.foodVariety != ''">AND FOOD_VARIETY_ = #{param.foodVariety}</if>
|
<if test="param.id != null and param.id != ''">AND NOTICE_ID_ = #{param.id}</if>
|
<if test="param.start != null">AND
|
COMPLETE_TIME_ <![CDATA[ > ]]> #{param.start}
|
</if>
|
<if test="param.end != null">AND
|
COMPLETE_TIME_ <![CDATA[ < ]]> #{param.end}
|
</if>
|
</select>
|
|
<!--根据车牌和卡号验证是否有重复信息-->
|
<select id="checkExist" parameterType="com.ld.igds.inout.dto.InoutParam" resultType="int">
|
select count(1)
|
from
|
D_INOUT_RECORD
|
WHERE COMPANY_ID_ = #{param.companyId}
|
AND TYPE_ = #{param.type}
|
AND (PLATE_NUM_ = #{param.plateNum} or INTEL_CARD_ = #{param.intelCard})
|
AND PROGRESS_ != 'RECORD'
|
AND RECORD_STATUS_ != 'ERROR'
|
AND RECORD_STATUS_ != 'DEL'
|
<if test="param.start != null">
|
AND REGISTER_TIME_ <![CDATA[ > ]]> #{param.start,jdbcType=TIMESTAMP}
|
</if>
|
</select>
|
|
</mapper>
|