From c87738a78f57e6f68a0111d68ef3748b29dc1eda Mon Sep 17 00:00:00 2001 From: 李宇 <986321569@qq.com> Date: 星期三, 23 六月 2021 12:21:59 +0800 Subject: [PATCH] 修改试剂排序 --- src/main/java/com/nanometer/smartlab/dao/OpeApplyDao.xml | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 108 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/nanometer/smartlab/dao/OpeApplyDao.xml b/src/main/java/com/nanometer/smartlab/dao/OpeApplyDao.xml index 1fb781b..f25e743 100644 --- a/src/main/java/com/nanometer/smartlab/dao/OpeApplyDao.xml +++ b/src/main/java/com/nanometer/smartlab/dao/OpeApplyDao.xml @@ -60,8 +60,12 @@ <result property="applyCode" column="apply_code"></result> <result property="num" column="num"></result> <result property="used" column="used"></result> - <result property="status" column="status" typeHandler="com.nanometer.smartlab.entity.handler.ApplyStatusHandler"></result> + <result property="arrivalNum" column="arrival_num"></result> + <result property="status" column="status" typeHandler="com.nanometer.smartlab.entity.handler.ApplyStatusHandler"></result> <result property="applyUserId" column="apply_user_id"></result> + <result property="applyUser" column="apply_user"></result> + <result property="arrivalTime" column="arrival_time"></result> + <result property="articleNumber" column="articleNumber"></result> <result property="projectManage" column="projectManage"/> <result property="project" column="project"/> <association property="reagent" javaType="com.nanometer.smartlab.entity.SysReagent"> @@ -173,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"> @@ -190,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> @@ -227,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} @@ -355,8 +364,18 @@ 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> + <when test="isAllApply == 1"> + and oa.used = oa.num + </when> + <otherwise> + and oa.used != oa.num + </otherwise> + </choose> + </if> GROUP BY oa.id )as oaa </select> @@ -395,10 +414,12 @@ bm1.meta_value productHome, sr.dangerous_flag, oa.num, + oa.apply_user_id apply_user, oa.used, su.`name` apply_user_id, su.project, - su1.`name` as projectManage + su1.`name` as projectManage, + oa.arrival_time FROM ope_apply AS oa LEFT JOIN sys_reagent sr ON sr.id = oa.reagent_id @@ -409,8 +430,44 @@ 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"> + and oa.used = oa.num + </when> + <otherwise> + and oa.used != oa.num + </otherwise> + </choose> + </if> GROUP BY oa.id order by oa.update_time desc <if test="first != null and pageSize != null"> @@ -429,8 +486,52 @@ <select id="selectByReId" resultMap="OpeApply"> select * from ope_apply where reagent_id=#{id} </select> + <select id="getOpeApplyDetail" resultMap="OpeApplyReserve"> + select oa.id, oa.apply_code, + sr.id reagent_id, + oa.status, + sr.product_sn reagentProductSn, + sr.`name` reagentName, + bm2.meta_value controlProducts, + bm3.meta_value reagentFormat, + sr.main_metering reagentMainMetering, + sr.price reagentPrice, + sr.cas reagentCas, + oa.article_number articleNumber, + bm4.meta_value reagentCharacter, + bm1.meta_value productHome, + sr.dangerous_flag, + oa.num, + oa.used, + oa.arrival_num, + su.id apply_user_id + from ope_apply as oa + left JOIN sys_reagent sr on sr.id = oa.reagent_id + left JOIN sys_user su on su.id = oa.apply_user_id + left join base_meta as bm2 on sr.control_products = bm2.id + left join base_meta as bm3 on sr.reagent_format = bm3.id + left join base_meta as bm4 on sr.reagent_character = bm4.id + left join base_meta as bm1 on sr.product_home = bm1.id + where oa.valid_flag = 1 + and oa.id = #{0} + </select> + <update id="updateByReId" parameterType="java.util.Map"> update ope_apply set reagent_id=#{newReId} where reagent_id=#{oldReId} </update> + + <update id="updateOpeApplyInfo" parameterType="java.util.Map"> + update + ope_apply + set status = #{status} + <if test="arrivalTime!=null" > + ,arrival_time = #{arrivalTime} + </if> + <if test="consigneeId!=null" > + ,consignee_id = #{consigneeId} + </if> + where valid_flag = 1 + and id = #{applyId} + </update> </mapper> -- Gitblit v1.9.2