智慧农业后台管理
zengh
2022-08-01 d95f6551e8214d69cd0fd511ec693641eb61ba16
src/main/java/org/springblade/modules/InventoryLoss/mapper/InventoryMapper.xml
@@ -3,16 +3,22 @@
<mapper namespace="org.springblade.modules.InventoryLoss.mapper.InventoryMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="inventoryResultMap" type="org.springblade.modules.InventoryLoss.entity.Inventory">
    <resultMap id="inventoryResultMap" type="org.springblade.modules.InventoryLoss.vo.InventoryVO">
        <result column="id" property="id"/>
        <result column="strain_name" property="strainName"/>
    </resultMap>
    <select id="selectSalePage" resultMap="inventoryResultMap">
        select *
        from sys_inventory
        where is_deleted = 0
        select inventory.*,
               strain.strain_name
        from sys_inventory inventory
        LEFT JOIN sys_strain strain on inventory.strain_id = strain.id
        where
        <if test="inventory.strainId !=null and inventory.strainId != '' ">
            inventory.strain_id = #{inventory.strainId} AND
        </if>
              is_deleted = 0
    </select>
</mapper>