智慧农业后台管理
guoshilong
2022-09-05 4e8eedbcaa35a3cce9e50dad54db9633e71d169f
src/main/java/org/springblade/modules/stockrecord/mapper/StockrecordMapper.xml
@@ -80,12 +80,24 @@
        LEFT JOIN (SELECT name, id FROM blade_user WHERE is_deleted = 0) a ON a.id = st.create_user
        LEFT JOIN ( SELECT agricultural_name,id FROM sys_stockfactory WHERE is_deleted = 0 ) f ON f.id = st.stock_id1
        WHERE st.is_deleted = 0
        <if test="stockrecord.agrname!=null and stockrecord.agrname != ''">
            and f.agricultural_name like concat ('%',#{stockrecord.agrname},'%')
        </if>
        <if test="stockrecord.stype!=null and stockrecord.stype != ''">
            and stf.type = #{stockrecord.stype}
        </if>
        <if test="stockrecord.sid!=null and stockrecord.sid != ''">
            and st.sid = #{stockrecord.sid}
        </if>
        <if test="stockrecord.deptId != null and stockrecord.deptId !=''">
            and st.dept_id = #{stockrecord.deptId}
        </if>
        <if test="stockrecord.startTime!=null and stockrecord.startTime!=''">
            and st.create_time &gt;= #{stockrecord.startTime}
        </if>
        <if test="stockrecord.endTime!=null and stockrecord.endTime!=''">
            and st.create_time &lt;= #{stockrecord.endTime}
        </if>
        ORDER BY st.create_time desc
    </select>