| | |
| | | <resultMap id="OpeUseFlow" type="com.nanometer.smartlab.entity.OpeUseFlow"> |
| | | <id property="id" column="id"/> |
| | | <result property="reagentCode" column="reagent_code"></result> |
| | | <result property="articleNumber" column="articleNumber"></result> |
| | | <result property="status" column="status" typeHandler="com.nanometer.smartlab.entity.handler.ArrivalStatusHandler"></result> |
| | | <result property="articleNumber" column="article_number"></result> |
| | | <result property="status" column="status"></result> |
| | | <result property="houseId" column="house_id"></result> |
| | | <result property="containerId" column="container_id"></result> |
| | | <result property="userId" column="user_id"></result> |
| | | <result property="userName" column="userName"></result> |
| | | <result property="validFlag" column="valid_flag" typeHandler="com.nanometer.smartlab.entity.handler.ValidFlagHandler"></result> |
| | | <result property="userName" column="user_name"></result> |
| | | <result property="validFlag" column="valid_flag"></result> |
| | | <result property="createTime" column="create_time"></result> |
| | | <result property="realstatus" column="realstatus"></result> |
| | | <result property="operateState" column="operatestate"></result> |
| | | <result property="remainder" column="remainder"></result> |
| | | <result property="place" column="place"></result> |
| | | <result property="storeType" column="store_type" typeHandler="com.nanometer.smartlab.entity.handler.StoreTypeHandler"></result> |
| | | <result column="laboratoryName" jdbcType="VARCHAR" property="laboratoryName" /> |
| | | <result column="warehouseName" jdbcType="VARCHAR" property="warehouseName" /> |
| | | <result column="warehouseContainerName" jdbcType="VARCHAR" property="warehouseContainerName" /> |
| | | <result column="warehouseContainerCode" jdbcType="VARCHAR" property="warehouseContainerCode" /> |
| | | <result column="laboratoryContainerName" jdbcType="VARCHAR" property="laboratoryContainerName" /> |
| | | <result column="laboratoryContainerCode" jdbcType="VARCHAR" property="laboratoryContainerCode" /> |
| | | <result column="operatestateName" jdbcType="VARCHAR" property="operatestateName" /> |
| | | <result property="storeType" column="store_type"></result> |
| | | <result column="laboratory_name" jdbcType="VARCHAR" property="laboratoryName" /> |
| | | <result column="warehouse_name" jdbcType="VARCHAR" property="warehouseName" /> |
| | | <result column="warehouse_container_name" jdbcType="VARCHAR" property="warehouseContainerName" /> |
| | | <result column="warehouse_container_code" jdbcType="VARCHAR" property="warehouseContainerCode" /> |
| | | <result column="laboratory_container_name" jdbcType="VARCHAR" property="laboratoryContainerName" /> |
| | | <result column="laboratory_container_code" jdbcType="VARCHAR" property="laboratoryContainerCode" /> |
| | | <result column="operatestate_name" jdbcType="VARCHAR" property="operatestateName" /> |
| | | <result column="receipt_number" jdbcType="VARCHAR" property="receiptNumber" /> |
| | | |
| | | <association property="reagent" javaType="com.nanometer.smartlab.entity.SysReagent"> |
| | | <id property="id" column="reagentId"/> |
| | | <id property="id" column="reagent_id"/> |
| | | <result property="name" column="name"></result> |
| | | <result property="cas" column="cas"></result> |
| | | <result property="reagentType" column="reagent_type"></result> |
| | |
| | | <result property="price" column="price"></result> |
| | | <result property="perBox" column="per_box"></result> |
| | | <result property="memo" column="memo"></result> |
| | | <result property="validFlag" column="valid_flag" typeHandler="com.nanometer.smartlab.entity.handler.ValidFlagHandler"></result> |
| | | <result property="validFlag" column="valid_flag"></result> |
| | | <result property="createTime" column="create_time"></result> |
| | | <result property="updateTime" column="update_time"></result> |
| | | <result property="supplierName" column="supplierName"></result> |
| | | <result property="supplierName" column="supplier_name"></result> |
| | | </association> |
| | | </resultMap> |
| | | |
| | |
| | | where reagent_code = #{0} |
| | | </update> |
| | | <sql id="queryWhereSql"> |
| | | <if test="reagentId != null and reagentId != ''"> |
| | | and ors.reagent_id = #{reagentId} |
| | | </if> |
| | | <if test="userId != null and userId != ''"> |
| | | and oa.user_id = #{userId} |
| | | </if> |
| | | <if test="departmentUserIds != null"> |
| | | and oa.user_id in |
| | | <foreach collection="departmentUserIds" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="reagentCode != null and reagentCode != ''"> |
| | | and oa.reagent_code like #{reagentCode} |
| | | </if> |
| | | <if test="status != null"> |
| | | and oa.status = #{status} |
| | | </if> |
| | | <if test="reagentName != null and reagentName != ''"> |
| | | and sr.name like concat('%',#{reagentName},'%') |
| | | </if> |
| | | <if test="houseName != null and houseName != ''"> |
| | | and ( l.name like concat('%',#{houseName},'%') or w.name like concat('%',#{houseName},'%') ) |
| | | </if> |
| | | <if test="startDate != null and startDate !=''"> |
| | | and oa.create_time >= #{startDate} |
| | | </if> |
| | | <if test="endDate != null and endDate !=''"> |
| | | and oa.create_time <= #{endDate} |
| | | </if> |
| | | <if test="operatestate != null and operatestate !=''"> |
| | | and bm1.id = #{operatestate} |
| | | </if> |
| | | <if test="containerCode != null and containerCode !=''"> |
| | | and wc.container_code = #{containerCode} |
| | | or lc.container_code =#{containerCode} |
| | | </if> |
| | | </sql> |
| | | <if test="reagentId != null and reagentId != ''"> |
| | | and ors.reagent_id = #{reagentId} |
| | | </if> |
| | | <if test="userId != null and userId != ''"> |
| | | and oa.user_id = #{userId} |
| | | </if> |
| | | <if test="departmentUserIds != null"> |
| | | and oa.user_id in |
| | | <foreach collection="departmentUserIds" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="reagentCode != null and reagentCode != ''"> |
| | | and oa.reagent_code like #{reagentCode} |
| | | </if> |
| | | <if test="status != null"> |
| | | and oa.status = #{status} |
| | | </if> |
| | | <if test="reagentName != null and reagentName != ''"> |
| | | and sr.name like concat('%',#{reagentName},'%') |
| | | </if> |
| | | <if test="houseName != null and houseName != ''"> |
| | | and ( l.name like concat('%',#{houseName},'%') or w.name like concat('%',#{houseName},'%') ) |
| | | </if> |
| | | <if test="startDate != null and startDate !=''"> |
| | | and oa.create_time >= #{startDate} |
| | | </if> |
| | | <if test="endDate != null and endDate !=''"> |
| | | and oa.create_time <= #{endDate} |
| | | </if> |
| | | <if test="operatestate != null and operatestate !=''"> |
| | | and oa.operatestate = #{operatestate} |
| | | </if> |
| | | <if test="containerCode != null and containerCode !=''"> |
| | | and wc.container_code = #{containerCode} |
| | | or lc.container_code =#{containerCode} |
| | | </if> |
| | | </sql> |
| | | |
| | | <sql id="queryColumns"> |
| | | select oa.*, |
| | | sr.*, |
| | | ors.article_number as articleNumber, |
| | | sr.id as reagentId, |
| | | su.name as userName, |
| | | ss.name as supplierName, |
| | | l.name as laboratoryName, |
| | | w.name as warehouseName, |
| | | lc.name as warehouseContainerName, |
| | | wc.name as laboratoryContainerName, |
| | | lc.container_code as warehouseContainerCode, |
| | | wc.container_code as laboratoryContainerCode, |
| | | bm1.meta_value as operatestateName |
| | | ors.article_number as article_number, |
| | | sr.id as reagent_id, |
| | | su.name as user_name, |
| | | ss.name as supplier_name, |
| | | l.name as laboratory_name, |
| | | w.name as warehouse_name, |
| | | lc.name as warehouse_container_name, |
| | | wc.name as laboratory_container_name, |
| | | lc.container_code as warehouse_container_code, |
| | | wc.container_code as laboratory_container_code, |
| | | </sql> |
| | | |
| | | <sql id="queryJoins"> |
| | |
| | | left join sys_warehouse w on w.id = wc.warehouse_id |
| | | left join sys_laboratory_container lc on lc.id = oa.container_id |
| | | left join sys_laboratory l on l.id = lc.laboratory_id |
| | | left join base_meta bm1 on bm1.id = oa.operatestate |
| | | </sql> |
| | | |
| | | <select id="getOpeUseFlowList" parameterType="java.util.Map" resultMap="OpeUseFlow"> |
| | | select oa.*, |
| | | sr.*, |
| | | ors.article_number as articleNumber, |
| | | sr.id as reagentId, |
| | | su.name as userName, |
| | | ss.name as supplierName, |
| | | l.name as laboratoryName, |
| | | w.name as warehouseName, |
| | | wc.name as warehouseContainerName, |
| | | lc.name as laboratoryContainerName, |
| | | wc.container_code as warehouseContainerCode, |
| | | lc.container_code as laboratoryContainerCode, |
| | | bm1.meta_value as operatestateName |
| | | ors.article_number as article_number, |
| | | sr.id as reagent_id, |
| | | su.name as user_name, |
| | | ss.name as supplier_name, |
| | | l.name as laboratory_name, |
| | | w.name as warehouse_name, |
| | | wc.name as warehouse_container_name, |
| | | lc.name as laboratory_container_name, |
| | | wc.container_code as warehouse_container_code, |
| | | lc.container_code as laboratory_container_code, |
| | | (CASE |
| | | WHEN oa.operatestate = 0 THEN '试剂柜入库' |
| | | WHEN oa.operatestate = 1 THEN '错误入库' |
| | | WHEN oa.operatestate = 2 THEN '领用' |
| | | WHEN oa.operatestate = 3 THEN '存放' |
| | | WHEN oa.operatestate = 4 THEN '错误存放' |
| | | WHEN oa.operatestate = 5 THEN '报废' |
| | | WHEN oa.operatestate = 6 THEN '转移' |
| | | WHEN oa.operatestate = 10 THEN '仓库入库' |
| | | WHEN oa.operatestate = 11 THEN '仓库领用' |
| | | END) operatestate_name |
| | | from ope_use_flow as oa |
| | | left join ope_reagent_status ors on ors.reagent_code = oa.reagent_code |
| | | left join sys_reagent sr on ors.reagent_id = sr.id |
| | |
| | | left join sys_warehouse w on w.id = wc.warehouse_id |
| | | left join sys_laboratory_container lc on lc.id = oa.container_id |
| | | left join sys_laboratory l on l.id = lc.laboratory_id |
| | | left join base_meta bm1 on bm1.id = oa.operatestate |
| | | where oa.valid_flag = 1 |
| | | <include refid="queryWhereSql"/> |
| | | order by oa.create_time desc |
| | |
| | | </select> |
| | | |
| | | <select id="getOpeUseFlowSimpleInfoList" parameterType="java.util.Map" resultMap="OpeUseFlow"> |
| | | select oa.id,oa.reagent_code,oa.create_time, |
| | | sr.id as reagentId,sr.name as name,sr.cas as cas, |
| | | su.name as userName, |
| | | l.name as laboratoryName, |
| | | w.name as warehouseName, |
| | | wc.name as warehouseContainerName, |
| | | lc.name as laboratoryContainerName, |
| | | wc.container_code as warehouseContainerCode, |
| | | lc.container_code as laboratoryContainerCode, |
| | | bm1.meta_value as operatestateName |
| | | select oa.*, |
| | | sr.id as reagent_id,sr.name as name,sr.cas as cas, |
| | | su.name as user_name, |
| | | l.name as laboratory_name, |
| | | w.name as warehouse_name, |
| | | wc.name as warehouse_container_name, |
| | | lc.name as laboratory_container_name, |
| | | wc.container_code as warehouse_container_code, |
| | | lc.container_code as laboratory_container_code |
| | | from ope_use_flow as oa |
| | | left join ope_reagent_status ors on ors.reagent_code = oa.reagent_code |
| | | left join sys_reagent sr on ors.reagent_id = sr.id |
| | |
| | | left join sys_warehouse w on w.id = wc.warehouse_id |
| | | left join sys_laboratory_container lc on lc.id = oa.container_id |
| | | left join sys_laboratory l on l.id = lc.laboratory_id |
| | | left join base_meta bm1 on bm1.id = oa.operatestate |
| | | where oa.valid_flag = 1 |
| | | <include refid="queryWhereSql"/> |
| | | order by oa.create_time desc |
| | | <if test="first != null and pageSize != null"> |
| | | limit #{first}, #{pageSize} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getOpeUseFlowSimpleInfoCount" parameterType="java.util.Map" resultType="long"> |
| | | select count(1) |
| | | from ope_use_flow as oa |
| | | left join ope_reagent_status ors on ors.reagent_code = oa.reagent_code |
| | | left join sys_reagent sr on ors.reagent_id = sr.id |
| | | left join sys_user as su on oa.user_id = su.id |
| | | left join sys_warehouse_container wc on wc.id = oa.container_id |
| | | left join sys_warehouse w on w.id = wc.warehouse_id |
| | | left join sys_laboratory_container lc on lc.id = oa.container_id |
| | | left join sys_laboratory l on l.id = lc.laboratory_id |
| | | where oa.valid_flag = 1 |
| | | <include refid="queryWhereSql"/> |
| | | </select> |
| | | |
| | | |
| | |
| | | ORDER BY create_time DESC |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="getRegentInfoFromReceiptNumber" resultType="java.util.Map"> |
| | | SELECT ors.reagent_id reagentId,count(ors.reagent_id) count |
| | | SELECT ors.reagent_id reagent_id,count(ors.reagent_id) count |
| | | from ope_use_flow ouf |
| | | LEFT JOIN ope_reagent_status ors on ors.reagent_code = ouf.reagent_code |
| | | WHERE ouf.receipt_number = #{0} |
| | |
| | | LEFT JOIN ope_reagent_status ors on ors.reagent_code = ouf.reagent_code |
| | | LEFT JOIN sys_reagent sr on sr.id = ors.reagent_id |
| | | left join base_meta bm1 on bm1.id = su.department |
| | | left join sys_project sp on sp.id=su.project_id |
| | | WHERE |
| | | (ouf.operatestate = #{operatestate} |
| | | or ouf.operatestate = #{operatestate1}) |
| | |
| | | and ouf.create_time <#{endTime} |
| | | </if> |
| | | <if test="project !=null and project != ''"> |
| | | and su.project like concat("%",#{project},"%") |
| | | and sp.project_name like concat("%",#{project},"%") |
| | | </if> |
| | | <if test="department !=null and department != ''"> |
| | | and su.bm1.meta_value like concat("%",#{department},"%") |
| | |
| | | group by ouf.receipt_number) a |
| | | </select> |
| | | <select id="selectPersonalUseInfo" resultType="com.nanometer.smartlab.entity.OpeUseFlow"> |
| | | SELECT ouf.receipt_number receiptNumber, |
| | | SELECT ouf.receipt_number receipt_number, |
| | | ouf.note, |
| | | count(ouf.reagent_code) applyNum, |
| | | count(ouf.reagent_code) apply_num, |
| | | su.name username, |
| | | su.project , |
| | | sp.project_name as project_name, |
| | | su.phone, |
| | | bm1.meta_value department, |
| | | sl.name laboratoryName, |
| | | ouf.create_time createTime, |
| | | ouf.house_id houseId |
| | | sl.name laboratory_name, |
| | | ouf.create_time create_time, |
| | | ouf.house_id house_id |
| | | FROM |
| | | ope_use_flow ouf |
| | | LEFT JOIN sys_user su on su.id = ouf.user_id |
| | | LEFT JOIN base_meta bm on bm.id = ouf.operatestate |
| | | LEFT JOIN ope_reagent_status ors on ors.reagent_code = ouf.reagent_code |
| | | LEFT JOIN sys_reagent sr on sr.id = ors.reagent_id |
| | | left join base_meta bm1 on bm1.id = su.department |
| | | left join sys_laboratory sl on sl.id = ouf.house_id |
| | | left join sys_project sp on sp.id=su.project_id |
| | | |
| | | WHERE |
| | | (ouf.operatestate = #{operatestate} |
| | |
| | | and ouf.create_time <#{endTime} |
| | | </if> |
| | | <if test="project !=null and project != ''"> |
| | | and su.project like concat("%",#{project},"%") |
| | | and su.project_name like concat("%",#{project},"%") |
| | | </if> |
| | | <if test="department !=null and department != ''"> |
| | | and su.bm1.meta_value like concat("%",#{department},"%") |
| | |
| | | </select> |
| | | <select id="getApplyInfo" resultType="com.nanometer.smartlab.entity.dto.PersonUseDetail"> |
| | | SELECT |
| | | ors.reagent_id reagentId, |
| | | ors.article_number articleNumber, |
| | | ouf.reagent_code reagentCode, |
| | | sr.product_sn productSn, |
| | | sr.NAME reagentName, |
| | | bm.meta_value reagentFormat, |
| | | CONCAT(sr.main_metering,bm1.meta_value) perInfo, |
| | | bm2.meta_value productHome, |
| | | bm3.meta_value controlProducts |
| | | ors.reagent_id reagent_id, |
| | | ors.article_number article_number, |
| | | ouf.reagent_code reagent_code, |
| | | sr.product_sn product_sn, |
| | | sr.NAME reagent_name, |
| | | sr.reagent_format reagent_format, |
| | | CONCAT(sr.main_metering,sr.reagent_unit) per_info, |
| | | sr.product_home product_home, |
| | | sr.control_products control_products |
| | | from `ope_use_flow` ouf |
| | | LEFT JOIN ope_reagent_status ors ON ors.reagent_code = ouf.reagent_code |
| | | LEFT join sys_reagent sr ON ors.reagent_id = sr.id |
| | | LEFT JOIN base_meta bm ON bm.id = sr.reagent_format |
| | | LEFT JOIN base_meta bm1 on bm1.id = sr.reagent_unit |
| | | LEFT JOIN base_meta bm2 on bm2.id = sr.product_home |
| | | LEFT JOIN base_meta bm3 on bm3.id = sr.control_products |
| | | WHERE |
| | | (ouf.operatestate = #{operatestate} |
| | | or ouf.operatestate = #{operatestate1}) |
| | |
| | | and operatestate =#{operateState} |
| | | and valid_flag = 1 |
| | | </select> |
| | | <select id="selectById" resultType="com.nanometer.smartlab.entity.OpeUseFlow"> |
| | | <select id="selectById" resultMap="OpeUseFlow"> |
| | | select * |
| | | from ope_use_flow |
| | | where id = #{id} |
| | | </select> |
| | | <select id="selectByReceiptNumber" resultType="com.nanometer.smartlab.entity.OpeUseFlow"> |
| | | SELECT ouf.receipt_number receiptNumber, |
| | | SELECT ouf.receipt_number receipt_number, |
| | | ouf.note, |
| | | count(ouf.reagent_code) applyNum, |
| | | count(ouf.reagent_code) apply_num, |
| | | su.name username, |
| | | su.project , |
| | | sp.project_name as project_name , |
| | | su.phone, |
| | | bm1.meta_value department, |
| | | sl.name laboratoryName, |
| | | ouf.create_time createTime, |
| | | ouf.house_id houseId |
| | | sl.name laboratory_name, |
| | | ouf.create_time create_time, |
| | | ouf.house_id house_id |
| | | FROM |
| | | ope_use_flow ouf |
| | | LEFT JOIN sys_user su on su.id = ouf.user_id |
| | |
| | | LEFT JOIN sys_reagent sr on sr.id = ors.reagent_id |
| | | left join base_meta bm1 on bm1.id = su.department |
| | | left join sys_laboratory sl on sl.id = ouf.house_id |
| | | left join sys_project sp on sp.id=su.project_id |
| | | <if test="userId !=null and userId != ''"> |
| | | LEFT JOIN sys_reagent sr2 on sr2.id = ouf.user_id |
| | | </if> |
| | |
| | | </select> |
| | | <select id="selectAll" resultType="java.util.Map"> |
| | | select |
| | | oa.reagent_code as reagentCode, |
| | | sr.`name` as reagentName, |
| | | CASE WHEN wc.container_code is NULL THEN lc.container_code ELSE wc.container_code END as laboratoryContainerCode, |
| | | bm1.meta_value as operatestateName, |
| | | CASE WHEN bm1.meta_value = '仓库入库' or bm1.meta_value='仓库领用' THEN NULL ELSE oa.remainder END as remainder, |
| | | CASE WHEN w.name is NULL THEN l.name ELSE w.name END as warehouseContainerName, |
| | | su.name as userName, |
| | | oa.create_time as createTime |
| | | oa.reagent_code as reagent_code, |
| | | sr.`name` as reagent_name, |
| | | CASE WHEN wc.container_code is NULL THEN lc.container_code ELSE wc.container_code END as laboratory_container_code, |
| | | (CASE |
| | | WHEN oa.operatestate = 0 THEN '试剂柜入库' |
| | | WHEN oa.operatestate = 1 THEN '错误入库' |
| | | WHEN oa.operatestate = 2 THEN '领用' |
| | | WHEN oa.operatestate = 3 THEN '存放' |
| | | WHEN oa.operatestate = 4 THEN '错误存放' |
| | | WHEN oa.operatestate = 5 THEN '报废' |
| | | WHEN oa.operatestate = 6 THEN '转移' |
| | | WHEN oa.operatestate = 10 THEN '仓库入库' |
| | | WHEN oa.operatestate = 11 THEN '仓库领用' |
| | | END) operatestate_name, |
| | | CASE WHEN oa.operatestate = 10 or oa.operatestate=11 THEN NULL ELSE oa.remainder END as remainder, |
| | | CASE WHEN w.name is NULL THEN l.name ELSE w.name END as warehouse_container_name, |
| | | su.name as user_name, |
| | | oa.create_time as create_time |
| | | from ope_use_flow as oa |
| | | left join ope_reagent_status ors on ors.reagent_code = oa.reagent_code |
| | | left join sys_reagent sr on ors.reagent_id = sr.id |
| | |
| | | left join sys_warehouse w on w.id = wc.warehouse_id |
| | | left join sys_laboratory_container lc on lc.id = oa.container_id |
| | | left join sys_laboratory l on l.id = lc.laboratory_id |
| | | left join base_meta bm1 on bm1.id = oa.operatestate |
| | | |
| | | where oa.valid_flag = 1 |
| | | <include refid="queryWhereSql"/> |
| | | order by oa.create_time desc |
| | |
| | | <select id="selectDetail" resultType="java.util.Map"> |
| | | |
| | | SELECT |
| | | sr.product_sn productSn, |
| | | sr.NAME reagentName, |
| | | ouf.reagent_code reagentCode, |
| | | bm3.meta_value controlProducts, |
| | | bm.meta_value reagentFormat, |
| | | CONCAT(sr.main_metering,bm1.meta_value) perInfo, |
| | | bm2.meta_value productHome, |
| | | ors.article_number articleNumber, |
| | | sr.product_sn product_sn, |
| | | sr.NAME reagent_name, |
| | | ouf.reagent_code reagent_code, |
| | | sr.control_products control_products, |
| | | sr.reagent_format reagent_format, |
| | | CONCAT(sr.main_metering,sr.reagent_unit) per_info, |
| | | sr.product_home product_home, |
| | | ors.article_number article_number, |
| | | su.name username, |
| | | su.project, |
| | | sp.project_name as project_name, |
| | | bm4.meta_value department, |
| | | sl.name location, |
| | | date_format(ouf.create_time,'%Y-%m-%d %H:%i') createTime |
| | | date_format(ouf.create_time,'%Y-%m-%d %H:%i') create_time |
| | | from `ope_use_flow` ouf |
| | | LEFT JOIN ope_reagent_status ors ON ors.reagent_code = ouf.reagent_code |
| | | LEFT join sys_reagent sr ON ors.reagent_id = sr.id |
| | | LEFT JOIN base_meta bm ON bm.id = sr.reagent_format |
| | | LEFT JOIN base_meta bm1 on bm1.id = sr.reagent_unit |
| | | LEFT JOIN base_meta bm2 on bm2.id = sr.product_home |
| | | LEFT JOIN base_meta bm3 on bm3.id = sr.control_products |
| | | LEFT JOIN sys_user as su on su.id = ouf.user_id |
| | | left join base_meta bm4 on bm4.id = su.department |
| | | LEFT JOIN sys_laboratory sl on sl.id = ouf.house_id |
| | | left join sys_project sp on sp.id =su.project_id |
| | | WHERE |
| | | (ouf.operatestate = #{operatestate} |
| | | or ouf.operatestate = #{operatestate1}) |
| | |
| | | and ouf.create_time <#{endTime} |
| | | </if> |
| | | <if test="project !=null and project != ''"> |
| | | and su.project like concat("%",#{project},"%") |
| | | and sp.project_name like concat("%",#{project},"%") |
| | | </if> |
| | | <if test="department !=null and department != ''"> |
| | | and su.bm1.meta_value like concat("%",#{department},"%") |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <insert id="insertOpeUseFlow" parameterType="com.nanometer.smartlab.entity.OpeUseFlow"> |
| | | insert into ope_use_flow(id, reagent_code, status, house_id, container_id, user_id, remainder, place, store_type, valid_flag, create_time, realstatus, operatestate,volume |
| | | <insert id="insertOpeUseFlow" parameterType="com.nanometer.smartlab.entity.OpeUseFlow" useGeneratedKeys = "true" keyProperty = "id"> |
| | | insert into ope_use_flow(reagent_code, status, house_id, container_id, user_id, remainder, place, store_type, valid_flag, create_time, realstatus, operatestate,volume |
| | | <if test="receiptNumber != null"> |
| | | ,receipt_number |
| | | </if> |
| | | ) |
| | | values (#{id}, #{reagentCode}, #{status}, #{houseId}, #{containerId}, #{userId}, #{remainder}, #{place}, #{storeType}, 1, #{createTime}, #{realstatus},#{operateState},#{volume} |
| | | values ( #{reagentCode}, #{status}, #{houseId}, #{containerId}, #{userId}, #{remainder}, #{place}, #{storeType}, 1, now(), #{realstatus},#{operateState},#{volume} |
| | | <if test="receiptNumber != null"> |
| | | ,#{receiptNumber} |
| | | </if>) |
| | | </insert> |
| | | |
| | | <insert id="batchInsertOpeUseFlow" > |
| | | insert into ope_use_flow(reagent_code, status, house_id, container_id, user_id, remainder, place, store_type, valid_flag, create_time, realstatus, operatestate,volume,receipt_number) |
| | | values |
| | | <foreach collection ="list" item="useFlow" separator =","> |
| | | ( #{useFlow.reagentCode}, #{useFlow.status}, #{useFlow.houseId}, #{useFlow.containerId}, #{useFlow.userId}, #{useFlow.remainder}, #{useFlow.place}, #{useFlow.storeType}, 1, now(), #{useFlow.realstatus},#{useFlow.operateState},#{useFlow.volume},#{useFlow.receiptNumber}) |
| | | </foreach > |
| | | </insert> |
| | | |
| | | <delete id="deleteByReagentCode" parameterType="java.lang.String" > |
| | | |
| | | <delete id="deleteByReagentCode" > |
| | | delete from ope_use_flow |
| | | where reagent_code=#{reagentCode} |
| | | </delete> |
| | |
| | | </delete> |
| | | |
| | | |
| | | <select id="getOpeUseFlowByCode2" resultMap="OpeUseFlow"> |
| | | select oa.*,su.name as user_name,w.name as warehouse_name,l.name as laboratory_name, wc.name as warehouse_container_name,lc.name as laboratory_container_name |
| | | from ope_use_flow as oa |
| | | left join sys_user su on oa.user_id = su.id |
| | | left join sys_warehouse_container wc on wc.id = oa.container_id |
| | | left join sys_warehouse w on w.id = oa.house_id |
| | | left join sys_laboratory_container lc on lc.id = oa.container_id |
| | | left join sys_laboratory l on l.id = lc.laboratory_id |
| | | where oa.valid_flag = 1 and oa.reagent_code=#{reagentCode} |
| | | order by oa.create_time desc |
| | | </select> |
| | | |
| | | <select id="getLastUseFlow" resultMap="OpeUseFlow"> |
| | | select * from ope_use_flow where reagent_code=#{reagentCode} order by create_time desc limit 1 |
| | | </select> |
| | | |
| | | <select id="getUseFlowByCodeAndStatus" resultMap="OpeUseFlow"> |
| | | select * from ope_use_flow where reagent_code=#{reagentCode} and operatestate=#{operateStatus} |
| | | </select> |
| | | |
| | | <select id="getUseFlowByCodeAndStatuses" resultMap="OpeUseFlow"> |
| | | select * from ope_use_flow where reagent_code=#{reagentCode} and operatestate in |
| | | <foreach collection ="operateStatuses" item="opestatus" separator ="," open="(" close=")"> |
| | | #{opestatus} |
| | | </foreach > |
| | | </select> |
| | | </mapper> |