|
@@ -120,21 +120,21 @@
|
|
|
t.air_bottle_name,
|
|
t.air_bottle_name,
|
|
|
t.specification_name,
|
|
t.specification_name,
|
|
|
t.air_bottle_config_id,
|
|
t.air_bottle_config_id,
|
|
|
- (select nick_name from sys_user u where u.user_id = t.storage_userid) storageUser,
|
|
|
|
|
- (select phonenumber from sys_user u where u.user_id = t.storage_userid) storageUserPhone,
|
|
|
|
|
- (select l.room room
|
|
|
|
|
- from lab_subject s,
|
|
|
|
|
- lab_subject_layout l
|
|
|
|
|
- where s.layout_id = l.id
|
|
|
|
|
- and s.id = (select ta.location_id
|
|
|
|
|
- from qp_bottle_storage bs,
|
|
|
|
|
- qp_task ta
|
|
|
|
|
- where bs.task_id = ta.id
|
|
|
|
|
- and bs.task_detail_id = t.task_detail_id
|
|
|
|
|
- LIMIT 1)) room,
|
|
|
|
|
- (select location from qp_task ta where ta.id = t.task_id) location,
|
|
|
|
|
- (select phonenumber from sys_user u where u.user_id = t.rejection_apply_userid) refusePhonen,
|
|
|
|
|
- (select nick_name from sys_user u where u.user_id = t.rejection_apply_userid) refuseName
|
|
|
|
|
|
|
+ (select nick_name from sys_user u where u.user_id = t.storage_userid) storageUser,
|
|
|
|
|
+ (select phonenumber from sys_user u where u.user_id = t.storage_userid) storageUserPhone,
|
|
|
|
|
+ (select fl.room_num from qp_task ta,lab_build_floor_layout fl where ta.id=t.task_id and ta.location_id = fl.sub_id) room,
|
|
|
|
|
+ (
|
|
|
|
|
+ select location
|
|
|
|
|
+ from qp_task ta
|
|
|
|
|
+ where ta.id = t.task_id) location
|
|
|
|
|
+ , (
|
|
|
|
|
+ select phonenumber
|
|
|
|
|
+ from sys_user u
|
|
|
|
|
+ where u.user_id = t.rejection_apply_userid) refusePhonen
|
|
|
|
|
+ , (
|
|
|
|
|
+ select nick_name
|
|
|
|
|
+ from sys_user u
|
|
|
|
|
+ where u.user_id = t.rejection_apply_userid) refuseName
|
|
|
from qp_bottle_storage as t
|
|
from qp_bottle_storage as t
|
|
|
</sql>
|
|
</sql>
|
|
|
<sql id="whereSql">
|
|
<sql id="whereSql">
|
|
@@ -216,8 +216,8 @@
|
|
|
select * from (
|
|
select * from (
|
|
|
<include refid="selectQpBottleStorageListVo"/>
|
|
<include refid="selectQpBottleStorageListVo"/>
|
|
|
) t2 LEFT JOIN qp_task ta on t2.task_id=ta.id
|
|
) t2 LEFT JOIN qp_task ta on t2.task_id=ta.id
|
|
|
- LEFT JOIN sys_dept d on ta.dept_id=d.dept_id
|
|
|
|
|
- LEFT JOIN sys_user u on ta.user_id=u.user_id
|
|
|
|
|
|
|
+ LEFT JOIN sys_dept d on ta.dept_id=d.dept_id
|
|
|
|
|
+ LEFT JOIN sys_user u on ta.user_id=u.user_id
|
|
|
<where>
|
|
<where>
|
|
|
<if test="searchValue != null and searchValue != ''">
|
|
<if test="searchValue != null and searchValue != ''">
|
|
|
and ( t2.storageUser like concat('%', #{searchValue}, '%')
|
|
and ( t2.storageUser like concat('%', #{searchValue}, '%')
|
|
@@ -236,10 +236,10 @@
|
|
|
AND DATE_FORMAT(t2.create_time,'%Y-%m-%d') <=DATE_FORMAT(#{endTime},'%Y-%m-%d')
|
|
AND DATE_FORMAT(t2.create_time,'%Y-%m-%d') <=DATE_FORMAT(#{endTime},'%Y-%m-%d')
|
|
|
</if>
|
|
</if>
|
|
|
<if test="ids != null ">
|
|
<if test="ids != null ">
|
|
|
- and t2.id in
|
|
|
|
|
- <foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
|
|
|
- #{id}
|
|
|
|
|
- </foreach>
|
|
|
|
|
|
|
+ and t2.id in
|
|
|
|
|
+ <foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
|
|
|
+ #{id}
|
|
|
|
|
+ </foreach>
|
|
|
</if>
|
|
</if>
|
|
|
<!-- 数据范围过滤 -->
|
|
<!-- 数据范围过滤 -->
|
|
|
${params.dataScope}
|
|
${params.dataScope}
|
|
@@ -291,13 +291,13 @@
|
|
|
<select id="calcLocationStorage" resultType="com.zd.airbottle.domain.vo.report.AirAmount"
|
|
<select id="calcLocationStorage" resultType="com.zd.airbottle.domain.vo.report.AirAmount"
|
|
|
parameterType="java.lang.String">
|
|
parameterType="java.lang.String">
|
|
|
select * from (SELECT
|
|
select * from (SELECT
|
|
|
- ls.room `name`,
|
|
|
|
|
|
|
+ fl.room_num `name`,
|
|
|
COUNT( 1 ) in_num
|
|
COUNT( 1 ) in_num
|
|
|
FROM
|
|
FROM
|
|
|
qp_bottle_storage qs
|
|
qp_bottle_storage qs
|
|
|
INNER JOIN qp_task qt ON qt.id=qs.task_id
|
|
INNER JOIN qp_task qt ON qt.id=qs.task_id
|
|
|
INNER JOIN lab_subject su on su.id = qt.location_id
|
|
INNER JOIN lab_subject su on su.id = qt.location_id
|
|
|
- INNER JOIN lab_subject_layout ls on ls.id=su.layout_id
|
|
|
|
|
|
|
+ INNER JOIN lab_build_floor_layout fl on fl.sub_id = qt.location_id
|
|
|
WHERE
|
|
WHERE
|
|
|
DATE_FORMAT( qs.create_time, '%Y-%m' )> DATE_FORMAT( date_sub( curdate(), INTERVAL 12 MONTH ), '%Y-%m' )
|
|
DATE_FORMAT( qs.create_time, '%Y-%m' )> DATE_FORMAT( date_sub( curdate(), INTERVAL 12 MONTH ), '%Y-%m' )
|
|
|
AND qs.air_status=0
|
|
AND qs.air_status=0
|
|
@@ -305,7 +305,7 @@
|
|
|
AND qs.air_bottle_name LIKE concat('%', #{airName}, '%')
|
|
AND qs.air_bottle_name LIKE concat('%', #{airName}, '%')
|
|
|
</if>
|
|
</if>
|
|
|
GROUP BY
|
|
GROUP BY
|
|
|
- ls.id
|
|
|
|
|
|
|
+ fl.id
|
|
|
) t ORDER BY t.in_num desc
|
|
) t ORDER BY t.in_num desc
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
@@ -458,13 +458,31 @@
|
|
|
</delete>
|
|
</delete>
|
|
|
|
|
|
|
|
<!-- 入库表实验室关联查询 -->
|
|
<!-- 入库表实验室关联查询 -->
|
|
|
- <select id="selectQpBottleStorageByRelationSubject" parameterType="com.zd.airbottle.domain.vo.QpBottleStorageVO" resultMap="QpBottleStorageResult">
|
|
|
|
|
|
|
+ <select id="selectQpBottleStorageByRelationSubject" parameterType="com.zd.airbottle.domain.vo.QpBottleStorageVO"
|
|
|
|
|
+ resultMap="QpBottleStorageResult">
|
|
|
select t.id,t.task_id,t.task_detail_id, t.create_time,
|
|
select t.id,t.task_id,t.task_detail_id, t.create_time,
|
|
|
- (select d.dept_class_name from lab_subject s,sys_dept d where s.build_id=d.dept_id and s.id=t.location_id)
|
|
|
|
|
|
|
+ (select f.name
|
|
|
|
|
+ from lab_build_floor f
|
|
|
|
|
+ where f.type = 1
|
|
|
|
|
+ and f.id = (
|
|
|
|
|
+ select f.parent_id
|
|
|
|
|
+ from lab_build_floor f
|
|
|
|
|
+ where f.id =
|
|
|
|
|
+ (select bfl.build_id
|
|
|
|
|
+ from lab_build_floor_layout bfl
|
|
|
|
|
+ where bfl.sub_id = t.location_id)))
|
|
|
campus,
|
|
campus,
|
|
|
- (select d.dept_name building from lab_subject s,sys_dept d where s.build_id=d.dept_id and s.id=t.location_id)
|
|
|
|
|
|
|
+ (select f.`name`
|
|
|
|
|
+ from lab_build_floor f
|
|
|
|
|
+ where f.type = 2
|
|
|
|
|
+ and f.id =
|
|
|
|
|
+ (select bfl.build_id
|
|
|
|
|
+ from lab_build_floor_layout bfl
|
|
|
|
|
+ where bfl.sub_id = t.location_id))
|
|
|
building,
|
|
building,
|
|
|
- (select l.room room from lab_subject s,lab_subject_layout l where s.layout_id =l.id and s.id=t.location_id) room
|
|
|
|
|
|
|
+ (select bfl.room_num
|
|
|
|
|
+ from lab_build_floor_layout bfl
|
|
|
|
|
+ where bfl.sub_id = t.location_id) room
|
|
|
from (
|
|
from (
|
|
|
select bs.*,ta.location_id from qp_bottle_storage bs, qp_task ta,qp_task_detail td
|
|
select bs.*,ta.location_id from qp_bottle_storage bs, qp_task ta,qp_task_detail td
|
|
|
where bs.task_id = ta.id and bs.task_detail_id = td.id
|
|
where bs.task_id = ta.id and bs.task_detail_id = td.id
|
|
@@ -557,22 +575,100 @@
|
|
|
<select id="selectQpTaskListIndex" parameterType="com.zd.airbottle.domain.vo.QpBottleStorageVO"
|
|
<select id="selectQpTaskListIndex" parameterType="com.zd.airbottle.domain.vo.QpBottleStorageVO"
|
|
|
resultMap="QpBottleStorageResult">
|
|
resultMap="QpBottleStorageResult">
|
|
|
select *
|
|
select *
|
|
|
- from (select distinct ta.id, ta.id task_id, '' task_detail_id, 'gq' remark, ta.create_time
|
|
|
|
|
|
|
+ from (select distinct ta.id,
|
|
|
|
|
+ ta.id task_id,
|
|
|
|
|
+ '' task_detail_id,
|
|
|
|
|
+ 'gq' remark,
|
|
|
|
|
+ ta.create_time,
|
|
|
|
|
+ (select bfl.room_num
|
|
|
|
|
+ from lab_build_floor_layout bfl
|
|
|
|
|
+ where bfl.sub_id = ta.location_id) room,
|
|
|
|
|
+ (
|
|
|
|
|
+ select f.`name`
|
|
|
|
|
+ from lab_build_floor f
|
|
|
|
|
+ where f.type = 2
|
|
|
|
|
+ and f.id =
|
|
|
|
|
+ (select bfl.build_id
|
|
|
|
|
+ from lab_build_floor_layout bfl
|
|
|
|
|
+ where bfl.sub_id = ta.location_id)
|
|
|
|
|
+ ) building,
|
|
|
|
|
+ (
|
|
|
|
|
+ select f.name
|
|
|
|
|
+ from lab_build_floor f
|
|
|
|
|
+ where f.type = 1
|
|
|
|
|
+ and f.id = (
|
|
|
|
|
+ select f.parent_id
|
|
|
|
|
+ from lab_build_floor f
|
|
|
|
|
+ where f.id =
|
|
|
|
|
+ (select bfl.build_id
|
|
|
|
|
+ from lab_build_floor_layout bfl
|
|
|
|
|
+ where bfl.sub_id = ta.location_id))
|
|
|
|
|
+ ) campus
|
|
|
from qp_task ta,
|
|
from qp_task ta,
|
|
|
qp_task_detail td
|
|
qp_task_detail td
|
|
|
where ta.id = td.task_id
|
|
where ta.id = td.task_id
|
|
|
and td.is_dispose = 0
|
|
and td.is_dispose = 0
|
|
|
and td.supplier_id = #{companyId}
|
|
and td.supplier_id = #{companyId}
|
|
|
UNION all
|
|
UNION all
|
|
|
- select bso.id, bs.task_id, bs.task_detail_id, 'hs' remark, bso.create_time
|
|
|
|
|
|
|
+ select bso.id,
|
|
|
|
|
+ bs.task_id,
|
|
|
|
|
+ bs.task_detail_id,
|
|
|
|
|
+ 'hs' remark,
|
|
|
|
|
+ bso.create_time,
|
|
|
|
|
+ (select bfl.room_num from lab_build_floor_layout bfl where bfl.sub_id = tk.location_id) room,
|
|
|
|
|
+ (
|
|
|
|
|
+ select f.`name`
|
|
|
|
|
+ from lab_build_floor f
|
|
|
|
|
+ where f.type = 2
|
|
|
|
|
+ and f.id =
|
|
|
|
|
+ (select bfl.build_id from lab_build_floor_layout bfl where bfl.sub_id = tk.location_id)
|
|
|
|
|
+ ) building,
|
|
|
|
|
+ (
|
|
|
|
|
+ select f.name
|
|
|
|
|
+ from lab_build_floor f
|
|
|
|
|
+ where f.type = 1
|
|
|
|
|
+ and f.id = (
|
|
|
|
|
+ select f.parent_id
|
|
|
|
|
+ from lab_build_floor f
|
|
|
|
|
+ where f.id =
|
|
|
|
|
+ (select bfl.build_id
|
|
|
|
|
+ from lab_build_floor_layout bfl
|
|
|
|
|
+ where bfl.sub_id = tk.location_id))
|
|
|
|
|
+ ) campus
|
|
|
from qp_bottle_storage_out bso
|
|
from qp_bottle_storage_out bso
|
|
|
LEFT JOIN qp_bottle_storage bs on bso.storage_id = bs.id
|
|
LEFT JOIN qp_bottle_storage bs on bso.storage_id = bs.id
|
|
|
LEFT JOIN qp_task_detail td on td.id = bs.task_detail_id
|
|
LEFT JOIN qp_task_detail td on td.id = bs.task_detail_id
|
|
|
|
|
+ LEFT JOIN qp_task tk on tk.id = bs.task_id
|
|
|
where bso.out_status = 0
|
|
where bso.out_status = 0
|
|
|
and td.supplier_id = #{companyId}
|
|
and td.supplier_id = #{companyId}
|
|
|
UNION all
|
|
UNION all
|
|
|
- select bs.id, bs.task_id, bs.task_detail_id, 'wt' remark, bs.create_time
|
|
|
|
|
|
|
+ select bs.id,
|
|
|
|
|
+ bs.task_id,
|
|
|
|
|
+ bs.task_detail_id,
|
|
|
|
|
+ 'wt' remark,
|
|
|
|
|
+ bs.create_time,
|
|
|
|
|
+ (select bfl.room_num from lab_build_floor_layout bfl where bfl.sub_id = tk.location_id) room,
|
|
|
|
|
+ (
|
|
|
|
|
+ select f.`name`
|
|
|
|
|
+ from lab_build_floor f
|
|
|
|
|
+ where f.type = 2
|
|
|
|
|
+ and f.id =
|
|
|
|
|
+ (select bfl.build_id from lab_build_floor_layout bfl where bfl.sub_id = tk.location_id)
|
|
|
|
|
+ ) building,
|
|
|
|
|
+ (
|
|
|
|
|
+ select f.name
|
|
|
|
|
+ from lab_build_floor f
|
|
|
|
|
+ where f.type = 1
|
|
|
|
|
+ and f.id = (
|
|
|
|
|
+ select f.parent_id
|
|
|
|
|
+ from lab_build_floor f
|
|
|
|
|
+ where f.id =
|
|
|
|
|
+ (select bfl.build_id
|
|
|
|
|
+ from lab_build_floor_layout bfl
|
|
|
|
|
+ where bfl.sub_id = tk.location_id))
|
|
|
|
|
+ ) campus
|
|
|
from qp_bottle_storage bs
|
|
from qp_bottle_storage bs
|
|
|
|
|
+ LEFT JOIN qp_task tk on tk.id = bs.task_id
|
|
|
LEFT JOIN qp_task_detail td
|
|
LEFT JOIN qp_task_detail td
|
|
|
on bs.task_detail_id = td.id
|
|
on bs.task_detail_id = td.id
|
|
|
where bs.air_status = 1
|
|
where bs.air_status = 1
|
|
@@ -585,7 +681,7 @@
|
|
|
<select id="selectIntoStorageList" parameterType="com.zd.airbottle.domain.vo.QpBottleStorageVO"
|
|
<select id="selectIntoStorageList" parameterType="com.zd.airbottle.domain.vo.QpBottleStorageVO"
|
|
|
resultMap="QpBottleStorageResult">
|
|
resultMap="QpBottleStorageResult">
|
|
|
select * from qp_bottle_storage bs,qp_task ta
|
|
select * from qp_bottle_storage bs,qp_task ta
|
|
|
- where bs.task_id = ta.id and bs.task_id = ta.id and bs.storage_status!=3 and bs.air_status=0
|
|
|
|
|
|
|
+ where bs.task_id = ta.id and bs.task_id = ta.id and bs.storage_status!=3 and bs.air_status=0
|
|
|
<if test="subjectId != null ">and ta.location_id=#{subjectId}</if>
|
|
<if test="subjectId != null ">and ta.location_id=#{subjectId}</if>
|
|
|
<if test="userId != null ">and ta.user_id=#{userId}</if>
|
|
<if test="userId != null ">and ta.user_id=#{userId}</if>
|
|
|
</select>
|
|
</select>
|
|
@@ -608,7 +704,9 @@
|
|
|
|
|
|
|
|
<!-- 查询实验室负责人-->
|
|
<!-- 查询实验室负责人-->
|
|
|
<select id="selectSubectDetalsById" resultType="java.util.Map">
|
|
<select id="selectSubectDetalsById" resultType="java.util.Map">
|
|
|
- select admin_id adminId from lab_subject where id= #{subjectId};
|
|
|
|
|
|
|
+ select admin_id adminId
|
|
|
|
|
+ from lab_subject
|
|
|
|
|
+ where id = #{subjectId};
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
</mapper>
|
|
</mapper>
|