|
|
|
@ -6,112 +6,113 @@ |
|
|
|
<!-- This code was generated by TableGo tools, mark 1 begin. --> |
|
|
|
<!-- 字段映射 --> |
|
|
|
<resultMap id="simpleDepositoryRecordMap" type="com.dreamchaser.depository_manage.entity.SimpleDepositoryRecord"> |
|
|
|
<id column="id" property="id" jdbcType="INTEGER" /> |
|
|
|
<result column="type" property="type" jdbcType="INTEGER" /> |
|
|
|
<result column="applicant_id" property="applicantId" jdbcType="INTEGER" /> |
|
|
|
<result column="apply_remark" property="applyRemark" jdbcType="VARCHAR" /> |
|
|
|
<result column="apply_time" property="applyTime" jdbcType="INTEGER" /> |
|
|
|
<id column="id" property="id" jdbcType="INTEGER"/> |
|
|
|
<result column="type" property="type" jdbcType="INTEGER"/> |
|
|
|
<result column="applicant_id" property="applicantId" jdbcType="INTEGER"/> |
|
|
|
<result column="apply_remark" property="applyRemark" jdbcType="VARCHAR"/> |
|
|
|
<result column="apply_time" property="applyTime" jdbcType="INTEGER"/> |
|
|
|
</resultMap> |
|
|
|
<!-- 字段映射 --> |
|
|
|
<resultMap id="simpleApplicationOutRecordMap" type="com.dreamchaser.depository_manage.entity.SimpleApplicationOutRecord"> |
|
|
|
<resultMap id="simpleApplicationOutRecordMap" |
|
|
|
type="com.dreamchaser.depository_manage.entity.SimpleApplicationOutRecord"> |
|
|
|
<id property="id" column="aorid" jdbcType="INTEGER"/> |
|
|
|
<result column="applicantId" property="applicantId" jdbcType="INTEGER" /> |
|
|
|
<result column="applicantTime" property="applicantTime" jdbcType="INTEGER" /> |
|
|
|
<result column="applyRemark" property="applyRemark" jdbcType="VARCHAR" /> |
|
|
|
<result column="applicantId" property="applicantId" jdbcType="INTEGER"/> |
|
|
|
<result column="applicantTime" property="applicantTime" jdbcType="INTEGER"/> |
|
|
|
<result column="applyRemark" property="applyRemark" jdbcType="VARCHAR"/> |
|
|
|
</resultMap> |
|
|
|
<!-- 字段映射 --> |
|
|
|
<resultMap id="depositoryRecordMap" type="com.dreamchaser.depository_manage.entity.DepositoryRecord"> |
|
|
|
<id column="id" property="id" jdbcType="INTEGER" /> |
|
|
|
<result column="application_id" property="applicationId" jdbcType="INTEGER" /> |
|
|
|
<result column="mname" property="mname" jdbcType="VARCHAR" /> |
|
|
|
<result column="depository_id" property="depositoryId" jdbcType="INTEGER" /> |
|
|
|
<result column="type" property="type" jdbcType="INTEGER" /> |
|
|
|
<result column="quantity" property="quantity" jdbcType="INTEGER" /> |
|
|
|
<result column="price" property="price" jdbcType="VARCHAR" /> |
|
|
|
<result column="state" property="state" jdbcType="VARCHAR" /> |
|
|
|
<result column="applicant_id" property="applicantId" jdbcType="INTEGER" /> |
|
|
|
<result column="apply_remark" property="applyRemark" jdbcType="VARCHAR" /> |
|
|
|
<result column="apply_time" property="applyTime" jdbcType="INTEGER" /> |
|
|
|
<result column="reviewer_id" property="reviewerId" jdbcType="INTEGER" /> |
|
|
|
<result column="review_remark" property="reviewRemark" jdbcType="VARCHAR" /> |
|
|
|
<result column="review_time" property="reviewTime" jdbcType="INTEGER" /> |
|
|
|
<result column="review_pass" property="reviewPass" jdbcType="INTEGER" /> |
|
|
|
<result column="checker_id" property="checkerId" jdbcType="INTEGER" /> |
|
|
|
<result column="check_remark" property="checkRemark" jdbcType="VARCHAR" /> |
|
|
|
<result column="check_time" property="checkTime" jdbcType="INTEGER" /> |
|
|
|
<result column="check_pass" property="checkPass" jdbcType="INTEGER" /> |
|
|
|
<result column="oldId" property="oldId" jdbcType="VARCHAR" /> |
|
|
|
<id column="id" property="id" jdbcType="INTEGER"/> |
|
|
|
<result column="application_id" property="applicationId" jdbcType="INTEGER"/> |
|
|
|
<result column="mname" property="mname" jdbcType="VARCHAR"/> |
|
|
|
<result column="depository_id" property="depositoryId" jdbcType="INTEGER"/> |
|
|
|
<result column="type" property="type" jdbcType="INTEGER"/> |
|
|
|
<result column="quantity" property="quantity" jdbcType="INTEGER"/> |
|
|
|
<result column="price" property="price" jdbcType="VARCHAR"/> |
|
|
|
<result column="state" property="state" jdbcType="VARCHAR"/> |
|
|
|
<result column="applicant_id" property="applicantId" jdbcType="INTEGER"/> |
|
|
|
<result column="apply_remark" property="applyRemark" jdbcType="VARCHAR"/> |
|
|
|
<result column="apply_time" property="applyTime" jdbcType="INTEGER"/> |
|
|
|
<result column="reviewer_id" property="reviewerId" jdbcType="INTEGER"/> |
|
|
|
<result column="review_remark" property="reviewRemark" jdbcType="VARCHAR"/> |
|
|
|
<result column="review_time" property="reviewTime" jdbcType="INTEGER"/> |
|
|
|
<result column="review_pass" property="reviewPass" jdbcType="INTEGER"/> |
|
|
|
<result column="checker_id" property="checkerId" jdbcType="INTEGER"/> |
|
|
|
<result column="check_remark" property="checkRemark" jdbcType="VARCHAR"/> |
|
|
|
<result column="check_time" property="checkTime" jdbcType="INTEGER"/> |
|
|
|
<result column="check_pass" property="checkPass" jdbcType="INTEGER"/> |
|
|
|
<result column="oldId" property="oldId" jdbcType="VARCHAR"/> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<!-- 插入入库记录--> |
|
|
|
<!-- 插入入库记录--> |
|
|
|
<resultMap id="applicationInRecord" type="com.dreamchaser.depository_manage.pojo.ApplicationInRecordP"> |
|
|
|
<id column="airid" property="id" jdbcType="INTEGER" /> |
|
|
|
<result column="mname" property="mname" jdbcType="VARCHAR" /> |
|
|
|
<result column="quantity" property="quantity" jdbcType="INTEGER" /> |
|
|
|
<result column="mid" property="mid" jdbcType="INTEGER" /> |
|
|
|
<result column="flagForGroup" property="flagForGroup" jdbcType="INTEGER" /> |
|
|
|
<result column="price" property="price" jdbcType="VARCHAR" /> |
|
|
|
<result column="tname" property="materialTypeName" jdbcType="VARCHAR" /> |
|
|
|
<result column="applicantTime" property="applicant_time" jdbcType="INTEGER" /> |
|
|
|
<result column="airPlaceId" property="placeId" jdbcType="INTEGER" /> |
|
|
|
<result column="code" property="aircode" jdbcType="VARCHAR" /> |
|
|
|
<result column="dname" property="depositoryName" jdbcType="VARCHAR" /> |
|
|
|
<result column="applicant_id" property="applicantId" jdbcType="INTEGER" /> |
|
|
|
<result column="applyRemark" property="applyRemark" jdbcType="INTEGER" /> |
|
|
|
<result column="aircode" property="aircode" jdbcType="VARCHAR" /> |
|
|
|
<result column="mcode" property="mcode" jdbcType="VARCHAR" /> |
|
|
|
<result column="mversion" property="mversion" jdbcType="VARCHAR" /> |
|
|
|
<result column="munit" property="munit" jdbcType="VARCHAR" /> |
|
|
|
<result column="mtexture" property="mtexture" jdbcType="VARCHAR" /> |
|
|
|
<result column="mkingdeecode" property="mkingdeecode" jdbcType="VARCHAR" /> |
|
|
|
<result column="mdepositoryCode" property="mdepositoryCode" jdbcType="VARCHAR" /> |
|
|
|
<result column="airUnit" property="airUnit" jdbcType="VARCHAR" /> |
|
|
|
<id column="airid" property="id" jdbcType="INTEGER"/> |
|
|
|
<result column="mname" property="mname" jdbcType="VARCHAR"/> |
|
|
|
<result column="quantity" property="quantity" jdbcType="INTEGER"/> |
|
|
|
<result column="mid" property="mid" jdbcType="INTEGER"/> |
|
|
|
<result column="flagForGroup" property="flagForGroup" jdbcType="INTEGER"/> |
|
|
|
<result column="price" property="price" jdbcType="VARCHAR"/> |
|
|
|
<result column="tname" property="materialTypeName" jdbcType="VARCHAR"/> |
|
|
|
<result column="applicantTime" property="applicant_time" jdbcType="INTEGER"/> |
|
|
|
<result column="airPlaceId" property="placeId" jdbcType="INTEGER"/> |
|
|
|
<result column="code" property="aircode" jdbcType="VARCHAR"/> |
|
|
|
<result column="dname" property="depositoryName" jdbcType="VARCHAR"/> |
|
|
|
<result column="applicant_id" property="applicantId" jdbcType="INTEGER"/> |
|
|
|
<result column="applyRemark" property="applyRemark" jdbcType="INTEGER"/> |
|
|
|
<result column="aircode" property="aircode" jdbcType="VARCHAR"/> |
|
|
|
<result column="mcode" property="mcode" jdbcType="VARCHAR"/> |
|
|
|
<result column="mversion" property="mversion" jdbcType="VARCHAR"/> |
|
|
|
<result column="munit" property="munit" jdbcType="VARCHAR"/> |
|
|
|
<result column="mtexture" property="mtexture" jdbcType="VARCHAR"/> |
|
|
|
<result column="mkingdeecode" property="mkingdeecode" jdbcType="VARCHAR"/> |
|
|
|
<result column="mdepositoryCode" property="mdepositoryCode" jdbcType="VARCHAR"/> |
|
|
|
<result column="airUnit" property="airUnit" jdbcType="VARCHAR"/> |
|
|
|
|
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<!-- 插入出库记录--> |
|
|
|
<!-- 插入出库记录--> |
|
|
|
<resultMap id="applicationOutRecord" type="com.dreamchaser.depository_manage.pojo.ApplicationOutRecordP"> |
|
|
|
<id property="id" column="aorid" jdbcType="INTEGER"/> |
|
|
|
<result column="mid" property="mid" jdbcType="INTEGER" /> |
|
|
|
<result column="mname" property="mname" jdbcType="VARCHAR" /> |
|
|
|
<result column="depositoryId" property="depositoryId" jdbcType="INTEGER" /> |
|
|
|
<result column="dname" property="depositoryName" jdbcType="VARCHAR" /> |
|
|
|
<result column="applicantId" property="applicantId" jdbcType="INTEGER" /> |
|
|
|
<result column="applicantTime" property="applicantTime" jdbcType="INTEGER" /> |
|
|
|
<result column="applyRemark" property="applyRemark" jdbcType="VARCHAR" /> |
|
|
|
<result column="aorcode" property="code" jdbcType="VARCHAR" /> |
|
|
|
<result column="aorpirce" property="price" jdbcType="INTEGER" /> |
|
|
|
<result column="aorquantity" property="quantity" jdbcType="INTEGER" /> |
|
|
|
<result column="departmenthead" property="departmenthead" jdbcType="VARCHAR" /> |
|
|
|
<result column="departmentheadPass" property="departmentheadPass" jdbcType="INTEGER" /> |
|
|
|
<result column="departmentHeadTime" property="departmentheadTime" jdbcType="INTEGER" /> |
|
|
|
<result column="departmentheadMessage" property="departmentheadMessage" jdbcType="VARCHAR" /> |
|
|
|
<result column="depositoryManager" property="depositoryManager" jdbcType="VARCHAR" /> |
|
|
|
<result column="depositoryManagerPass" property="depositoryManagerPass" jdbcType="INTEGER" /> |
|
|
|
<result column="depositoryManagerTime" property="depositoryManagerTime" jdbcType="INTEGER" /> |
|
|
|
<result column="depositoryManagerMessage" property="depositoryManagerMessage" jdbcType="VARCHAR" /> |
|
|
|
<result column="aorstate" property="state" jdbcType="VARCHAR" /> |
|
|
|
<result column="istransfer" property="istransfer" jdbcType="INTEGER" /> |
|
|
|
<result column="mcode" property="mcode" jdbcType="VARCHAR" /> |
|
|
|
<result column="placeId" property="placeId" jdbcType="INTEGER" /> |
|
|
|
<result column="pass" property="pass" jdbcType="INTEGER" /> |
|
|
|
<result column="mid" property="mid" jdbcType="INTEGER"/> |
|
|
|
<result column="mname" property="mname" jdbcType="VARCHAR"/> |
|
|
|
<result column="depositoryId" property="depositoryId" jdbcType="INTEGER"/> |
|
|
|
<result column="dname" property="depositoryName" jdbcType="VARCHAR"/> |
|
|
|
<result column="applicantId" property="applicantId" jdbcType="INTEGER"/> |
|
|
|
<result column="applicantTime" property="applicantTime" jdbcType="INTEGER"/> |
|
|
|
<result column="applyRemark" property="applyRemark" jdbcType="VARCHAR"/> |
|
|
|
<result column="aorcode" property="code" jdbcType="VARCHAR"/> |
|
|
|
<result column="aorpirce" property="price" jdbcType="INTEGER"/> |
|
|
|
<result column="aorquantity" property="quantity" jdbcType="INTEGER"/> |
|
|
|
<result column="departmenthead" property="departmenthead" jdbcType="VARCHAR"/> |
|
|
|
<result column="departmentheadPass" property="departmentheadPass" jdbcType="INTEGER"/> |
|
|
|
<result column="departmentHeadTime" property="departmentheadTime" jdbcType="INTEGER"/> |
|
|
|
<result column="departmentheadMessage" property="departmentheadMessage" jdbcType="VARCHAR"/> |
|
|
|
<result column="depositoryManager" property="depositoryManager" jdbcType="VARCHAR"/> |
|
|
|
<result column="depositoryManagerPass" property="depositoryManagerPass" jdbcType="INTEGER"/> |
|
|
|
<result column="depositoryManagerTime" property="depositoryManagerTime" jdbcType="INTEGER"/> |
|
|
|
<result column="depositoryManagerMessage" property="depositoryManagerMessage" jdbcType="VARCHAR"/> |
|
|
|
<result column="aorstate" property="state" jdbcType="VARCHAR"/> |
|
|
|
<result column="istransfer" property="istransfer" jdbcType="INTEGER"/> |
|
|
|
<result column="mcode" property="mcode" jdbcType="VARCHAR"/> |
|
|
|
<result column="placeId" property="placeId" jdbcType="INTEGER"/> |
|
|
|
<result column="pass" property="pass" jdbcType="INTEGER"/> |
|
|
|
<result column="aormUnit" property="unit" jdbcType="VARCHAR"/> |
|
|
|
|
|
|
|
</resultMap> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 出库子订单--> |
|
|
|
<!-- 出库子订单--> |
|
|
|
<resultMap id="applicationOutRecordMin" type="com.dreamchaser.depository_manage.entity.ApplicationOutRecordMin"> |
|
|
|
<id property="id" column="id" jdbcType="INTEGER"/> |
|
|
|
<result column="mid" property="mid" jdbcType="INTEGER" /> |
|
|
|
<result column="depositoryId" property="depositoryId" jdbcType="INTEGER" /> |
|
|
|
<result column="placeId" property="placeId" jdbcType="INTEGER" /> |
|
|
|
<result column="quantity" property="quantity" jdbcType="INTEGER" /> |
|
|
|
<result column="checkId" property="checkId" jdbcType="INTEGER" /> |
|
|
|
<result column="parentId" property="parentId" jdbcType="INTEGER" /> |
|
|
|
<result column="code" property="code" jdbcType="VARCHAR" /> |
|
|
|
<result column="transferId" property="transferId" jdbcType="INTEGER" /> |
|
|
|
<result column="unit" property="unit" jdbcType="VARCHAR" /> |
|
|
|
<result column="mid" property="mid" jdbcType="INTEGER"/> |
|
|
|
<result column="depositoryId" property="depositoryId" jdbcType="INTEGER"/> |
|
|
|
<result column="placeId" property="placeId" jdbcType="INTEGER"/> |
|
|
|
<result column="quantity" property="quantity" jdbcType="INTEGER"/> |
|
|
|
<result column="checkId" property="checkId" jdbcType="INTEGER"/> |
|
|
|
<result column="parentId" property="parentId" jdbcType="INTEGER"/> |
|
|
|
<result column="code" property="code" jdbcType="VARCHAR"/> |
|
|
|
<result column="transferId" property="transferId" jdbcType="INTEGER"/> |
|
|
|
<result column="unit" property="unit" jdbcType="VARCHAR"/> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<!-- 表查询字段 --> |
|
|
|
@ -177,8 +178,8 @@ |
|
|
|
count(*) |
|
|
|
FROM applicationOutRecordInfo WHERE 1=1 |
|
|
|
<if test='isDone == "0"'> |
|
|
|
and (departmentHeadTime = 0 and FIND_IN_SET(#{userId},departmenthead) != 0 and DepartmentheadPass != 2) |
|
|
|
or (depositoryManagerTime = 0 and FIND_IN_SET(#{userId},depositoryManager) != 0 and DepartmentheadPass != 2) |
|
|
|
and (departmentHeadTime = 0 and FIND_IN_SET(#{userId},departmenthead) != 0 and DepartmentheadPass != 2) |
|
|
|
or (depositoryManagerTime = 0 and FIND_IN_SET(#{userId},depositoryManager) != 0 and DepartmentheadPass != 2) |
|
|
|
</if> |
|
|
|
<if test='isDone == "1"'> |
|
|
|
and (departmentHeadTime != 0 and FIND_IN_SET(#{userId},departmenthead) != 0) |
|
|
|
@ -249,13 +250,13 @@ |
|
|
|
<!-- 查询所有数据 --> |
|
|
|
<select id="findDepositoryRecordAll" resultMap="depositoryRecordMap"> |
|
|
|
SELECT |
|
|
|
<include refid="allColumns" /> |
|
|
|
<include refid="allColumns"/> |
|
|
|
FROM depository_record dr |
|
|
|
</select> |
|
|
|
<!-- 根据id查询数据 --> |
|
|
|
<select id="findDepositoryRecordById" resultMap="depositoryRecordMap" parameterType="integer"> |
|
|
|
SELECT |
|
|
|
<include refid="allColumns" /> |
|
|
|
<include refid="allColumns"/> |
|
|
|
FROM depository_record dr |
|
|
|
where dr.id=#{id} |
|
|
|
</select> |
|
|
|
@ -263,7 +264,7 @@ |
|
|
|
<!-- 根据isDone来寻找完成任务或者未完成任务 --> |
|
|
|
<select id="findMyTask" resultMap="simpleDepositoryRecordMap" parameterType="map"> |
|
|
|
SELECT |
|
|
|
<include refid="simpleColumns" /> |
|
|
|
<include refid="simpleColumns"/> |
|
|
|
FROM depository_record dr WHERE 1=1 |
|
|
|
<if test='isDone == "0"'> |
|
|
|
and (dr.review_time = 0 and dr.reviewer_id =#{userId}) |
|
|
|
@ -281,15 +282,17 @@ |
|
|
|
<!-- 根据isDone来寻找完成任务或者未完成任务 --> |
|
|
|
<select id="findMyTaskOut" resultMap="simpleApplicationOutRecordMap" parameterType="map"> |
|
|
|
SELECT |
|
|
|
<include refid="simpleApplicationOut" /> |
|
|
|
<include refid="simpleApplicationOut"/> |
|
|
|
FROM applicationOutRecordInfo WHERE 1=1 |
|
|
|
<if test='isDone == "0"'> |
|
|
|
and (departmentHeadTime = 0 and FIND_IN_SET(#{userId},departmenthead) != 0 and DepartmentheadPass = 3) |
|
|
|
or (depositoryManagerTime = 0 and FIND_IN_SET(#{userId},depositoryManager) != 0 and depositoryManagerPass = 3) |
|
|
|
and (departmentHeadTime = 0 and FIND_IN_SET(#{userId},departmenthead) != 0 and DepartmentheadPass = 3) |
|
|
|
or (depositoryManagerTime = 0 and FIND_IN_SET(#{userId},depositoryManager) != 0 and depositoryManagerPass = |
|
|
|
3) |
|
|
|
</if> |
|
|
|
<if test='isDone == "1"'> |
|
|
|
and (departmentHeadTime != 0 and FIND_IN_SET(#{userId},departmenthead) != 0 and DepartmentheadPass != 3) |
|
|
|
or (depositoryManagerTime != 0 and FIND_IN_SET(#{userId},depositoryManager) != 0 and depositoryManagerPass != 3) |
|
|
|
or (depositoryManagerTime != 0 and FIND_IN_SET(#{userId},depositoryManager) != 0 and depositoryManagerPass |
|
|
|
!= 3) |
|
|
|
</if> |
|
|
|
group by aorid |
|
|
|
ORDER BY applicantTime desc |
|
|
|
@ -310,23 +313,74 @@ |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<!--根据条件查询入库记录--> |
|
|
|
|
|
|
|
<select id="findApplicationInRecordPByUser" parameterType="map" |
|
|
|
resultMap="applicationInRecord"> |
|
|
|
select |
|
|
|
<include refid="ApplicationInRecordInfo"/> |
|
|
|
from applicationInRecordInfo |
|
|
|
where 1 = 1 |
|
|
|
<if test="depositoryIdList != null"> |
|
|
|
and did in |
|
|
|
<foreach collection="depositoryIdList" index="index" item="id" open="(" separator="," close=")"> |
|
|
|
#{id} |
|
|
|
</foreach> |
|
|
|
<if test="applicantId != null and applicantId != ''"> |
|
|
|
or applicant_id = #{applicantId} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="depositoryIdList == null"> |
|
|
|
<if test="applicantId != null and applicantId != ''"> |
|
|
|
and applicant_id = #{applicantId} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
order by applicant_time desc |
|
|
|
<if test="begin != null and size != null"> |
|
|
|
LIMIT #{begin},#{size} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<select id="findApplicationInRecordPCountByUser" parameterType="map" |
|
|
|
resultType="int"> |
|
|
|
select |
|
|
|
count(*) |
|
|
|
from applicationInRecordInfo |
|
|
|
where 1 = 1 |
|
|
|
<if test="depositoryIdList != null"> |
|
|
|
and did in |
|
|
|
<foreach collection="depositoryIdList" index="index" item="id" open="(" separator="," close=")"> |
|
|
|
#{id} |
|
|
|
</foreach> |
|
|
|
<if test="applicantId != null and applicantId != ''"> |
|
|
|
or applicant_id = #{applicantId} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="depositoryIdList == null"> |
|
|
|
<if test="applicantId != null and applicantId != ''"> |
|
|
|
and applicant_id = #{applicantId} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<!--根据条件查询入库记录--> |
|
|
|
<select id="findApplicationInRecordPByCondition" parameterType="map" resultMap="applicationInRecord"> |
|
|
|
select |
|
|
|
<include refid="ApplicationInRecordInfo"/> |
|
|
|
from applicationInRecordInfo |
|
|
|
where 1 = 1 |
|
|
|
<if test="id != '' and id != null"> |
|
|
|
and airid = #{id} |
|
|
|
and airid = #{id} |
|
|
|
</if> |
|
|
|
<if test="applicantId != null and applicantId != ''"> |
|
|
|
and applicant_id = #{applicantId} |
|
|
|
</if> |
|
|
|
<if test="depositoryId != null and depositoryId != ''"> |
|
|
|
and did = #{depositoryId} |
|
|
|
and did = #{depositoryId} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="mid != null and mid != ''"> |
|
|
|
and mid = #{mid} |
|
|
|
and mid = #{mid} |
|
|
|
</if> |
|
|
|
<if test="applicantTime != null and applicantTime != ''"> |
|
|
|
and applicant_time >= #{applicantTime} |
|
|
|
@ -350,7 +404,7 @@ |
|
|
|
from applicationOutRecordInfo |
|
|
|
where 1 = 1 and depositoryId = #{depositoryId} |
|
|
|
</select> |
|
|
|
<!--根据条件查询出库记录--> |
|
|
|
<!--根据条件查询出库记录--> |
|
|
|
<select id="findApplicationOutRecordPByCondition" parameterType="map" resultMap="applicationOutRecord"> |
|
|
|
select |
|
|
|
<include refid="ApplicationOutRecordInfo"/> |
|
|
|
@ -427,7 +481,7 @@ |
|
|
|
</if> |
|
|
|
|
|
|
|
</select> |
|
|
|
<!-- 查询所有入库记录--> |
|
|
|
<!-- 查询所有入库记录--> |
|
|
|
<select id="findApplicationInRecordPAll" resultMap="applicationInRecord"> |
|
|
|
select |
|
|
|
<include refid="ApplicationInRecordInfo"/> |
|
|
|
@ -453,7 +507,7 @@ |
|
|
|
from applicationOutRecordInfo |
|
|
|
where applicantTime between #{start} and #{end} |
|
|
|
</select> |
|
|
|
<!--根据主键查询出库记录--> |
|
|
|
<!--根据主键查询出库记录--> |
|
|
|
<select id="findApplicationOutRecordPById" parameterType="int" resultMap="applicationOutRecord"> |
|
|
|
select |
|
|
|
<include refid="ApplicationOutRecordInfo"/> |
|
|
|
@ -469,7 +523,7 @@ |
|
|
|
where aorcode = #{code} |
|
|
|
</select> |
|
|
|
|
|
|
|
<!--根据主键查询入库记录--> |
|
|
|
<!--根据主键查询入库记录--> |
|
|
|
<select id="findApplicationInRecordPById" parameterType="int" resultMap="applicationInRecord"> |
|
|
|
select |
|
|
|
<include refid="ApplicationInRecordInfo"/> |
|
|
|
@ -484,7 +538,7 @@ |
|
|
|
where aircode = #{code} |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 根据条件查询入库记录数--> |
|
|
|
<!-- 根据条件查询入库记录数--> |
|
|
|
<select id="findApplicationInRecordPCountByCondition" parameterType="map" resultType="int"> |
|
|
|
select |
|
|
|
count(*) |
|
|
|
@ -507,7 +561,7 @@ |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 根据条件查询出库记录数--> |
|
|
|
<!-- 根据条件查询出库记录数--> |
|
|
|
<select id="findApplicationOutRecordPCountByCondition" parameterType="map" resultType="int"> |
|
|
|
select |
|
|
|
count(DISTINCT aorid) |
|
|
|
@ -573,7 +627,7 @@ |
|
|
|
|
|
|
|
<select id="findDepositoryRecordByCondition" resultMap="depositoryRecordMap" parameterType="map"> |
|
|
|
SELECT |
|
|
|
<include refid="allColumnsAndUserP" /> |
|
|
|
<include refid="allColumnsAndUserP"/> |
|
|
|
FROM DepositoryRecordByCondition dr |
|
|
|
WHERE 1 = 1 |
|
|
|
<if test="applicationId != null"> |
|
|
|
@ -638,14 +692,14 @@ |
|
|
|
<!-- 根据主键查询数据 --> |
|
|
|
<select id="findDepositoryRecordByIds" resultMap="depositoryRecordMap" parameterType="list"> |
|
|
|
SELECT |
|
|
|
<include refid="allColumns" /> |
|
|
|
<include refid="allColumns"/> |
|
|
|
FROM depository_record dr WHERE dr.id IN |
|
|
|
<foreach collection="list" index="index" item="id" open="(" separator="," close=")"> |
|
|
|
#{id} |
|
|
|
</foreach> |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 插入一条入库记录--> |
|
|
|
<!-- 插入一条入库记录--> |
|
|
|
<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) |
|
|
|
values( |
|
|
|
@ -664,7 +718,7 @@ |
|
|
|
) |
|
|
|
</insert> |
|
|
|
|
|
|
|
<!-- 插入一条出库记录--> |
|
|
|
<!-- 插入一条出库记录--> |
|
|
|
<insert id="insertApplicationOutRecord" parameterType="map" useGeneratedKeys="true" keyProperty="id"> |
|
|
|
insert into application_out_record |
|
|
|
(id,applicant_id,applicant_time,code,price,quantity,departmenthead,departmenthead_pass,departmenthead_time, |
|
|
|
@ -713,7 +767,7 @@ |
|
|
|
) |
|
|
|
</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) |
|
|
|
values( |
|
|
|
@ -731,13 +785,13 @@ |
|
|
|
) |
|
|
|
</insert> |
|
|
|
|
|
|
|
<!-- 查找子订单--> |
|
|
|
<!-- 查找子订单--> |
|
|
|
<select id="findApplicationOutMinById" parameterType="int" resultMap="applicationOutRecordMin"> |
|
|
|
select |
|
|
|
<include refid="ApplicationOutRecordMinInfo" /> |
|
|
|
from application_out_record_min as aorm |
|
|
|
where 1 = 1 |
|
|
|
and aorm.id = #{id} |
|
|
|
select |
|
|
|
<include refid="ApplicationOutRecordMinInfo"/> |
|
|
|
from application_out_record_min as aorm |
|
|
|
where 1 = 1 |
|
|
|
and aorm.id = #{id} |
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
@ -745,19 +799,19 @@ |
|
|
|
<!-- 查找子订单--> |
|
|
|
<select id="findApplicationOutMinByIds" parameterType="list" resultMap="applicationOutRecordMin"> |
|
|
|
select |
|
|
|
<include refid="ApplicationOutRecordMinInfo" /> |
|
|
|
<include refid="ApplicationOutRecordMinInfo"/> |
|
|
|
from application_out_record_min as aorm |
|
|
|
where 1 = 1 |
|
|
|
and aorm.id in |
|
|
|
<foreach collection="list" index="index" item="id" open="(" separator="," close=")"> |
|
|
|
#{id} |
|
|
|
#{id} |
|
|
|
</foreach> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<select id="findApplicationOutMinByCondition" parameterType="int" resultMap="applicationOutRecordMin"> |
|
|
|
select |
|
|
|
<include refid="ApplicationOutRecordMinInfo" /> |
|
|
|
<include refid="ApplicationOutRecordMinInfo"/> |
|
|
|
from application_out_record_min as aorm |
|
|
|
where 1 = 1 |
|
|
|
<if test="id != null and id != ''"> |
|
|
|
@ -792,46 +846,46 @@ |
|
|
|
|
|
|
|
<select id="findApplicationOutRecordMinByParent" parameterType="int" resultMap="applicationOutRecordMin"> |
|
|
|
select |
|
|
|
<include refid="ApplicationOutRecordMinInfo" /> |
|
|
|
<include refid="ApplicationOutRecordMinInfo"/> |
|
|
|
from application_out_record_min as aorm |
|
|
|
where 1 = 1 |
|
|
|
and aorm.parentId = #{parentId} |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="findApplicationOutMinForComplete" resultMap="applicationOutRecordMin" parameterType="map"> |
|
|
|
<select id="findApplicationOutMinForComplete" resultMap="applicationOutRecordMin" parameterType="map"> |
|
|
|
select |
|
|
|
<include refid="ApplicationOutRecordMinInfo" /> |
|
|
|
<include refid="ApplicationOutRecordMinInfo"/> |
|
|
|
from application_out_record_min aorm left join application_out_record aor on aorm.parentId = aor.id |
|
|
|
where 1 = 1 |
|
|
|
and aor.pass = 1 and aor.applicant_time between #{start} and #{end} |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 插入数据 --> |
|
|
|
<insert id="insertDepositoryRecord" parameterType="map" useGeneratedKeys="true" keyProperty="id"> |
|
|
|
INSERT INTO depository_record ( |
|
|
|
id, application_id, mname, depository_id, type, quantity, price, state, |
|
|
|
applicant_id, apply_remark, apply_time, |
|
|
|
reviewer_id, review_remark, review_time,review_pass, checker_id, check_remark, |
|
|
|
check_time,check_pass,oldId |
|
|
|
id, application_id, mname, depository_id, type, quantity, price, state, |
|
|
|
applicant_id, apply_remark, apply_time, |
|
|
|
reviewer_id, review_remark, review_time,review_pass, checker_id, check_remark, |
|
|
|
check_time,check_pass,oldId |
|
|
|
) VALUES ( |
|
|
|
#{id}, |
|
|
|
#{applicationId}, |
|
|
|
#{mname}, |
|
|
|
#{depositoryId}, |
|
|
|
#{type}, |
|
|
|
#{quantity}, |
|
|
|
#{price}, |
|
|
|
#{state}, |
|
|
|
#{applicantId}, |
|
|
|
#{applyRemark}, |
|
|
|
<if test="applyTime == null"> |
|
|
|
0, |
|
|
|
</if> |
|
|
|
<if test="applyTime != null"> |
|
|
|
#{applyTime}, |
|
|
|
</if> |
|
|
|
#{reviewerId}, |
|
|
|
#{reviewRemark}, |
|
|
|
#{id}, |
|
|
|
#{applicationId}, |
|
|
|
#{mname}, |
|
|
|
#{depositoryId}, |
|
|
|
#{type}, |
|
|
|
#{quantity}, |
|
|
|
#{price}, |
|
|
|
#{state}, |
|
|
|
#{applicantId}, |
|
|
|
#{applyRemark}, |
|
|
|
<if test="applyTime == null"> |
|
|
|
0, |
|
|
|
</if> |
|
|
|
<if test="applyTime != null"> |
|
|
|
#{applyTime}, |
|
|
|
</if> |
|
|
|
#{reviewerId}, |
|
|
|
#{reviewRemark}, |
|
|
|
|
|
|
|
|
|
|
|
<if test="reviewTime == null"> |
|
|
|
@ -840,52 +894,53 @@ |
|
|
|
<if test="reviewTime != null"> |
|
|
|
#{reviewTime}, |
|
|
|
</if> |
|
|
|
#{reviewPass}, |
|
|
|
#{checkerId}, |
|
|
|
#{checkRemark}, |
|
|
|
#{reviewPass}, |
|
|
|
#{checkerId}, |
|
|
|
#{checkRemark}, |
|
|
|
<if test="checkTime == null"> |
|
|
|
0, |
|
|
|
</if> |
|
|
|
<if test="checkTime != null"> |
|
|
|
#{checkTime}, |
|
|
|
</if> |
|
|
|
#{checkPass}, |
|
|
|
#{checkPass}, |
|
|
|
#{oldId} |
|
|
|
) |
|
|
|
</insert> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 批量插入数据 --> |
|
|
|
<insert id="insertDepositoryRecords" parameterType="list"> |
|
|
|
INSERT INTO depository_record ( |
|
|
|
id, application_id, mname, depository_id, type, quantity, price, state, |
|
|
|
applicant_id, apply_remark, apply_time, reviewer_id, review_remark, review_time,review_pass, checker_id, check_remark, |
|
|
|
applicant_id, apply_remark, apply_time, reviewer_id, review_remark, review_time,review_pass, checker_id, |
|
|
|
check_remark, |
|
|
|
check_time,check_pass |
|
|
|
) VALUES |
|
|
|
<foreach collection="list" index="index" item="item" separator=","> |
|
|
|
( |
|
|
|
#{id}, |
|
|
|
#{applicationId}, |
|
|
|
#{mname}, |
|
|
|
#{depositoryId}, |
|
|
|
#{type}, |
|
|
|
#{quantity}, |
|
|
|
#{price}, |
|
|
|
#{state}, |
|
|
|
#{applicantId}, |
|
|
|
#{applyRemark}, |
|
|
|
#{applyTime}, |
|
|
|
#{reviewerId}, |
|
|
|
#{reviewRemark}, |
|
|
|
#{reviewTime}, |
|
|
|
#{reviewPass}, |
|
|
|
#{checkerId}, |
|
|
|
#{checkRemark}, |
|
|
|
#{checkTime}, |
|
|
|
#{checkPass} |
|
|
|
#{id}, |
|
|
|
#{applicationId}, |
|
|
|
#{mname}, |
|
|
|
#{depositoryId}, |
|
|
|
#{type}, |
|
|
|
#{quantity}, |
|
|
|
#{price}, |
|
|
|
#{state}, |
|
|
|
#{applicantId}, |
|
|
|
#{applyRemark}, |
|
|
|
#{applyTime}, |
|
|
|
#{reviewerId}, |
|
|
|
#{reviewRemark}, |
|
|
|
#{reviewTime}, |
|
|
|
#{reviewPass}, |
|
|
|
#{checkerId}, |
|
|
|
#{checkRemark}, |
|
|
|
#{checkTime}, |
|
|
|
#{checkPass} |
|
|
|
) |
|
|
|
</foreach> |
|
|
|
</insert> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 修改数据 --> |
|
|
|
<update id="updateDepositoryRecord" parameterType="map"> |
|
|
|
UPDATE depository_record |
|
|
|
@ -948,7 +1003,7 @@ |
|
|
|
WHERE id = #{id} |
|
|
|
</update> |
|
|
|
|
|
|
|
<!-- 修改子单--> |
|
|
|
<!-- 修改子单--> |
|
|
|
<update id="updateApplicationOutRecordMin"> |
|
|
|
update application_out_record_min |
|
|
|
<set> |
|
|
|
@ -982,7 +1037,7 @@ |
|
|
|
</set> |
|
|
|
</update> |
|
|
|
|
|
|
|
<!-- 修改数据--> |
|
|
|
<!-- 修改数据--> |
|
|
|
<update id="updateApplicationOutRecord" parameterType="map"> |
|
|
|
UPDATE application_out_record |
|
|
|
<set> |
|
|
|
@ -1014,10 +1069,10 @@ |
|
|
|
departmenthead_pass = #{departmentheadPass}, |
|
|
|
</if> |
|
|
|
<if test="departmentheadTime != null and departmentheadTime != ''"> |
|
|
|
departmenthead_time = #{departmentheadTime}, |
|
|
|
departmenthead_time = #{departmentheadTime}, |
|
|
|
</if> |
|
|
|
<if test="departmentheadMessage != null and departmentheadMessage != ''"> |
|
|
|
departmenthead_messgae = #{departmentheadMessage}, |
|
|
|
departmenthead_messgae = #{departmentheadMessage}, |
|
|
|
</if> |
|
|
|
<if test="depositoryManager != null and depositoryManager != ''"> |
|
|
|
depository_manager = #{depositoryManager}, |
|
|
|
@ -1106,12 +1161,12 @@ |
|
|
|
WHERE id = #{item.id} |
|
|
|
</foreach> |
|
|
|
</update> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 根据主键删除数据 --> |
|
|
|
<delete id="deleteDepositoryRecordById" parameterType="integer"> |
|
|
|
DELETE FROM depository_record WHERE id = #{id} |
|
|
|
</delete> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 根据主键批量删除数据 --> |
|
|
|
<delete id="deleteDepositoryRecordByIds" parameterType="list"> |
|
|
|
DELETE FROM depository_record WHERE id IN |
|
|
|
@ -1120,14 +1175,14 @@ |
|
|
|
</foreach> |
|
|
|
</delete> |
|
|
|
|
|
|
|
<!--获取一段时间内的库存额度--> |
|
|
|
<!--获取一段时间内的库存额度--> |
|
|
|
<select id="findDepositoryRecordByDate" parameterType="map" resultType="double"> |
|
|
|
SELECT |
|
|
|
ifnull(sum(quantity),0) |
|
|
|
FROM DepositoryRecordByDate |
|
|
|
where 1 = 1 |
|
|
|
<if test="type != null"> |
|
|
|
and type = #{type} |
|
|
|
and type = #{type} |
|
|
|
</if> |
|
|
|
<if test="depositoryId != null"> |
|
|
|
and depository_id = #{depositoryId} |
|
|
|
@ -1141,7 +1196,7 @@ |
|
|
|
and check_time between #{start} and #{end} |
|
|
|
</select> |
|
|
|
|
|
|
|
<!--获取一段时间内的入库额度--> |
|
|
|
<!--获取一段时间内的入库额度--> |
|
|
|
<select id="findApplicationInRecordByDate" parameterType="map" resultType="int"> |
|
|
|
SELECT |
|
|
|
ifnull(sum(quantity),0) |
|
|
|
@ -1181,7 +1236,7 @@ |
|
|
|
from MaterialCountByMonth |
|
|
|
where 1 = 1 |
|
|
|
<if test="type != null"> |
|
|
|
and type = #{type} |
|
|
|
and type = #{type} |
|
|
|
</if> |
|
|
|
<if test="state != null and state != ''"> |
|
|
|
and state = #{state} |
|
|
|
@ -1189,9 +1244,9 @@ |
|
|
|
<if test="depository_id != null and depository_id != ''"> |
|
|
|
and depository_id = #{depository_id} |
|
|
|
</if> |
|
|
|
and check_time between #{start} and #{end} |
|
|
|
and check_time between #{start} and #{end} |
|
|
|
<if test="tname != null and tname != ''"> |
|
|
|
and tname = #{tname} |
|
|
|
and tname = #{tname} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
@ -1203,7 +1258,7 @@ |
|
|
|
<if test="depository_id != null and depository_id != ''"> |
|
|
|
and did = #{depository_id} |
|
|
|
</if> |
|
|
|
and applicant_time between #{start} and #{end} |
|
|
|
and applicant_time between #{start} and #{end} |
|
|
|
<if test="tname != null and tname != ''"> |
|
|
|
and tname = #{tname} |
|
|
|
</if> |
|
|
|
@ -1219,7 +1274,7 @@ |
|
|
|
<if test="depository_id != null and depository_id != ''"> |
|
|
|
and did = #{depository_id} |
|
|
|
</if> |
|
|
|
and applicant_time between #{start} and #{end} |
|
|
|
and applicant_time between #{start} and #{end} |
|
|
|
<if test="tname != null and tname != ''"> |
|
|
|
and tname = #{tname} |
|
|
|
</if> |
|
|
|
@ -1248,7 +1303,7 @@ |
|
|
|
<if test="depository_id != null and depository_id != ''"> |
|
|
|
and depositoryId = #{depository_id} |
|
|
|
</if> |
|
|
|
and depositoryManagerTime between #{start} and #{end} |
|
|
|
and depositoryManagerTime between #{start} and #{end} |
|
|
|
<if test="tname != null and tname != ''"> |
|
|
|
and tname = #{tname} |
|
|
|
</if> |
|
|
|
@ -1271,6 +1326,7 @@ |
|
|
|
and dr.check_time between #{start} and #{end} |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 根据主键删除数据 --> |
|
|
|
<delete id="deleteApplicationInRecordById" parameterType="integer"> |
|
|
|
DELETE FROM application_in_record WHERE id = #{id} |
|
|
|
@ -1298,8 +1354,4 @@ |
|
|
|
</delete> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</mapper> |