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.
sdny-order/order-management-base-service/src/main/resources/mybatis/mapper/TaxClassCodeMapper.xml

459 lines
17 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.baseservice.module.taxclass.dao.TaxClassCodeMapper">
<resultMap id="BaseResultMap" type="com.dxhy.order.baseservice.module.taxclass.model.TaxClassCodeEntity">
<id column="id" jdbcType="VARCHAR" property="id"/>
<result column="spbm" jdbcType="VARCHAR" property="spbm"/>
<result column="spmc" jdbcType="VARCHAR" property="spmc"/>
<result column="spjc" jdbcType="VARCHAR" property="spjc"/>
<result column="sm" jdbcType="VARCHAR" property="sm"/>
<result column="zzssl" jdbcType="VARCHAR" property="zzssl"/>
<result column="gjz" jdbcType="VARCHAR" property="gjz"/>
<result column="hzx" jdbcType="VARCHAR" property="hzx"/>
<result column="kyzt" jdbcType="VARCHAR" property="kyzt"/>
<result column="zzstsgl" jdbcType="VARCHAR" property="zzstsgl"/>
<result column="zzszcyj" jdbcType="VARCHAR" property="zzszcyj"/>
<result column="zzstsnrdm" jdbcType="VARCHAR" property="zzstsnrdm"/>
<result column="xfsgl" jdbcType="VARCHAR" property="xfsgl"/>
<result column="xfszcyj" jdbcType="VARCHAR" property="xfszcyj"/>
<result column="xfstsnrdm" jdbcType="VARCHAR" property="xfstsnrdm"/>
<result column="tjjbm" jdbcType="VARCHAR" property="tjjbm"/>
<result column="pid" jdbcType="BIGINT" property="pid"/>
<result column="yhzcmc" jdbcType="VARCHAR" property="yhzcmc"/>
<result column="sl" jdbcType="VARCHAR" property="sl"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="bbh" jdbcType="VARCHAR" property="bbh"/>
<result column="cpy" jdbcType="VARCHAR" property="cpy"/>
<result column="jdc" jdbcType="VARCHAR" property="jdc"/>
<result column="enabling_time" jdbcType="TIMESTAMP" property="enablingTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="mslx" jdbcType="VARCHAR" property="mslx"/>
</resultMap>
<select id="selectTaxClassCodeBySpbm" parameterType="map"
resultType="com.dxhy.order.baseservice.module.taxclass.model.TaxClassCodeEntity">
<bind name="dataType" value="${dataType}"/>
SELECT
tcc.*
<if test="dataType == 1">
, ROWNUM as rowno
</if>
FROM
tax_class_code tcc
where tcc.spbm = #{spbm} limit 1
</select>
<select id="countTaxClassCodeBySpbm" parameterType="java.lang.String" resultType="java.lang.Integer">
SELECT
count(*)
FROM
tax_class_code tcc
where tcc.spbm in
<foreach collection="spbms" item="spbm" open="(" separator="," close=")">
#{spbm}
</foreach>
<if test="map.cpy != null and map.cpy != ''">
and cpy = #{map.cpy}
</if>
</select>
<select id="selectTaxClassCode" parameterType="map"
resultType="com.dxhy.order.baseservice.module.taxclass.model.TaxClassCodeEntity">
<bind name="dataType" value="${dataType}"/>
SELECT
tcc.*
<if test="dataType == 1">
, ROWNUM as rowno
</if>
FROM
tax_class_code tcc
<where>
<if test="queryAll == '' ">
and tcc.kyzt = 'Y'
</if>
<if test="isFlag != 0 ">
<if test="dataType == 0">
and tcc.zzssl != ''
</if>
<if test="dataType == 1">
and tcc.zzssl is not null
</if>
</if>
<if test='cpylx=="1"'>
<if test="dataType == 0">
AND tcc.cpy = 'Y'
</if>
<if test="dataType == 1">
AND tcc.cpy = 'Y'
</if>
</if>
<if test='cpylx=="0"'>
<if test="dataType == 1">
AND tcc.cpy = 'N'
</if>
<if test="dataType == 0">
AND tcc.cpy = 'N'
</if>
</if>
<if test='jdclx=="1"'>
<if test="dataType == 0">
AND tcc.jdc = 'Y'
</if>
<if test="dataType == 1">
AND tcc.jdc = 'Y'
</if>
</if>
<if test='jdclx=="0"'>
<if test="dataType == 1">
AND tcc.jdc = 'N'
</if>
<if test="dataType == 0">
AND tcc.jdc = 'N'
</if>
</if>
<if test="parameter != null and parameter != ''">
<if test="dataType == 0 and (type == null or type == '')">
AND concat_ws(',',tcc.spbm,tcc.spmc,tcc.spjc,tcc.zzstsgl) LIKE
CONCAT(CONCAT('%',#{parameter}),'%')
</if>
<if test="dataType == 1">
AND tcc.spbm || ',' || tcc.spmc || ',' || tcc.spjc || ',' || tcc.zzstsgl LIKE
CONCAT(CONCAT('%',#{parameter}),'%')
</if>
<if test="dataType == 0 and (type != null and type != '')">
AND concat_ws(',',tcc.spbm,tcc.spmc,tcc.spjc,tcc.zzstsgl,tcc.sm)
LIKE CONCAT(CONCAT('%',#{parameter}),'%')
</if>
</if>
</where>
</select>
<select id="selectTaxClassCodeBySpmcOrSm"
resultType="com.dxhy.order.baseservice.module.taxclass.model.TaxClassCodeEntity">
SELECT * FROM tax_class_code
where spmc like concat('%',#{queryString},'%') or sm like concat('%',#{queryString},'%')
</select>
<select id="queryTaxClassCodeEntityBySpbm" parameterType="String"
resultType="com.dxhy.order.baseservice.module.taxclass.model.TaxClassCodeEntity">
<bind name="dataType" value="${dataType}"/>
SELECT
tcc.*
FROM tax_class_code tcc
WHERE
tcc.spbm =#{spbm,jdbcType=VARCHAR}
and tcc.kyzt = 'Y'
AND TCC.hzx = 'N'
</select>
<select id="queryTaxClassCodeEntityBySpmcOrMs" parameterType="String"
resultType="com.dxhy.order.baseservice.module.taxclass.model.TaxClassCodeEntity">
SELECT
tcc.*
FROM tax_class_code tcc
WHERE
tcc.spmc like concat('%',#{spmc,jdbcType=VARCHAR},'%')
or tcc.sm like concat('%',#{sm,jdbcType=VARCHAR},'%')
and tcc.kyzt = 'Y'
AND tcc.hzx = 'N'
limit 1
</select>
<select id="queryAllTaxClassCode" parameterType="String" resultMap="BaseResultMap">
SELECT id,
spbm,
spmc,
spjc,
sm,
zzssl,
gjz,
hzx,
kyzt,
zzstsgl,
zzszcyj,
zzstsnrdm,
xfsgl,
xfszcyj,
xfstsnrdm,
tjjbm,
hgjcksppm,
pid,
yhzcmc,
sl,
create_time,
bbh,
cpy,
jdc,
enabling_time,
update_time,
mslx
FROM tax_class_code
<where>
kyzt = 'Y'
</where>
</select>
<insert id="insert" parameterType="com.dxhy.order.baseservice.module.taxclass.model.TaxClassCodeEntity">
insert into tax_class_code
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">
id,
</if>
<if test="spbm != null and spbm != ''">
spbm,
</if>
<if test="spmc != null and spmc != ''">
spmc,
</if>
<if test="spjc != null and spjc != ''">
spjc,
</if>
<if test="sm != null and sm != ''">
sm,
</if>
<if test="zzssl != null and zzssl != ''">
zzssl,
</if>
<if test="gjz != null and gjz != ''">
gjz,
</if>
<if test="hzx != null and hzx != ''">
hzx,
</if>
<if test="kyzt != null and kyzt != ''">
kyzt,
</if>
<if test="zzstsgl != null and zzstsgl != ''">
zzstsgl,
</if>
<if test="zzszcyj != null and zzszcyj != ''">
zzszcyj,
</if>
<if test="zzstsnrdm != null and zzstsnrdm != ''">
zzstsnrdm,
</if>
<if test="xfsgl != null and xfsgl != ''">
xfsgl,
</if>
<if test="xfszcyj != null and xfszcyj != ''">
xfszcyj,
</if>
<if test="xfstsnrdm != null and xfstsnrdm != ''">
xfstsnrdm,
</if>
<if test="tjjbm != null and tjjbm != ''">
tjjbm,
</if>
<if test="hgjcksppm != null and hgjcksppm != ''">
hgjcksppm,
</if>
<if test="pid != null and pid != ''">
pid,
</if>
<if test="yhzcmc != null and yhzcmc != ''">
yhzcmc,
</if>
<if test="sl != null and sl != ''">
sl,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="bbh != null and bbh != ''">
bbh,
</if>
<if test="cpy != null and cpy != ''">
cpy,
</if>
<if test="jdc != null and jdc != ''">
jdc,
</if>
<if test="enablingTime != null">
enabling_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="mslx != null and mslx != ''">
mslx,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">
#{id,jdbcType=VARCHAR},
</if>
<if test="spbm != null and spbm != ''">
#{spbm,jdbcType=VARCHAR},
</if>
<if test="spmc != null and spmc != ''">
#{spmc,jdbcType=VARCHAR},
</if>
<if test="spjc != null and spjc != ''">
#{spjc,jdbcType=VARCHAR},
</if>
<if test="sm != null and sm != ''">
#{sm,jdbcType=VARCHAR},
</if>
<if test="zzssl != null and zzssl != ''">
#{zzssl,jdbcType=VARCHAR},
</if>
<if test="gjz != null and gjz != ''">
#{gjz,jdbcType=VARCHAR},
</if>
<if test="hzx != null and hzx != ''">
#{hzx,jdbcType=VARCHAR},
</if>
<if test="kyzt != null and kyzt != ''">
#{kyzt,jdbcType=VARCHAR},
</if>
<if test="zzstsgl != null and zzstsgl != ''">
#{zzstsgl,jdbcType=VARCHAR},
</if>
<if test="zzszcyj != null and zzszcyj != ''">
#{zzszcyj,jdbcType=VARCHAR},
</if>
<if test="zzstsnrdm != null and zzstsnrdm != ''">
#{zzstsnrdm,jdbcType=VARCHAR},
</if>
<if test="xfsgl != null and xfsgl != ''">
#{xfsgl,jdbcType=VARCHAR},
</if>
<if test="xfszcyj != null and xfszcyj != ''">
#{xfszcyj,jdbcType=VARCHAR},
</if>
<if test="xfstsnrdm != null and xfstsnrdm != ''">
#{xfstsnrdm,jdbcType=VARCHAR},
</if>
<if test="tjjbm != null and tjjbm != ''">
#{tjjbm,jdbcType=VARCHAR},
</if>
<if test="hgjcksppm != null and hgjcksppm != ''">
#{hgjcksppm,jdbcType=VARCHAR},
</if>
<if test="pid != null and pid != ''">
#{pid,jdbcType=BIGINT},
</if>
<if test="yhzcmc != null and yhzcmc != ''">
#{yhzcmc,jdbcType=VARCHAR},
</if>
<if test="sl != null and sl != ''">
#{sl,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="bbh != null and bbh != ''">
#{bbh,jdbcType=VARCHAR},
</if>
<if test="cpy != null and cpy != ''">
#{cpy,jdbcType=VARCHAR},
</if>
<if test="jdc != null and jdc != ''">
#{jdc,jdbcType=VARCHAR},
</if>
<if test="enablingTime != null">
#{enablingTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="mslx != null and mslx != ''">
#{mslx,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="update" parameterType="com.dxhy.order.baseservice.module.taxclass.model.TaxClassCodeEntity">
update tax_class_code
<set>
<if test="id != null and id != ''">
id = #{id,jdbcType=VARCHAR},
</if>
<if test="spbm != null and spbm != ''">
spbm = #{spbm,jdbcType=VARCHAR},
</if>
<if test="spmc != null and spmc != ''">
spmc = #{spmc,jdbcType=VARCHAR},
</if>
<if test="spjc != null and spjc != ''">
spjc = #{spjc,jdbcType=VARCHAR},
</if>
<if test="sm != null and sm != ''">
sm = #{sm,jdbcType=VARCHAR},
</if>
<if test="zzssl != null and zzssl != ''">
zzssl = #{zzssl,jdbcType=VARCHAR},
</if>
<if test="gjz != null and gjz != ''">
gjz = #{gjz,jdbcType=VARCHAR},
</if>
<if test="hzx != null and hzx != ''">
hzx = #{hzx,jdbcType=VARCHAR},
</if>
<if test="kyzt != null and kyzt != ''">
kyzt = #{kyzt,jdbcType=VARCHAR},
</if>
<if test="zzstsgl != null and zzstsgl != ''">
zzstsgl = #{zzstsgl,jdbcType=VARCHAR},
</if>
<if test="zzszcyj != null and zzszcyj != ''">
zzszcyj = #{zzszcyj,jdbcType=VARCHAR},
</if>
<if test="zzstsnrdm != null and zzstsnrdm != ''">
zzstsnrdm = #{zzstsnrdm,jdbcType=VARCHAR},
</if>
<if test="xfsgl != null and xfsgl != ''">
xfsgl = #{xfsgl,jdbcType=VARCHAR},
</if>
<if test="xfszcyj != null and xfszcyj != ''">
xfszcyj = #{xfszcyj,jdbcType=VARCHAR},
</if>
<if test="xfstsnrdm != null and xfstsnrdm != ''">
xfstsnrdm = #{xfstsnrdm,jdbcType=VARCHAR},
</if>
<if test="tjjbm != null and tjjbm != ''">
tjjbm = #{tjjbm,jdbcType=VARCHAR},
</if>
<if test="hgjcksppm != null and hgjcksppm != ''">
hgjcksppm = #{hgjcksppm,jdbcType=VARCHAR},
</if>
<if test="pid != null and pid != ''">
pid = #{pid,jdbcType=BIGINT},
</if>
<if test="yhzcmc != null and yhzcmc != ''">
yhzcmc = #{yhzcmc,jdbcType=VARCHAR},
</if>
<if test="sl != null and sl != ''">
sl = #{sl,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="bbh != null and bbh != ''">
bbh = #{bbh,jdbcType=VARCHAR},
</if>
<if test="cpy != null and cpy != ''">
cpy = #{cpy,jdbcType=VARCHAR},
</if>
<if test="jdc != null and jdc != ''">
jdc = #{jdc,jdbcType=VARCHAR},
</if>
<if test="enablingTime != null">
enabling_time = #{enablingTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="mslx != null and mslx != ''">
mslx = #{mslx,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>