|
@@ -26,6 +26,8 @@
|
|
|
<result property="backOneUser" column="back_one_user"/>
|
|
<result property="backOneUser" column="back_one_user"/>
|
|
|
<result property="backTwoUser" column="back_two_user"/>
|
|
<result property="backTwoUser" column="back_two_user"/>
|
|
|
|
|
|
|
|
|
|
+ <result property="outVideo" column="out_video"/>
|
|
|
|
|
+ <result property="returnVideo" column="return_video"/>
|
|
|
|
|
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
@@ -48,8 +50,9 @@
|
|
|
collect_stock_num,
|
|
collect_stock_num,
|
|
|
use_status,
|
|
use_status,
|
|
|
back_one_user,
|
|
back_one_user,
|
|
|
- back_two_user
|
|
|
|
|
-
|
|
|
|
|
|
|
+ back_two_user,
|
|
|
|
|
+ out_video,
|
|
|
|
|
+ return_video
|
|
|
from hxp_userecord
|
|
from hxp_userecord
|
|
|
</sql>
|
|
</sql>
|
|
|
<sql id="selectHxpUserecordListVo">
|
|
<sql id="selectHxpUserecordListVo">
|
|
@@ -72,6 +75,8 @@
|
|
|
t.use_status,
|
|
t.use_status,
|
|
|
t.back_one_user,
|
|
t.back_one_user,
|
|
|
t.back_two_user,
|
|
t.back_two_user,
|
|
|
|
|
+ t.out_video,
|
|
|
|
|
+ t.return_video,
|
|
|
(select chemical_name from hxp_stock where id = t.stock_id) chemicalName,
|
|
(select chemical_name from hxp_stock where id = t.stock_id) chemicalName,
|
|
|
((select sub_id from hxp_chemical_join_cabinet where id =
|
|
((select sub_id from hxp_chemical_join_cabinet where id =
|
|
|
(select join_id from hxp_stock where id = t.stock_id))) subId,
|
|
(select join_id from hxp_stock where id = t.stock_id))) subId,
|
|
@@ -233,6 +238,95 @@
|
|
|
|
|
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <resultMap type="com.zd.chemical.domain.vo.HxpUserecordDetailVo" id="HxpUserecordDetailResult">
|
|
|
|
|
+ <result property="id" column="id"/>
|
|
|
|
|
+ <result property="chemicalName" column="chemicalName"/>
|
|
|
|
|
+ <result property="joinNum" column="joinNum"/>
|
|
|
|
|
+ <result property="casNum" column="casNum"/>
|
|
|
|
|
+ <result property="anotherName" column="anotherName"/>
|
|
|
|
|
+ <result property="classifyName" column="classifyName"/>
|
|
|
|
|
+ <result property="purity" column="purity"/>
|
|
|
|
|
+ <result property="chemicalShapeName" column="chemicalShapeName"/>
|
|
|
|
|
+ <result property="classifyAttribute" column="classifyAttribute"/>
|
|
|
|
|
+ <result property="labelType" column="labelType"/>
|
|
|
|
|
+ <result property="tagCode" column="tagCode"/>
|
|
|
|
|
+ <result property="chemicalAmountUnit" column="chemicalAmountUnit"/>
|
|
|
|
|
+ <result property="tareUnit" column="tareUnit"/>
|
|
|
|
|
+ <result property="expirationTime" column="expirationTime"/>
|
|
|
|
|
+ <result property="collectHour" column="collectHour"/>
|
|
|
|
|
+ <result property="collectMinute" column="collectMinute"/>
|
|
|
|
|
+ <result property="cabinetName" column="cabinetName"/>
|
|
|
|
|
+ <result property="posi" column="posi"/>
|
|
|
|
|
+
|
|
|
|
|
+ <association property="outDetail" javaType="com.zd.chemical.domain.vo.HxpUserecordDetailVo$OutDetail">
|
|
|
|
|
+ <result column="stockSuttle" property="stockSuttle" />
|
|
|
|
|
+ <result column="lossAmount" property="lossAmount" />
|
|
|
|
|
+ <result column="collectSuttle" property="collectSuttle" />
|
|
|
|
|
+ <result column="outUsers" property="outUsers" />
|
|
|
|
|
+ <result column="outType" property="outType" />
|
|
|
|
|
+ <result column="outVideo" property="outVideo" />
|
|
|
|
|
+ </association>
|
|
|
|
|
+<!-- <association property="returnDetail" javaType="com.zd.chemical.domain.vo.HxpUserecordDetailVo$ReturnDetail">-->
|
|
|
|
|
+<!-- <result column="useStockNum" property="useStockNum" />-->
|
|
|
|
|
+<!-- <result column="returnSuttle" property="returnSuttle" />-->
|
|
|
|
|
+<!-- <result column="backUsers" property="backUsers" />-->
|
|
|
|
|
+<!-- <result column="returnType" property="returnType" />-->
|
|
|
|
|
+<!-- <result column="returnVideo" property="returnVideo" />-->
|
|
|
|
|
+<!-- </association>-->
|
|
|
|
|
+
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="queryDetailById" resultMap="HxpUserecordDetailResult">
|
|
|
|
|
+ select
|
|
|
|
|
+ hu.id,
|
|
|
|
|
+ hs.chemical_name chemicalName,
|
|
|
|
|
+ cjc.join_num joinNum,
|
|
|
|
|
+ hs.cas_num casNum,
|
|
|
|
|
+ hs.another_name anotherName,
|
|
|
|
|
+ (select ccy.`classify_name` from hxp_chemical_classify ccy where ccy.`id` = hs.`chemical_classify`) classifyName,
|
|
|
|
|
+ hs.purity,
|
|
|
|
|
+ (SELECT GROUP_CONCAT(CONCAT(dda.dict_label,'(',hs.chemical_unit,')')) FROM sys_dict_data dda
|
|
|
|
|
+ WHERE dda.dict_type = 'chemical_shape' AND dda.dict_value = hs.chemical_shape) chemicalShapeName,
|
|
|
|
|
+ (SELECT ifnull(GROUP_CONCAT(dda.dict_label),'') FROM sys_dict_data dda
|
|
|
|
|
+ WHERE dda.dict_type = 'hxp_classifyattribute' AND FIND_IN_SET(dda.dict_value, hc.classify_attribute)) classifyAttribute,
|
|
|
|
|
+ hs.label_type labelType,
|
|
|
|
|
+ hs.tag_code tagCode,
|
|
|
|
|
+ IFNULL(CONCAT(cjc.chemical_amount,cjc.chemical_amount_unit),'无') chemicalAmountUnit,
|
|
|
|
|
+ IFNULL( CONCAT(cjc.tare, cjc.chemical_amount_unit) ,'无') tareUnit,
|
|
|
|
|
+ hs.expiration_time expirationTime,
|
|
|
|
|
+ hc.collect_hour collectHour,
|
|
|
|
|
+ hc.collect_minute collectMinute,
|
|
|
|
|
+ ca.cabinet_name cabinetName,
|
|
|
|
|
+ CONCAT((SELECT st.name FROM lab_subject st WHERE st.id = cjc.`sub_id`),'-',
|
|
|
|
|
+ (SELECT dt.dept_name FROM sys_dept dt,lab_subject st WHERE dt.dept_id = st.build_id AND st.id = cjc.`sub_id`),'-',
|
|
|
|
|
+ (SELECT bg.name FROM lab_building bg,lab_subject st WHERE bg.id = st.floor_id AND st.id = cjc.`sub_id`),'-',
|
|
|
|
|
+ (SELECT slt.room FROM lab_subject_layout slt,lab_subject st WHERE slt.id = st.layout_id AND st.id = cjc.`sub_id`)) posi,
|
|
|
|
|
+
|
|
|
|
|
+ CONCAT(IFNULL(hu.collect_now_num,0)-IFNULL(hs.tare,0),hs.chemical_unit) stockSuttle,
|
|
|
|
|
+ concat(ifnull(hu.loss_amount, 0) , hs.chemical_unit) lossAmount,
|
|
|
|
|
+ CONCAT(IFNULL(hu.collect_stock_num,0)-IFNULL(hs.tare,0),hs.chemical_unit) collectSuttle,
|
|
|
|
|
+ CONCAT(ifnull((SELECT ur.nick_name FROM sys_user ur WHERE ur.user_id = hu.out_one_user), ""),
|
|
|
|
|
+ case when hu.out_two_user is not null then '、' else '' end,
|
|
|
|
|
+ ifnull((SELECT ur.nick_name FROM sys_user ur WHERE ur.user_id = hu.out_two_user), "")) outUsers,
|
|
|
|
|
+ hu.out_type outType,
|
|
|
|
|
+ hu.out_video outVideo,
|
|
|
|
|
+
|
|
|
|
|
+ CONCAT(IFNULL(hu.collect_stock_num,0)-IFNULL(hu.return_stock_num,0),hs.chemical_unit) useStockNum,
|
|
|
|
|
+ CONCAT(IFNULL(hu.return_stock_num,0)-IFNULL(hs.tare,0),hs.chemical_unit) returnSuttle,
|
|
|
|
|
+ CONCAT(ifnull((SELECT ur.nick_name FROM sys_user ur WHERE ur.user_id = hu.back_one_user), ""),
|
|
|
|
|
+ case when hu.back_two_user is not null then '、' else '' end,
|
|
|
|
|
+ ifnull((SELECT ur.nick_name FROM sys_user ur WHERE ur.user_id = hu.back_two_user), "")) backUsers,
|
|
|
|
|
+ hu.return_type returnType,
|
|
|
|
|
+ hu.return_video returnVideo
|
|
|
|
|
+
|
|
|
|
|
+ from hxp_userecord hu left join hxp_stock hs on hu.stock_id = hs.id
|
|
|
|
|
+ left join hxp_chemical_join_cabinet cjc on hs.join_id = cjc.id
|
|
|
|
|
+ left join hxp_chemical hc on cjc.chemical_id = hc.id
|
|
|
|
|
+ left join hxp_cabinet ca on cjc.cabinet_id = ca.id
|
|
|
|
|
+ where hu.id = #{id}
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
<insert id="insertHxpUserecord" parameterType="com.zd.chemical.domain.HxpUserecord" useGeneratedKeys="true"
|
|
<insert id="insertHxpUserecord" parameterType="com.zd.chemical.domain.HxpUserecord" useGeneratedKeys="true"
|
|
|
keyProperty="id">
|
|
keyProperty="id">
|
|
|
insert into hxp_userecord
|
|
insert into hxp_userecord
|
|
@@ -274,6 +368,10 @@
|
|
|
|
|
|
|
|
<if test="lossAmount != null">loss_amount,</if>
|
|
<if test="lossAmount != null">loss_amount,</if>
|
|
|
<if test="outType != null">out_type,</if>
|
|
<if test="outType != null">out_type,</if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="outVideo != null">out_video,</if>
|
|
|
|
|
+ <if test="returnVideo != null">return_video,</if>
|
|
|
|
|
+
|
|
|
</trim>
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="stockId != null">#{stockId},</if>
|
|
<if test="stockId != null">#{stockId},</if>
|
|
@@ -298,6 +396,9 @@
|
|
|
|
|
|
|
|
<if test="lossAmount != null">#{lossAmount},</if>
|
|
<if test="lossAmount != null">#{lossAmount},</if>
|
|
|
<if test="outType != null">#{outType},</if>
|
|
<if test="outType != null">#{outType},</if>
|
|
|
|
|
+
|
|
|
|
|
+ <if test="outVideo != null">#{outVideo},</if>
|
|
|
|
|
+ <if test="returnVideo != null">#{returnVideo},</if>
|
|
|
</trim>
|
|
</trim>
|
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
|
@@ -324,6 +425,8 @@
|
|
|
<if test="backOneUser != null">back_one_user = #{backOneUser},</if>
|
|
<if test="backOneUser != null">back_one_user = #{backOneUser},</if>
|
|
|
<if test="backTwoUser != null">back_two_user = #{backTwoUser},</if>
|
|
<if test="backTwoUser != null">back_two_user = #{backTwoUser},</if>
|
|
|
|
|
|
|
|
|
|
+ <if test="outVideo != null">out_video = #{outVideo},</if>
|
|
|
|
|
+ <if test="returnVideo != null">return_video = #{returnVideo},</if>
|
|
|
</trim>
|
|
</trim>
|
|
|
where id = #{id}
|
|
where id = #{id}
|
|
|
</update>
|
|
</update>
|