From 3bc79850da426a40002a5d07ceb63fcbcdc2d93d Mon Sep 17 00:00:00 2001
From: lyfO_o <764716047@qq.com>
Date: Wed, 16 Jun 2021 09:39:51 +0800
Subject: [PATCH] 危废处理取消和恢复
---
src/main/java/com/nanometer/smartlab/dao/OpeApplyDao.xml | 42 +++++++++++++++++++++++++++++++++++++-----
1 files changed, 37 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/nanometer/smartlab/dao/OpeApplyDao.xml b/src/main/java/com/nanometer/smartlab/dao/OpeApplyDao.xml
index b8fd00d..f25e743 100644
--- a/src/main/java/com/nanometer/smartlab/dao/OpeApplyDao.xml
+++ b/src/main/java/com/nanometer/smartlab/dao/OpeApplyDao.xml
@@ -177,6 +177,7 @@
left join sys_user as fir on fir.id=oa.first_user
left join base_meta as bm on sr.product_home = bm.id
where oa.valid_flag = 1
+ and sr.valid_flag = 1
<include refid="queryWhereSql"/>
order by oa.create_time desc
<if test="first != null and pageSize != null">
@@ -194,7 +195,7 @@
left join sys_user as sys on sys.id=oa.before_approve_user_id
left join sys_user as fir on fir.id=oa.first_user
left join base_meta as bm on sr.product_home = bm.id
- where oa.valid_flag = 1
+ where oa.valid_flag = 1 and sr.valid_flag = 1
<include refid="queryWhereSql"/>
</select>
@@ -231,7 +232,11 @@
</update>
<update id="updateOpeApplyStatus" parameterType="java.util.Map" >
- update ope_apply set status=#{status}, memo=#{memo}, update_time=now()
+ update ope_apply set status=#{status},
+ <if test="memo !=null and memo != ''">
+ memo=#{memo},
+ </if>
+ update_time=now()
where id in
<foreach collection="applyIds" item="item" index="index" open="(" separator="," close=")">
#{item}
@@ -359,7 +364,7 @@
LEFT JOIN base_meta AS bm1 ON sr.product_home = bm1.id
LEFT JOIN sys_project as project on project.project = su.project
LEFT JOIN sys_user as su1 on su1.id = project.sys_user_id
- where oa.valid_flag = 1 and (oa.status=4 or oa.status=6)
+ where oa.valid_flag = 1 and (oa.status=4 or oa.status=6 or oa.status = 10)
<include refid="getOpeApplyReserveList_queryWhereSql" />
<if test="isAllApply != null">
<choose>
@@ -410,6 +415,7 @@
sr.dangerous_flag,
oa.num,
oa.apply_user_id apply_user,
+ oa.used,
su.`name` apply_user_id,
su.project,
su1.`name` as projectManage,
@@ -424,8 +430,34 @@
LEFT JOIN base_meta AS bm1 ON sr.product_home = bm1.id
LEFT JOIN sys_project as project on project.project = su.project
LEFT JOIN sys_user as su1 on su1.id = project.sys_user_id
- where oa.valid_flag = 1 and (oa.status=4 or oa.status=6)
- <include refid="getOpeApplyReserveList_queryWhereSql" />
+ where oa.valid_flag = 1 and (
+ <choose>
+ <when test="status == @com.nanometer.smartlab.entity.enumtype.ApplyStatus@EXPIRED">
+ oa.status = 10
+ </when>
+ <otherwise>
+ oa.status=4 or oa.status=6
+ </otherwise>
+ </choose>
+ )
+ <if test="reagentName != null and reagentName != ''">
+ and sr.name like concat('%',#{reagentName},'%')
+ </if>
+ <if test="personName != null and personName != ''">
+ and su.name like concat('%',#{personName},'%')
+ </if>
+ <if test="userId != null and userId != ''">
+ and oa.apply_user_id =#{userId}
+ </if>
+ <if test="status != null and status != ''">
+ and oa.status =#{status}
+ </if>
+ <if test="productSn != null and productSn != ''">
+ and sr.product_sn like concat('%',#{productSn},'%')
+ </if>
+ <if test="applyCode != null and applyCode != ''">
+ and oa.apply_code = #{applyCode}
+ </if>
<if test="isAllApply != null">
<choose>
<when test="isAllApply == 1">
--
Gitblit v1.9.2