智慧农业后台管理
guoshilong
2022-10-15 97da879dc16dffb2fbcc7447dee7db819049fa02
src/main/java/org/springblade/modules/stockfactory/mapper/StockfactoryMapper.xml
@@ -20,7 +20,42 @@
    <select id="selectStockfactoryPage" resultMap="stockfactoryResultMap">
        select * from sys_stockfactory where is_deleted = 0
        select *
        from sys_stockfactory
        where is_deleted = 0
        <if test="stockfactory.agriculturalName !=null and stockfactory.agriculturalName!= '' ">
            AND agricultural_name LIKE CONCAT('%',#{stockfactory.agriculturalName},'%')
        </if>
        <if test="stockfactory.type != null and stockfactory.type !='' or stockfactory.type ==0 ">
            AND type = #{stockfactory.type}
        </if>
    </select>
    <select id="selectStockfactoryPages" resultMap="stockfactoryResultMap">
        select *
        from sys_stockfactory
        where is_deleted = 0
    </select>
    <select id="selectStockFa" resultType="java.util.HashMap">
        select id as dictKey, agricultural_name as dictValue
        from sys_stockfactory
        where is_deleted = 0
    </select>
    <!--小程序农资列表-->
    <select id="selectStockIn" resultType="java.util.HashMap">
        SELECT DISTINCT s.id                AS id,
               s.agricultural_name AS agrname,
               s.factory_name      AS factoryname,
               c.dict_value        AS dic
        FROM sys_stockfactory s
                 LEFT JOIN (SELECT dict_key, dict_value
                            FROM blade_dict_biz
                            WHERE CODE = 'stockType' AND is_deleted = 0) c ON c.dict_key = s.type
        WHERE is_deleted = 0
        <if test="name!=null and name!=''">
            and (s.agricultural_name like  concat('%',#{name},'%') or s.register_number like  concat('%',#{name},'%') )
        </if>
    </select>
</mapper>