智慧农业后台管理
guoshilong
2022-08-04 7b93bac497d5b698bb4d852dbd25c6397eaea0f2
src/main/java/org/springblade/modules/InventoryLoss/mapper/InventoryMapper.xml
@@ -6,19 +6,21 @@
    <resultMap id="inventoryResultMap" type="org.springblade.modules.InventoryLoss.vo.InventoryVO">
        <result column="id" property="id"/>
        <result column="strain_name" property="strainName"/>
        <result column="dict_value" property="reasonName"/>
    </resultMap>
    <select id="selectSalePage" resultMap="inventoryResultMap">
        select inventory.*,
               strain.strain_name
               strain.strain_name,bdb.dict_value
        from sys_inventory inventory
        LEFT JOIN sys_strain strain on inventory.strain_id = strain.id
        LEFT JOIN blade_dict_biz bdb ON inventory.reason = bdb.dict_key
        where
        <if test="inventory.strainId !=null and inventory.strainId != '' ">
            inventory.strain_id = #{inventory.strainId} AND
        </if>
              is_deleted = 0
              bdb.code = "lossReason" AND inventory.is_deleted = 0
    </select>
</mapper>