@ -124,6 +124,9 @@
<result column= "flagForOpenDepository" property= "flagForOpenDepository" jdbcType= "INTEGER" />
<result column= "editUser" property= "editUser" jdbcType= "VARCHAR" />
<result column= "mbrand" property= "mbrand" jdbcType= "VARCHAR" />
<result column= "flagForAgency" property= "flagForAgency" jdbcType= "INTEGER" />
<result column= "createUid" property= "createUid" jdbcType= "INTEGER" />
</resultMap>
@ -151,7 +154,7 @@
</sql>
<sql id= "simpleApplicationIn" >
airid,applicant_id,applicant_time,applyRemark
airid,applicant_id,applicant_time,applyRemark
</sql>
<!-- 表查询字段 -->
<sql id= "allColumns" >
@ -177,7 +180,7 @@
<sql id= "ApplicationOutRecordInfo" >
aorid,mid,mname,depositoryId,dname,applicantId,applicantTime,applyRemark,aorcode,aorpirce,aorquantity,departmenthead,departmentheadPass,departmentHeadTime,departmentheadMessage,
depositoryManager,depositoryManagerPass,depositoryManagerTime,depositoryManagerMessage,aorstate,istransfer,mcode,placeId,pass,aormUnit,aorconstructionunitid,aoradminorgid,cuname,
cuintroduce,cuaddress,outTime,abstract,outType,editUser,mbrand,mversion,flagForOpenDepository
cuintroduce,cuaddress,outTime,abstract,outType,editUser,mbrand,mversion,flagForOpenDepository,createUid,flagForAgency
</sql>
<sql id= "ApplicationOutRecordMinInfo" >
@ -185,8 +188,7 @@
</sql>
<!-- 查询所有数据行数 -->
<select id= "findCount" resultType= "integer" >
SELECT
count(*)
SELECT count(*)
FROM depository_record dr
</select>
<!-- 查询相应用户的任务数 -->
@ -362,9 +364,6 @@
</select>
<!-- 根据条件查询入库记录 -->
<select id= "findApplicationInRecordByDepository" parameterType= "String" resultMap= "applicationInRecord" >
select
@ -403,19 +402,19 @@
</if>
<if test= "mname != null and mname != ''" >
and mname like CONCAT('%', #{mname}, '%')
and mname like CONCAT('%', #{mname}, '%')
</if>
<if test= "version != null and version != ''" >
and mversion like CONCAT('%', #{version}, '%')
and mversion like CONCAT('%', #{version}, '%')
</if>
<if test= "mcode != null and mcode != ''" >
and mcode like CONCAT('%', #{mcode}, '%')
and mcode like CONCAT('%', #{mcode}, '%')
</if>
<if test= "code != null and code != ''" >
and aircode like CONCAT('%', #{code}, '%')
and aircode like CONCAT('%', #{code}, '%')
</if>
<if test= "startDate != null and startDate != ''" >
and applicant_time > = #{startDate}
and applicant_time > = #{startDate}
</if>
<if test= "endDate != null and endDate != ''" >
and applicant_time < = #{endDate}
@ -455,19 +454,19 @@
</if>
<if test= "mname != null and mname != ''" >
and mname like CONCAT('%', #{mname}, '%')
and mname like CONCAT('%', #{mname}, '%')
</if>
<if test= "version != null and version != ''" >
and mversion like CONCAT('%', #{version}, '%')
and mversion like CONCAT('%', #{version}, '%')
</if>
<if test= "mcode != null and mcode != ''" >
and mcode like CONCAT('%', #{mcode}, '%')
and mcode like CONCAT('%', #{mcode}, '%')
</if>
<if test= "code != null and code != ''" >
and aircode like CONCAT('%', #{code}, '%')
and aircode like CONCAT('%', #{code}, '%')
</if>
<if test= "startDate != null and startDate != ''" >
and applicant_time > = #{startDate}
and applicant_time > = #{startDate}
</if>
<if test= "endDate != null and endDate != ''" >
and applicant_time < = #{endDate}
@ -626,14 +625,14 @@
</select>
<select id= "findApplicationOutRecordPByUser" parameterType= "map" resultMap= "applicationOutRecord" >
<select id= "findApplicationOutRecordPByUser" parameterType= "map" resultMap= "applicationOutRecord" >
select
<include refid= "ApplicationOutRecordInfo" />
from applicationOutRecordInfo
where 1 = 1
<if test= "depositoryIdList != null" >
and ( depositoryId
in
in
<foreach collection= "depositoryIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
#{id}
</foreach>
@ -660,10 +659,10 @@
and aorcode = #{code}
</if>
<if test= "startDate != null and startDate != ''" >
and applicantTime > = #{startDate}
and applicantTime > = #{startDate}
</if>
<if test= "endDate != null and endDate != ''" >
and applicantTime < = #{endDate}
and applicantTime < = #{endDate}
</if>
<if test= "adminorgid != null and adminorgid != ''" >
and adminorgid = #{adminorgid}
@ -712,10 +711,10 @@
and aorcode = #{code}
</if>
<if test= "startDate != null and startDate != ''" >
and applicantTime > = #{startDate}
and applicantTime > = #{startDate}
</if>
<if test= "endDate != null and endDate != ''" >
and applicantTime < = #{endDate}
and applicantTime < = #{endDate}
</if>
<if test= "adminorgid != null and adminorgid != ''" >
and adminorgid = #{adminorgid}
@ -736,7 +735,7 @@
select
<include refid= "ApplicationInRecordInfo" />
from applicationInRecordInfo
where 1 = 1
where 1 = 1
and airid in
<foreach collection= "list" index= "index" item= "id" open= "(" separator= "," close= ")" >
#{id}
@ -744,13 +743,11 @@
</select>
<select id= "findApplicationInRecordPByDepositoryList" resultMap= "applicationInRecord" parameterType= "list" >
select
<include refid= "ApplicationInRecordInfo" />
from applicationInRecordInfo
where 1 = 1
where 1 = 1
and airapproverPass in (1,4)
and did in
<foreach collection= "list" index= "index" item= "depositoryId" open= "(" separator= "," close= ")" >
@ -760,13 +757,11 @@
</select>
<select id= "findApplicationInRecordPForAPeriodOfTime" resultMap= "applicationInRecord" >
select
<include refid= "ApplicationInRecordInfo" />
from applicationInRecordInfo
where 1 = 1
where 1 = 1
and airapproverPass in (1,4)
and applicant_time between #{start} and #{end}
<if test= "list != null" >
@ -790,7 +785,7 @@
<include refid= "ApplicationOutRecordInfo" />
from applicationOutRecordInfo
where 1 = 1
and applicantTime between #{start} and #{end}
and applicantTime between #{start} and #{end}
<if test= "list != null" >
and depositoryId in
<foreach collection= "list" index= "index" item= "depositoryId" open= "(" separator= "," close= ")" >
@ -813,7 +808,7 @@
select
<include refid= "ApplicationOutRecordInfo" />
from applicationOutRecordInfo
where 1 = 1
where 1 = 1
and aorid in
<foreach collection= "list" index= "index" item= "id" open= "(" separator= "," close= ")" >
#{id}
@ -822,7 +817,6 @@
</select>
<select id= "findApplicationOutByCode" parameterType= "string" resultMap= "applicationOutRecord" >
select
<include refid= "ApplicationOutRecordInfo" />
@ -1048,28 +1042,28 @@
<!-- 插入一条入库记录 -->
<insert id= "insertApplicationInRecord" parameterType= "map" useGeneratedKeys= "true" keyProperty= "id" >
insert into application_in_record (id,mid,quantity,price,applicant_id,applicant_time,depository_id,code,applyRemark,unit,flagForGroup,placeId,approverPass,approverTime,approverId,state,approverMessage,mproducedDate,toGroupId)
values(
#{id},
#{m id},
#{quantity },
#{price },
#{applicantId },
#{applicant_time },
#{depositoryId },
#{co de},
#{applyRemark },
#{unit },
#{flagForGroup },
#{placeId },
#{approverPass },
#{approverTime },
#{approverId },
#{state },
#{approverMessag e},
#{producedDat e},
#{toGroupId}
)
insert into application_in_record (id, mid, quantity, price, applicant_id, applicant_time, depository_id, code,
applyRemark, unit, flagForGroup, placeId, approverPass, approverTime,
approverId, state, approverMessage, mproducedDate, toGroupId)
values (#{ id},
#{mid },
#{quantity },
#{price },
#{applicantId },
#{applicant_time },
#{depositoryId },
#{code },
#{applyRemark },
#{unit },
#{flagForGroup },
#{placeId },
#{approverPass },
#{approverTime },
#{approverId },
#{stat e},
#{approverMessag e},
#{producedDate},
#{toGroupId} )
</insert>
<!-- 插入一条出库记录 -->
@ -1078,7 +1072,7 @@
(id,applicant_id,applicant_time,code,depository_id,price,quantity,departmenthead,departmenthead_pass,departmenthead_time,
departmenthead_messgae,depository_manager,depository_manager_pass,depository_manager_time,
depository_manager_message,apply_remark,state,istransfer,placeId,pass,constructionunitid,
adminorgid,outType,abstract,flagForOpenDepository)
adminorgid,outType,abstract,flagForOpenDepository,createUid,flagForAgency )
values(
#{id},
#{applicantId},
@ -1125,27 +1119,28 @@
#{adminorgId},
#{outType},
#{abstract},
#{flagForOpenDepository}
#{flagForOpenDepository},
#{createUid},
#{flagForAgency}
)
</insert>
<!-- 插入一条出库子订单 -->
<insert id= "insertApplicationOutRecordMin" parameterType= "map" useGeneratedKeys= "true" keyProperty= "id" >
insert into application_out_record_min (id,mid,quantity,code,depositoryId,placeId,checkId,parentId,transferId,trueOut,unit,project)
values(
#{id},
#{mid},
#{quantity},
#{code},
#{depositoryId},
#{placeId},
#{checkId},
#{parentId},
#{transferId},
#{trueOut},
#{unit},
#{project}
)
insert into application_out_record_min (id, mid, quantity, code, depositoryId, placeId, checkId, parentId,
transferId, trueOut, unit, project)
values (#{id},
#{mid},
#{quantity},
#{code},
#{depositoryId},
#{placeId},
#{checkId},
#{parentId},
#{transferId},
#{trueOut},
#{unit},
#{project})
</insert>
<!-- 查找子订单 -->
@ -1406,8 +1401,8 @@
<if test= "parentId != null " >
parentId = #{parentId},
</if>
<if test= "project != null " >
project = #{project},
<if test= "project != null " >
project = #{project},
</if>
<if test= "trueOut != null" >
trueOut = #{trueOut}
@ -1594,7 +1589,9 @@
<!-- 根据主键删除数据 -->
<delete id= "deleteDepositoryRecordById" parameterType= "integer" >
DELETE FROM depository_record WHERE id = #{id}
DELETE
FROM depository_record
WHERE id = #{id}
</delete>
<!-- 根据主键批量删除数据 -->
@ -1747,20 +1744,18 @@
<select id= "findWarehouseRecord" parameterType= "map" resultType= "int" >
select
count(*)
from
depository_record dr
where
dr.state like '%已%'
select count(*)
from depository_record dr
where dr.state like '%已%'
and dr.check_time between #{start} and #{end}
</select>
<!-- 根据主键删除数据 -->
<delete id= "deleteApplicationInRecordById" parameterType= "integer" >
DELETE FROM application_in_record WHERE id = #{id}
DELETE
FROM application_in_record
WHERE id = #{id}
</delete>
<!-- 根据主键批量删除数据 -->
@ -1773,7 +1768,9 @@
<!-- 根据主键删除数据 -->
<delete id= "deleteApplicationOutRecordById" parameterType= "integer" >
DELETE FROM application_out_record WHERE id = #{id}
DELETE
FROM application_out_record
WHERE id = #{id}
</delete>
<!-- 根据主键批量删除数据 -->
@ -1785,7 +1782,9 @@
</delete>
<delete id= "deleteApplicationOutRecordMinById" >
delete from application_out_record_min where parentId = #{id}
delete
from application_out_record_min
where parentId = #{id}
</delete>
<delete id= "deleteApplicationOutRecordMinByIds" parameterType= "list" >