Commit a884f839 authored by 罗林杰's avatar 罗林杰

初始化出库管理,入库管理

parent b5d916a6
<?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="org.rcisoft.bus.storegoods.dao.StoreGoodsRepository">
<resultMap id="BaseResultMap" type="org.rcisoft.bus.storegoods.entity.StoreGoods">
<id column="business_id" jdbcType="INTEGER" property="businessId"/>
<result column="flag" jdbcType="CHAR" property="flag"/>
<result column="del_flag" jdbcType="CHAR" property="delFlag"/>
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
<result column="remarks" jdbcType="VARCHAR" property="remarks"/>
<result column="goods_name" jdbcType="VARCHAR" property="goodsName"/>
<result column="goods_dict_name" jdbcType="VARCHAR" property="goodsDictName"/>
<result column="goods_code" jdbcType="VARCHAR" property="goodsCode"/>
<result column="goods_style" jdbcType="VARCHAR" property="goodsStyle"/>
<result column="goods_art_number" jdbcType="VARCHAR" property="goodsArtNumber"/>
<result column="goods_season" jdbcType="VARCHAR" property="goodsSeason"/>
<result column="goods_colour" jdbcType="VARCHAR" property="goodsColour"/>
<result column="goods_norms" jdbcType="VARCHAR" property="goodsNorms"/>
<result column="goods_size" jdbcType="VARCHAR" property="goodsSize"/>
<result column="goods_brand" jdbcType="VARCHAR" property="goodsBrand"/>
<!--回显 入库/出库 列表-->
<result column="goods_counts" jdbcType="VARCHAR" property="goodsCounts"/>
</resultMap>
<insert id="insertOss">
insert into
wms_goods_oss(goods_id,oss_id)
values
<foreach collection="entity" item="item" separator=",">
(#{item.gid},#{item.oid})
</foreach>
</insert>
<delete id="delOssById">
delete
from wms_goods_oss wgo
where wgo.goods_id = #{entity.businessId}
</delete>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
<select id="queryWmsGoods" resultMap="BaseResultMap">
SELECT
wg.business_id,
wg.goods_name,
wg.goods_code,
sdd_goods_dict_name.dict_label AS goods_dict_name,
sdd_goods_art_number.dict_label AS goods_art_number,
sdd_goods_brand.dict_label AS goods_brand,
sdd_goods_season.dict_label AS goods_season,
sdd_goods_style.dict_label AS goods_style,
sdd_goods_colour.dict_label AS goods_colour,
sdd_goods_norms.dict_label AS goods_norms,
sdd_goods_size.dict_label AS goods_size
FROM
store_goods wg
LEFT JOIN
sys_dict_data sdd_goods_dict_name ON sdd_goods_dict_name.dict_type = 'GOODS_DICT_NAME' AND
sdd_goods_dict_name.dict_value = wg.goods_dict_name AND sdd_goods_dict_name.del_flag = '0'
LEFT JOIN
sys_dict_data sdd_goods_art_number ON sdd_goods_art_number.dict_type = 'GOODS_ART_NUMBER' AND
sdd_goods_art_number.dict_value = wg.goods_art_number AND sdd_goods_art_number.del_flag = '0'
LEFT JOIN
sys_dict_data sdd_goods_brand ON sdd_goods_brand.dict_type = 'GOODS_BRAND' AND sdd_goods_brand.dict_value =
wg.goods_brand AND sdd_goods_brand.del_flag = '0'
LEFT JOIN
sys_dict_data sdd_goods_season ON sdd_goods_season.dict_type = 'GOODS_SEASON' AND sdd_goods_season.dict_value =
wg.goods_season AND sdd_goods_season.del_flag = '0'
LEFT JOIN
sys_dict_data sdd_goods_style ON sdd_goods_style.dict_type = 'GOODS_STYLE' AND sdd_goods_style.dict_value =
wg.goods_style AND sdd_goods_style.del_flag = '0'
LEFT JOIN
sys_dict_data sdd_goods_colour ON sdd_goods_colour.dict_type = 'GOODS_COLOUR' AND sdd_goods_colour.dict_value =
wg.goods_colour AND sdd_goods_colour.del_flag = '0'
LEFT JOIN
sys_dict_data sdd_goods_norms ON sdd_goods_norms.dict_type = 'GOODS_NORMS' AND sdd_goods_norms.dict_value =
wg.goods_norms AND sdd_goods_norms.del_flag = '0'
LEFT JOIN
sys_dict_data sdd_goods_size ON sdd_goods_size.dict_type = 'GOODS_SIZE' AND sdd_goods_size.dict_value =
wg.goods_size AND sdd_goods_size.del_flag = '0'
where 1=1
and wg.del_flag = '0'
<if test="entity.flag !=null and entity.flag != '' ">
and flag = #{entity.flag}
</if>
<if test="entity.goodsName !=null and entity.goodsName != '' ">
and wg.goods_name like concat('%',#{entity.goodsName},'%')
</if>
<if test="entity.goodsDictName !=null and entity.goodsDictName != '' ">
and wg.goods_dict_name like concat('%',#{entity.goodsDictName},'%')
</if>
<if test="entity.goodsCode !=null and entity.goodsCode != '' ">
and wg.goods_code like concat('%',#{entity.goodsCode},'%')
</if>
<if test="entity.actualGoodsCode !=null and entity.actualGoodsCode != '' ">
and wg.goods_code = #{entity.actualGoodsCode}
</if>
<if test="entity.goodsStyle !=null and entity.goodsStyle != '' ">
and wg.goods_style like concat('%',#{entity.goods_style},'%')
</if>
<if test="entity.goodsArtNumber !=null and entity.goodsArtNumber != '' ">
and wg.goods_art_number like concat('%',#{entity.goodsArtNumber},'%')
</if>
<if test="entity.goodsSeason !=null and entity.goodsSeason != '' ">
and wg.goods_season like concat('%',#{entity.goodsSeason},'%')
</if>
<if test="entity.goodsColour !=null and entity.goodsColour != '' ">
and wg.goods_colour like concat('%',#{entity.goodsColour},'%')
</if>
<if test="entity.goodsNorms !=null and entity.goodsNorms != '' ">
and wg.goods_norms like concat('%',#{entity.goodsNorms},'%')
</if>
<if test="entity.goodsSize !=null and entity.goodsSize != '' ">
and wg.goods_size like concat('%',#{entity.goodsSize},'%')
</if>
<if test="entity.goodsBrand !=null and entity.goodsBrand != '' ">
and wg.goods_brand like concat('%',#{entity.goodsBrand},'%')
</if>
ORDER BY wg.business_id DESC
</select>
<select id="queryWmsGoodssPaged" resultMap="BaseResultMap">
SELECT
wg.*,
wgs.goods_counts
FROM
store_goods wg
LEFT JOIN wms_goods_stock wgs ON wg.business_id = wgs.goods_id
WHERE
wg.del_flag = '0'
<if test="entity.flag !=null and entity.flag != '' ">
and wg.flag = #{entity.flag}
</if>
<if test="entity.goodsName !=null and entity.goodsName != '' ">
and wg.goods_name like concat('%',#{entity.goodsName},'%')
</if>
<if test="entity.goodsDictName !=null and entity.goodsDictName != '' ">
and wg.goods_dict_name like concat('%',#{entity.goodsDictName},'%')
</if>
<if test="entity.goodsCode !=null and entity.goodsCode != '' ">
and wg.goods_code = #{entity.goodsCode}
</if>
<if test="entity.goodsStyle !=null and entity.goodsStyle != '' ">
and wg.goods_style like concat('%',#{entity.goodsStyle},'%')
</if>
<if test="entity.goodsArtNumber !=null and entity.goodsArtNumber != '' ">
and wg.goods_art_number like concat('%',#{entity.goodsArtNumber},'%')
</if>
<if test="entity.goodsSeason !=null and entity.goodsSeason != '' ">
and wg.goods_season like concat('%',#{entity.goodsSeason},'%')
</if>
<if test="entity.goodsColour !=null and entity.goodsColour != '' ">
and wg.goods_colour like concat('%',#{entity.goodsColour},'%')
</if>
<if test="entity.goodsNorms !=null and entity.goodsNorms != '' ">
and wg.goods_norms like concat('%',#{entity.goodsNorms},'%')
</if>
<if test="entity.goodsSize !=null and entity.goodsSize != '' ">
and wg.goods_size like concat('%',#{entity.goodsSize},'%')
</if>
<if test="entity.goodsBrand !=null and entity.goodsBrand != '' ">
and wg.goods_brand like concat('%',#{entity.goodsBrand},'%')
</if>
ORDER BY business_id DESC
</select>
<select id="queryWmsGoodsByAppId" resultMap="BaseResultMap">
SELECT log.goods_counts as inCounts,
wg.business_id,
wg.goods_name,
wg.goods_code,
sdd_goods_dict_name.dict_label AS goods_dict_name,
sdd_goods_art_number.dict_label AS goods_art_number,
sdd_goods_brand.dict_label AS goods_brand,
sdd_goods_season.dict_label AS goods_season,
sdd_goods_style.dict_label AS goods_style,
sdd_goods_colour.dict_label AS goods_colour,
sdd_goods_norms.dict_label AS goods_norms,
sdd_goods_size.dict_label AS goods_size
FROM wms_goods_log log
LEFT JOIN store_goods wg ON log.goods_id = wg.business_id
LEFT JOIN
sys_dict_data sdd_goods_dict_name ON sdd_goods_dict_name.dict_type = 'GOODS_DICT_NAME' AND
sdd_goods_dict_name.dict_value = wg.goods_dict_name AND sdd_goods_dict_name.del_flag = '0'
LEFT JOIN
sys_dict_data sdd_goods_art_number ON sdd_goods_art_number.dict_type = 'GOODS_ART_NUMBER' AND
sdd_goods_art_number.dict_value = wg.goods_art_number AND sdd_goods_art_number.del_flag = '0'
LEFT JOIN
sys_dict_data sdd_goods_brand ON sdd_goods_brand.dict_type = 'GOODS_BRAND' AND sdd_goods_brand.dict_value =
wg.goods_brand AND sdd_goods_brand.del_flag = '0'
LEFT JOIN
sys_dict_data sdd_goods_season ON sdd_goods_season.dict_type = 'GOODS_SEASON' AND sdd_goods_season.dict_value =
wg.goods_season AND sdd_goods_season.del_flag = '0'
LEFT JOIN
sys_dict_data sdd_goods_style ON sdd_goods_style.dict_type = 'GOODS_STYLE' AND sdd_goods_style.dict_value =
wg.goods_style AND sdd_goods_style.del_flag = '0'
LEFT JOIN
sys_dict_data sdd_goods_colour ON sdd_goods_colour.dict_type = 'GOODS_COLOUR' AND sdd_goods_colour.dict_value =
wg.goods_colour AND sdd_goods_colour.del_flag = '0'
LEFT JOIN
sys_dict_data sdd_goods_norms ON sdd_goods_norms.dict_type = 'GOODS_NORMS' AND sdd_goods_norms.dict_value =
wg.goods_norms AND sdd_goods_norms.del_flag = '0'
LEFT JOIN
sys_dict_data sdd_goods_size ON sdd_goods_size.dict_type = 'GOODS_SIZE' AND sdd_goods_size.dict_value =
wg.goods_size AND sdd_goods_size.del_flag = '0'
where log.apply_id = #{entity.businessId}
</select>
<select id="findByIdGoods" resultMap="BaseResultMap">
select wg.*,oi.url from wms_goods_oss wgo join store_goods wg on wg.business_id = wgo.goods_id
join oss_info oi on wgo.oss_id = oi.business_id
where 1=1
and wg.del_flag = '0' and oi.del_flag = '0'
<if test="entity.flag !=null and entity.flag != '' ">
and wg.flag = #{entity.flag}
</if>
<if test="entity.goodsName !=null and entity.goodsName != '' ">
and wg.goods_name like concat('%',#{entity.goodsName},'%')
</if>
<if test="entity.goodsDictName !=null and entity.goodsDictName != '' ">
and wg.goods_dict_name like concat('%',#{entity.goodsDictName},'%')
</if>
<if test="entity.goodsCode !=null and entity.goodsCode != '' ">
and wg.goods_code = #{entity.goodsCode}
</if>
<if test="entity.goodsStyle !=null and entity.goodsStyle != '' ">
and wg.goods_style like concat('%',#{entity.goodsStyle},'%')
</if>
<if test="entity.goodsArtNumber !=null and entity.goodsArtNumber != '' ">
and wg.goods_art_number like concat('%',#{entity.goodsArtNumber},'%')
</if>
<if test="entity.goodsSeason !=null and entity.goodsSeason != '' ">
and wg.goods_season like concat('%',#{entity.goodsSeason},'%')
</if>
<if test="entity.goodsColour !=null and entity.goodsColour != '' ">
and wg.goods_colour like concat('%',#{entity.goodsColour},'%')
</if>
<if test="entity.goodsNorms !=null and entity.goodsNorms != '' ">
and wg.goods_norms like concat('%',#{entity.goodsNorms},'%')
</if>
<if test="entity.goodsSize !=null and entity.goodsSize != '' ">
and wg.goods_size like concat('%',#{entity.goodsSize},'%')
</if>
<if test="entity.goodsBrand !=null and entity.goodsBrand != '' ">
and wg.goods_brand like concat('%',#{entity.goodsBrand},'%')
</if>
ORDER BY business_id DESC
</select>
<select id="findOss" resultType="org.rcisoft.sys.ossInfo.entity.OssInfo">
select oi.*
from wms_goods_oss wgo
join store_goods wg on wg.business_id = wgo.goods_id
join oss_info oi on wgo.oss_id = oi.business_id
where 1 = 1
and wg.del_flag = '0'
and oi.del_flag = '0'
and wgo.goods_id = #{entity.businessId}
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment