123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.yh.saas.plugin.yiliangyiyun.mapper.WarehousePositionStorageInfoMapper">
- <select id="selectSumStoreage" parameterType="Map" resultType="java.lang.Double">
- SELECT
- sum(a.`storage`)
- FROM
- warehouse_position_storage_info a
- left join warehouse_position_info wpi on wpi.id = a.position_id and wpi.delete_flag = 0
- left join warehouse_base_info wbi on wbi.id = wpi.base_id and wbi.delete_flag = 0
- WHERE
- a.delete_flag = 0
- and wbi.comp_id = #{compId}
- <if test="jointVentureParties != null">
- AND wbi.joint_venture_parties = #{jointVentureParties}
- </if>
- </select>
- <select id="selectSumWare" parameterType="Map" resultType="java.lang.Double">
- SELECT
- sum(a.`storage`)
- FROM
- warehouse_position_storage_info a
- left join warehouse_position_info wpi on wpi.id = a.position_id and wpi.delete_flag = 0
- left join warehouse_base_info wbi on wbi.id = wpi.base_id and wbi.delete_flag = 0
- WHERE
- a.delete_flag = 0
- and
- wbi.id = #{baseId}
- and wbi.comp_id = #{compId}
- </select>
- <select id="selectSumWareNew" parameterType="Map" resultType="java.lang.Double">
- SELECT
- sum( wioi.net_weight )
- FROM
- warehouse_in_out_info wioi
- LEFT JOIN warehouse_base_info wbi ON wbi.id = wioi.base_id
- AND wbi.delete_flag = 0
- WHERE
- wioi.delete_flag = 0
- <if test="baseId != null">
- and wbi.id = #{baseId}
- </if>
- <if test="jointVentureParties != null">
- and wbi.joint_venture_parties = #{jointVentureParties}
- </if>
- and wbi.comp_id = #{compId}
- and wioi.in_out_flag = #{flag}
- <if test="seachMoth != null and seachMoth != ''">
- and wioi.create_date >= #{seachMoth}
- and wbi.create_date >= #{seachMoth}
- </if>
- <!-- <if test="type != null and type != ''">-->
- -- group by
- -- wioi.goods_name
- <!-- </if>-->
- </select>
- <select id="selectSumWareNewByGoods" parameterType="Map"
- resultType="com.yh.saas.plugin.yiliangyiyun.entity.view.BiViewInfo">
- SELECT
- wioi.goods_name as name,
- sum( wioi.net_weight ) as weight
- FROM
- warehouse_in_out_info wioi
- LEFT JOIN warehouse_base_info wbi ON wbi.id = wioi.base_id
- AND wbi.delete_flag = 0
- WHERE
- wioi.delete_flag = 0
- <if test="baseId != null">
- and wbi.id = #{baseId}
- </if>
- <if test="jointVentureParties != null">
- and wbi.joint_venture_parties = #{jointVentureParties}
- </if>
- and wbi.comp_id = #{compId}
- and wioi.in_out_flag = #{flag}
- <if test="seachMoth != null and seachMoth != ''">
- and wioi.create_date >= #{seachMoth}
- and wbi.create_date >= #{seachMoth}
- </if>
- group by
- wioi.goods_name
- </select>
- <select id="selectSumWareChaoByGoods" parameterType="Map"
- resultType="com.yh.saas.plugin.yiliangyiyun.entity.view.BiViewInfo">
- SELECT
- wioi.goods_name as name,
- sum( wioi.pure_weight ) as weight
- FROM
- warehouse_in_out_info wioi
- LEFT JOIN warehouse_base_info wbi ON wbi.id = wioi.base_id
- AND wbi.delete_flag = 0
- WHERE
- wioi.delete_flag = 0
- and
- wioi.status_flag = '3'
- and
- locate('潮粮', wioi.goods_name)
- <if test="baseId != null">
- and wbi.id = #{baseId}
- </if>
- <if test="jointVentureParties != null">
- and wbi.joint_venture_parties = #{jointVentureParties}
- </if>
- and wbi.comp_id = #{compId}
- and wioi.in_out_flag = #{flag}
- <if test="seachMoth != null and seachMoth != ''">
- and wioi.create_date >= #{seachMoth}
- and wbi.create_date >= #{seachMoth}
- </if>
- group by
- wioi.goods_name
- </select>
- <select id="getQuantityZhe" parameterType="Map"
- resultType="com.yh.saas.plugin.yiliangyiyun.entity.view.WarehouseNumView">
- SELECT
- REPLACE(wioi.goods_name,'(潮粮)','') as goodsName,
- ifnull(sum( case when wioi.goods_name like '%潮粮%' and wioi.type = '潮粮' then wioi.pure_weight else wioi.net_weight end ),0) as pureWeight
- FROM
- warehouse_in_out_info wioi
- LEFT JOIN warehouse_base_info wbi ON wbi.id = wioi.base_id
- AND wbi.delete_flag = 0
- WHERE
- wioi.delete_flag = 0
- and wbi.comp_id = #{compId}
- and
- wioi.status_flag = '3'
- <if test="baseId != null">
- and wbi.id = #{baseId}
- </if>
- and wioi.in_out_flag = #{flag}
- and wioi.in_out_type not like '%折%'
- <if test="seachMoth != null and seachMoth != ''">
- and wioi.create_date >= #{seachMoth}
- and wbi.create_date >= #{seachMoth}
- </if>
- group by
- REPLACE(wioi.goods_name,'(潮粮)','')
- </select>
- <select id="getQuantityHong" resultType="com.yh.saas.plugin.yiliangyiyun.entity.view.WarehouseNumView">
- SELECT
- REPLACE(wioi.goods_name,'(潮粮)','') as goodsName,
- ifnull(sum( case when wioi.goods_name like '%潮粮%' and wioi.type = '潮粮' then wioi.pure_weight else wioi.net_weight end ),0) as pureWeight
- FROM
- warehouse_in_out_info wioi
- LEFT JOIN warehouse_base_info wbi ON wbi.id = wioi.base_id
- AND wbi.delete_flag = 0
- left join in_out_warehouse_task iowt on iowt.in_out_task_no = wioi.in_out_task_no and iowt.delete_flag = 0
- WHERE
- wioi.delete_flag = 0
- and iowt.task_flag = '烘干入库'
- and wbi.comp_id = #{compId}
- and
- wioi.status_flag = '3'
- <if test="baseId != null">
- and wbi.id = #{baseId}
- </if>
- and wioi.in_out_flag = #{flag}
- and wioi.in_out_type not like '%折%'
- <if test="seachMoth != null and seachMoth != ''">
- and wioi.create_date >= #{seachMoth}
- and wbi.create_date >= #{seachMoth}
- </if>
- group by
- REPLACE(wioi.goods_name,'(潮粮)','')
- </select>
- </mapper>
|