智慧农业后台管理
tangzy
2022-06-15 e71881a6ade967e45ba62b802028e2a2d2dfdee0
src/main/java/org/springblade/modules/soldr/mapper/SoldrMapper.xml
@@ -23,13 +23,16 @@
    <select id="selectSoldrPage" resultMap="soldrResultMap">
        select * from sys_soldr where is_deleted = 0
        select *
        from sys_soldr
        where is_deleted = 0
    </select>
    <select id="selectLists" resultType="org.springblade.modules.soldr.vo.SoldrVO">
        SELECT st.stock_id1,
        st.specs1,
        st.amount1  AS amount1,
        st.sid,
        st.amount1 AS amount1,
        stf.factory_name AS factoryName,
        a.dict_value AS stype,
        d.dict_value AS dic1,
@@ -39,11 +42,17 @@
        LEFT JOIN sys_stockfactory stf ON stf.id = st.stock_id1
        LEFT JOIN (SELECT dict_key, dict_value
        FROM blade_dict_biz
        WHERE CODE = 'stockSpecs1' AND is_deleted = 0) d ON d.dict_key = st.specs_val1
        WHERE CODE = 'stockSpecs1' AND is_deleted = 0 <if test="soldr.codes!=null and soldr.codes != ''">
        AND blade_dict_biz.tenant_id = #{soldr.codes}
    </if>) d ON d.dict_key = st.specs_val1
        LEFT JOIN (SELECT dict_key, dict_value
        FROM blade_dict_biz
        WHERE CODE = 'stockSpecs2' AND is_deleted = 0) c ON c.dict_key = st.specs_val2
        LEFT JOIN ( SELECT dict_key, dict_value FROM blade_dict_biz WHERE CODE = 'stockType' AND is_deleted = 0 ) a ON
        WHERE CODE = 'stockSpecs2' AND is_deleted = 0 <if test="soldr.codes!=null and soldr.codes != ''">
        AND blade_dict_biz.tenant_id = #{soldr.codes}
    </if>) c ON c.dict_key = st.specs_val2
        LEFT JOIN ( SELECT dict_key, dict_value FROM blade_dict_biz WHERE CODE = 'stockType' AND is_deleted = 0  <if test="soldr.codes!=null and soldr.codes != ''">
        AND blade_dict_biz.tenant_id = #{soldr.codes}
    </if>) a ON
        a.dict_key = stf.type
        WHERE st.is_deleted = 0
        <if test="soldr.stype!=null and soldr.stype != ''">
@@ -55,6 +64,8 @@
    </select>
    <delete id="del">
        delete from  sys_soldr where  sid=#{id}
        delete
        from sys_soldr
        where sid = #{id}
    </delete>
</mapper>