| | |
| | | <result property="used" column="used"></result> |
| | | <result property="status" column="status" typeHandler="com.nanometer.smartlab.entity.handler.ApplyStatusHandler"></result> |
| | | <result property="applyUserId" column="apply_user_id"></result> |
| | | <result property="projectManage" column="projectManage"/> |
| | | <result property="project" column="project"/> |
| | | <association property="reagent" javaType="com.nanometer.smartlab.entity.SysReagent"> |
| | | <id property="id" column="reagent_id"></id> |
| | | <result property="name" column="reagentName"></result> |
| | |
| | | <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> |
| | | </sql> |
| | | |
| | | <select id="getOpeApplyReserveTotalCount" parameterType="java.util.Map" |
| | |
| | | <select id="getOpeApplyReserveTotalCountFor" parameterType="java.util.Map" |
| | | resultType="int"> |
| | | select count(1) |
| | | from |
| | | (select count(1) |
| | | from ope_apply as oa |
| | | <include refid="getOpeApplyReserveList_queryJoins1" /> |
| | | 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 |
| | | 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" /> |
| | | GROUP BY oa.id |
| | | )as oaa |
| | | </select> |
| | | |
| | | <select id="getOpeApplyReserveList" parameterType="java.util.Map" |
| | |
| | | <include refid="getOpeApplyReserveList_queryJoins2" /> |
| | | where oa.valid_flag = 1 |
| | | <include refid="getOpeApplyReserveList_queryWhereSql" /> |
| | | |
| | | GROUP BY oa.id |
| | | order by oa.update_time desc |
| | | <if test="first != null and pageSize != null"> |
| | | limit #{first}, #{pageSize} |
| | |
| | | |
| | | <select id="getOpeApplyReserveListFor" parameterType="java.util.Map" |
| | | resultMap="OpeApplyReserve"> |
| | | <include refid="getOpeApplyReserveList_queryColumns" /> |
| | | from ope_apply as oa |
| | | <include refid="getOpeApplyReserveList_queryJoins1" /> |
| | | <include refid="getOpeApplyReserveList_queryJoins2" /> |
| | | 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, |
| | | su.`name` apply_user_id, |
| | | su.project, |
| | | su1.`name` as projectManage |
| | | 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 |
| | | 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" /> |
| | | |
| | | GROUP BY oa.id |
| | | order by oa.update_time desc |
| | | <if test="first != null and pageSize != null"> |
| | | limit #{first}, #{pageSize} |