You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
440 lines
16 KiB
440 lines
16 KiB
<?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.dxhy.order.consumer.dao.GroupCommodityCodeMapper">
|
|
<resultMap id="commodityCodeResultMap" type="com.dxhy.order.baseservice.module.commodity.model.CommodityCodeEntity">
|
|
<id column="id" jdbcType="VARCHAR" property="id"/>
|
|
<result column="commodity_id" jdbcType="VARCHAR" property="commodityId"/>
|
|
<result column="sort_id" jdbcType="BIGINT" property="sortId"/>
|
|
<result column="xhf_nsrsbh" jdbcType="VARCHAR" property="xhfNsrsbh"/>
|
|
<result column="merchandise_name" jdbcType="VARCHAR" property="xmmc"/>
|
|
<result column="encoding" jdbcType="VARCHAR" property="zxbm"/>
|
|
<result column="tax_items" jdbcType="VARCHAR" property="spsm"/>
|
|
<result column="brief_code" jdbcType="VARCHAR" property="spjm"/>
|
|
<result column="tax_rate" jdbcType="VARCHAR" property="sl"/>
|
|
<result column="specification_model" jdbcType="VARCHAR" property="ggxh"/>
|
|
<result column="metering_unit" jdbcType="VARCHAR" property="xmdw"/>
|
|
<result column="unit_price" jdbcType="VARCHAR" property="xmdj"/>
|
|
<result column="tax_logo" jdbcType="VARCHAR" property="hsbz"/>
|
|
<result column="hide_the_logo" jdbcType="VARCHAR" property="ycbz"/>
|
|
<result column="enjoy_preferential_policies" jdbcType="VARCHAR" property="yhzcbs"/>
|
|
<result column="tax_class_code" jdbcType="VARCHAR" property="spbm"/>
|
|
<result column="tax_classification_name" jdbcType="VARCHAR" property="ssflMc"/>
|
|
<result column="preferential_policies_type" jdbcType="VARCHAR" property="lslbs"/>
|
|
<result column="zzstsgl" jdbcType="VARCHAR" property="zzstsgl"/>
|
|
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
|
<result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime"/>
|
|
<result column="modify_user_id" jdbcType="CHAR" property="modifyUserId"/>
|
|
<result column="group_id" jdbcType="VARCHAR" property="groupId"/>
|
|
<result column="group_name" jdbcType="VARCHAR" property="groupName"/>
|
|
<result column="enterprise_name" jdbcType="VARCHAR" property="xhfMc"/>
|
|
<result column="data_source" jdbcType="VARCHAR" property="dataSource"/>
|
|
<result column="matching_state" jdbcType="VARCHAR" property="matchingState"/>
|
|
<result column="data_state" jdbcType="VARCHAR" property="dataState"/>
|
|
<result column="tax_class_abbreviation" jdbcType="VARCHAR" property="spjc"/>
|
|
<result column="description" jdbcType="VARCHAR" property="bz"/>
|
|
<result column="collect_ident" jdbcType="VARCHAR" property="collectIdent"/>
|
|
<result column="cpy" jdbcType="VARCHAR" property="cpy"/>
|
|
<result column="bmb_bbh" jdbcType="VARCHAR" property="bmbBbh"/>
|
|
<result column="jdc" jdbcType="VARCHAR" property="jdc"/>
|
|
<result column="wlflbm" jdbcType="VARCHAR" property="wlflbm"/>
|
|
<result column="wlflmc" jdbcType="VARCHAR" property="wlflmc"/>
|
|
<result column="ent_id" jdbcType="VARCHAR" property="entId"/>
|
|
<result column="tswl" jdbcType="VARCHAR" property="tswl"/>
|
|
</resultMap>
|
|
|
|
<sql id="Base_Column_List">
|
|
id
|
|
, commodity_id, sort_id, xhf_nsrsbh, merchandise_name,encoding, tax_items, brief_code,
|
|
tax_rate, specification_model, metering_unit, unit_price, tax_logo, hide_the_logo,
|
|
enjoy_preferential_policies, tax_class_code, tax_classification_name, preferential_policies_type,zzstsgl,
|
|
user_id, create_time, modify_time, modify_user_id, group_id,enterprise_name,data_source,
|
|
matching_state,data_state,tax_class_abbreviation,description,collect_ident,cpy,bmb_bbh,jdc,wlflbm,wlflmc,ent_id,tswl
|
|
</sql>
|
|
|
|
<sql id="baseSelect">
|
|
SELECT cc.id,
|
|
cc.commodity_id,
|
|
cc.sort_id,
|
|
cc.xhf_nsrsbh,
|
|
cc.merchandise_name,
|
|
cc.tax_items,
|
|
cc.brief_code,
|
|
cc.tax_rate,
|
|
cc.specification_model,
|
|
cc.metering_unit,
|
|
cc.unit_price,
|
|
cc.tax_logo,
|
|
cc.hide_the_logo,
|
|
cc.enjoy_preferential_policies,
|
|
cc.tax_class_code,
|
|
cc.tax_classification_name,
|
|
cc.preferential_policies_type,
|
|
cc.zzstsgl,
|
|
cc.user_id,
|
|
cc.create_time,
|
|
cc.modify_time,
|
|
cc.modify_user_id,
|
|
cc.encoding,
|
|
cc.group_id,
|
|
cc.enterprise_name,
|
|
cc.data_source,
|
|
cc.matching_state,
|
|
cc.data_state,
|
|
cc.tax_class_abbreviation,
|
|
cc.description,
|
|
cc.cpy,
|
|
cc.jdc,
|
|
cc.bmb_bbh,
|
|
gc.group_name,
|
|
cc.wlflbm,
|
|
cc.wlflmc,
|
|
cc.ent_id,
|
|
cc.tswl
|
|
FROM commodity_code cc
|
|
LEFT JOIN group_commodity gc
|
|
ON gc.id = cc.group_id
|
|
</sql>
|
|
|
|
|
|
<!-- 查询集团物料库 -->
|
|
<select id="queryGroupCommodityCodeList" resultMap="commodityCodeResultMap">
|
|
<bind name="dataType" value="${dataType}"/>
|
|
<include refid="baseSelect"/>
|
|
<where>
|
|
<if test="wlflbm != null and wlflbm != ''">
|
|
AND cc.wlflbm LIKE CONCAT('%',#{wlflbm},'%')
|
|
</if>
|
|
<if test="wlflmc != null and wlflmc != ''">
|
|
AND cc.wlflmc LIKE CONCAT('%',#{wlflmc},'%')
|
|
</if>
|
|
<if test="zxbm != null and zxbm != ''">
|
|
AND cc.encoding LIKE CONCAT('%',#{zxbm},'%')
|
|
</if>
|
|
<if test="xmmc != null and xmmc != ''">
|
|
AND cc.merchandise_name LIKE CONCAT('%',#{xmmc},'%')
|
|
</if>
|
|
AND cc.xhf_nsrsbh = '-1'
|
|
</where>
|
|
|
|
ORDER BY cc.create_time DESC
|
|
</select>
|
|
|
|
<select id="queryCommodityCodeByZxbmAndXhfNsrsbh" resultMap="commodityCodeResultMap">
|
|
<bind name="dataType" value="${dataType}"/>
|
|
<include refid="baseSelect"/>
|
|
where cc.encoding = #{zxbm}
|
|
<if test="xhfNsrsbh != null and xhfNsrsbh != ''">
|
|
AND cc.xhf_nsrsbh = #{xhfNsrsbh}
|
|
</if>
|
|
ORDER BY cc.create_time DESC limit 1
|
|
</select>
|
|
|
|
<select id="queryCommodityCodeByXmmcInChildCompany" resultMap="commodityCodeResultMap">
|
|
<bind name="dataType" value="${dataType}"/>
|
|
<include refid="baseSelect"/>
|
|
where cc.merchandise_name = #{xmmc} limit 1
|
|
</select>
|
|
|
|
<select id="queryCommodityCodeByZxbmAndXhfNsrsbhAndEntId" resultMap="commodityCodeResultMap">
|
|
<bind name="dataType" value="${dataType}"/>
|
|
<include refid="baseSelect"/>
|
|
where cc.encoding = #{zxbm}
|
|
<if test="xhfNsrsbh != null and xhfNsrsbh != ''">
|
|
AND cc.xhf_nsrsbh = #{xhfNsrsbh}
|
|
</if>
|
|
<if test="entId != null and entId != ''">
|
|
AND cc.ent_id = #{entId}
|
|
</if>
|
|
ORDER BY cc.create_time DESC limit 1
|
|
</select>
|
|
|
|
<insert id="insertCommodityCode"
|
|
parameterType="com.dxhy.order.baseservice.module.commodity.model.CommodityCodeEntity">
|
|
<bind name="dataType" value="${dataType}"/>
|
|
|
|
insert into commodity_code
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">
|
|
id,
|
|
</if>
|
|
<if test="commodityId != null">
|
|
commodity_id,
|
|
</if>
|
|
<if test="sortId != null">
|
|
sort_id,
|
|
</if>
|
|
<if test="xhfNsrsbh != null">
|
|
xhf_nsrsbh,
|
|
</if>
|
|
<if test="xmmc != null">
|
|
merchandise_name,
|
|
</if>
|
|
<if test="zxbm != null">
|
|
encoding,
|
|
</if>
|
|
<if test="spsm != null">
|
|
tax_items,
|
|
</if>
|
|
<if test="spjm != null">
|
|
brief_code,
|
|
</if>
|
|
<if test="sl != null">
|
|
tax_rate,
|
|
</if>
|
|
<if test="ggxh != null">
|
|
specification_model,
|
|
</if>
|
|
<if test="xmdw != null">
|
|
metering_unit,
|
|
</if>
|
|
<if test="xmdj != null">
|
|
unit_price,
|
|
</if>
|
|
<if test="hsbz != null">
|
|
tax_logo,
|
|
</if>
|
|
<if test="ycbz != null">
|
|
hide_the_logo,
|
|
</if>
|
|
<if test="yhzcbs != null">
|
|
enjoy_preferential_policies,
|
|
</if>
|
|
<if test="spbm != null">
|
|
tax_class_code,
|
|
</if>
|
|
<if test="ssflMc != null">
|
|
tax_classification_name,
|
|
</if>
|
|
<if test="lslbs != null">
|
|
preferential_policies_type,
|
|
</if>
|
|
<if test="zzstsgl != null">
|
|
zzstsgl,
|
|
</if>
|
|
<if test="userId != null">
|
|
user_id,
|
|
</if>
|
|
create_time,
|
|
modify_time,
|
|
<if test="modifyUserId != null">
|
|
modify_user_id,
|
|
</if>
|
|
<if test="groupId != null">
|
|
group_id,
|
|
</if>
|
|
<if test="bz != null">
|
|
description,
|
|
</if>
|
|
<if test="xhfMc != null">
|
|
enterprise_name,
|
|
</if>
|
|
<if test="dataSource != null">
|
|
data_source,
|
|
</if>
|
|
<if test="matchingState != null">
|
|
matching_state,
|
|
</if>
|
|
<if test="dataState != null">
|
|
data_state,
|
|
</if>
|
|
<if test="spjc != null">
|
|
tax_class_abbreviation,
|
|
</if>
|
|
<if test="collectIdent != null">
|
|
collect_ident,
|
|
</if>
|
|
<if test="cpy != null">
|
|
cpy,
|
|
</if>
|
|
<if test="bmbBbh != null">
|
|
bmb_bbh,
|
|
</if>
|
|
<if test="jdc != null">
|
|
jdc,
|
|
</if>
|
|
<if test="wlflbm != null">
|
|
wlflbm,
|
|
</if>
|
|
<if test="wlflmc != null">
|
|
wlflmc,
|
|
</if>
|
|
<if test="entId != null">
|
|
ent_id,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">
|
|
#{id,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="commodityId != null">
|
|
#{commodityId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="sortId != null">
|
|
#{sortId,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="xhfNsrsbh != null">
|
|
#{xhfNsrsbh,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="xmmc != null">
|
|
#{xmmc,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="zxbm != null">
|
|
#{zxbm,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="spsm != null">
|
|
#{spsm,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="spjm != null">
|
|
#{spjm,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="sl != null">
|
|
#{sl,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="ggxh != null">
|
|
#{ggxh,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="xmdw != null">
|
|
#{xmdw,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="xmdj != null">
|
|
#{xmdj,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="hsbz != null">
|
|
#{hsbz,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="ycbz != null">
|
|
#{ycbz,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="yhzcbs != null">
|
|
#{yhzcbs,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="spbm != null">
|
|
#{spbm,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="ssflMc != null">
|
|
#{ssflMc,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="lslbs != null">
|
|
#{lslbs,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="zzstsgl != null">
|
|
#{zzstsgl,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="userId != null">
|
|
#{userId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="dataType == 0">
|
|
now(),
|
|
now(),
|
|
</if>
|
|
<if test="dataType == 1">
|
|
SYSDATE,
|
|
SYSDATE,
|
|
</if>
|
|
<if test="modifyUserId != null">
|
|
#{modifyUserId,jdbcType=CHAR},
|
|
</if>
|
|
<if test="groupId != null">
|
|
#{groupId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="bz != null">
|
|
#{bz,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="xhfMc != null">
|
|
#{xhfMc,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="dataSource != null">
|
|
#{dataSource,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="matchingState != null">
|
|
#{matchingState,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="dataState != null">
|
|
#{dataState,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="spjc != null">
|
|
#{spjc,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="collectIdent != null">
|
|
#{collectIdent,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="cpy != null">
|
|
#{cpy,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="bmbBbh != null">
|
|
#{bmbBbh,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="jdc != null">
|
|
#{jdc,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="wlflbm != null">
|
|
#{wlflbm,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="wlflmc != null">
|
|
#{wlflmc,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="entId != null">
|
|
#{entId,jdbcType=VARCHAR},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<delete id="deleteCommodityCodeByXhfNsrsbh">
|
|
delete
|
|
from commodity_code
|
|
where xhf_nsrsbh = #{xhfNsrsbh,jdbcType=VARCHAR} and ent_id = #{entId,jdbcType=VARCHAR}
|
|
</delete>
|
|
|
|
<insert id="cloneCommodityCode">
|
|
insert into commodity_code (commodity_id, sort_id, xhf_nsrsbh, merchandise_name, encoding, tax_items,
|
|
brief_code,
|
|
tax_rate, specification_model, metering_unit, unit_price, tax_logo, hide_the_logo,
|
|
enjoy_preferential_policies, tax_class_code, tax_classification_name,
|
|
preferential_policies_type, zzstsgl,
|
|
user_id, create_time, modify_time, modify_user_id, group_id, enterprise_name,
|
|
data_source,
|
|
matching_state, data_state, tax_class_abbreviation, description, collect_ident, cpy,
|
|
bmb_bbh, jdc, wlflbm, wlflmc,ent_id)
|
|
select commodity_id,
|
|
sort_id,
|
|
#{to.xhfNsrsbh,jdbcType=VARCHAR},
|
|
merchandise_name,
|
|
encoding,
|
|
tax_items,
|
|
brief_code,
|
|
tax_rate,
|
|
specification_model,
|
|
metering_unit,
|
|
unit_price,
|
|
tax_logo,
|
|
hide_the_logo,
|
|
enjoy_preferential_policies,
|
|
tax_class_code,
|
|
tax_classification_name,
|
|
preferential_policies_type,
|
|
zzstsgl,
|
|
user_id,
|
|
create_time,
|
|
modify_time,
|
|
modify_user_id,
|
|
group_id,
|
|
enterprise_name,
|
|
data_source,
|
|
matching_state,
|
|
data_state,
|
|
tax_class_abbreviation,
|
|
description,
|
|
collect_ident,
|
|
cpy,
|
|
bmb_bbh,
|
|
jdc,
|
|
wlflbm,
|
|
wlflmc,
|
|
#{to.entId,jdbcType=VARCHAR}
|
|
from commodity_code where xhf_nsrsbh = #{from.xhfNsrsbh,jdbcType=VARCHAR} and ent_id = #{from.entId,jdbcType=VARCHAR}
|
|
</insert>
|
|
|
|
|
|
</mapper>
|
|
|