lyfO_o
2021-10-28 f2d6527297ad1ae8aad6881d4c672e5bc9c1f908
src/main/java/com/nanometer/smartlab/dao/OpeApplyDao.xml
@@ -611,6 +611,85 @@
      )
    </select>
    <select id="getOpeApplySupplerRequireMngTotalCount" resultType="java.lang.Integer">
        select count(1)
        from ope_apply as oa
        left join sys_reagent sr on oa.reagent_id = sr.id
        left join sys_supplier as ss on sr.supplier_id = ss.id
        left join sys_user as su on oa.apply_user_id = su.id
        left join sys_user as suApprove on oa.approve_user_id = suApprove.id
        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
        left join base_meta as bm1 on bm1.id = sr.control_products
        where oa.valid_flag = 1
        <if test="isShow != null and isShow ==0">
            and (ss.valid_flag = 1 or sr.type = 0)
        </if>
        <if test="reagentName != null and reagentName != ''">
            and sr.name like concat("%",#{reagentName},"%")
        </if>
        <if test="startDeadline != null">
            and oa.deadline >= #{startDeadline}
        </if>
        <if test="endDeadline != null">
            and #{endDeadline} >= oa.deadline
        </if>
        <if test="status != null">
            and oa.status = #{status}
        </if>
        <if test="company != null and company != ''">
            and ss.name = #{company}
        </if>
    </select>
    <select id="getOpeApplySupplerRequireMngList" parameterType="java.util.Map" resultMap="OpeApply">
        select oa.*,sys.name as secondUserName,
        sr.name as reagentName,sr.price as reagentPrice ,sr.cas as reagentCas, sr.reagent_type as reagentType, sr.reagent_character as reagentCharacter, sr.supplier_id as reagentSupplierId,
        sr.reagent_format as reagentFormat, sr.main_metering as reagentMainMetering, sr.reagent_unit as reagentUnit, sr.per_box as reagentPerBox,
        sr.memo as reagentMemo, sr.valid_flag as reagentValidFlag, sr.create_time as reagentCreateTime, sr.update_time as reagentUpdateTime, sr.product_sn as reagentProductSn,
        sr.dangerous_flag as reagentDangerousFlag,sr.control_products as controlProducts,sr.product_home as productHome,
        ss.name as supplierName,
        su.name as applyUserName,
        suApprove.name as approveUserName,
        bm.meta_value as productHomeName,
        fir.name as firName,
        ss.valid_flag  as supplierFlag,
        sr.type as type
        from ope_apply as oa
        left join sys_reagent sr on oa.reagent_id = sr.id
        left join sys_supplier as ss on sr.supplier_id = ss.id
        left join sys_user as su on oa.apply_user_id = su.id
        left join sys_user as suApprove on oa.approve_user_id = suApprove.id
        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
        left join base_meta as bm1 on bm1.id = sr.control_products
        where oa.valid_flag = 1
        <if test="isShow != null and isShow ==0">
            and (ss.valid_flag = 1 or sr.type = 0)
        </if>
        <if test="company != null and company != ''">
            and ss.name = #{company}
        </if>
        <if test="reagentName != null and reagentName != ''">
            and sr.name like concat("%",#{reagentName},"%")
        </if>
        <if test="startDeadline != null">
            and oa.deadline >= #{startDeadline}
        </if>
        <if test="endDeadline != null">
            and #{endDeadline} >= oa.deadline
        </if>
        <if test="status != null">
            and oa.status = #{status}
        </if>
        order by oa.create_time desc
        <if test="first != null and pageSize != null">
            limit #{first}, #{pageSize}
        </if>
    </select>
    <update id="updateByReId" parameterType="java.util.Map">