You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
262 lines
12 KiB
XML
262 lines
12 KiB
XML
<?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.glxp.api.admin.dao.basic.UdiRelevanceDao">
|
|
|
|
<select id="filterUdiRelevance" parameterType="com.glxp.api.admin.req.basic.FilterUdiInfoRequest"
|
|
resultType="com.glxp.api.admin.res.basic.UdiRelevanceResponse">
|
|
select
|
|
basic_udirel.id,
|
|
basic_udirel.thirdId,basic_udirel.thirdName,basic_udirel.isUseDy,
|
|
basic_udirel.thirdId1,basic_udirel.thirdId2,basic_udirel.thirdId3,basic_udirel.thirdId4,
|
|
basic_udirel.thirdName1,basic_udirel.thirdName2,basic_udirel.thirdName3,basic_udirel.thirdName4,
|
|
basic_udirel.manufactory,basic_udirel.measname,basic_udirel.ybbm,basic_udirel.sptm,
|
|
basic_udirel.isDisable,
|
|
basic_products.nameCode,basic_products.packRatio,basic_products.packLevel,
|
|
basic_products.bhxjsl,basic_products.bhzxxsbzsl,basic_products.zxxsbzbhsydysl,
|
|
basic_products.bhxjcpbm,basic_products.bzcj,
|
|
basic_products.addType,basic_products.deviceRecordKey,
|
|
basic_products.cpmctymc,basic_products.cplb,
|
|
basic_products.flbm,basic_products.ggxh,basic_products.qxlb,basic_products.tyshxydm,
|
|
basic_products.ylqxzcrbarmc,basic_products.zczbhhzbapzbh,basic_products.ylqxzcrbarywmc,
|
|
basic_products.sydycpbs,basic_products.uuid,basic_products.sjcpbm,basic_products.versionNumber,basic_products.diType
|
|
FROM basic_udirel
|
|
inner JOIN basic_products
|
|
ON basic_products.uuid = basic_udirel.uuid
|
|
<where>
|
|
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
|
|
AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc},'%')
|
|
</if>
|
|
<if test="cpmctymc != '' and cpmctymc != null">
|
|
AND cpmctymc LIKE concat(#{cpmctymc},'%')
|
|
</if>
|
|
<if test="nameCode != '' and nameCode != null">
|
|
AND nameCode LIKE concat(#{nameCode},'%')
|
|
</if>
|
|
<if test="thirdId != '' and thirdId != null">
|
|
AND thirdId LIKE concat(#{thirdId},'%')
|
|
</if>
|
|
<if test="uuid != '' and uuid != null">
|
|
AND basic_udirel.uuid = #{uuid}
|
|
</if>
|
|
<if test="id != '' and id != null">
|
|
AND basic_udirel.id = #{id}
|
|
</if>
|
|
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
|
|
AND zczbhhzbapzbh LIKE concat(#{zczbhhzbapzbh},'%')
|
|
</if>
|
|
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
|
|
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
|
|
</if>
|
|
</where>
|
|
ORDER BY updateTime DESC
|
|
|
|
</select>
|
|
|
|
|
|
<select id="filterUdiGp" parameterType="com.glxp.api.admin.req.basic.FilterUdiInfoRequest"
|
|
resultType="com.glxp.api.admin.res.basic.UdiRelevanceResponse">
|
|
select
|
|
basic_udirel.id,
|
|
basic_udirel.thirdId,basic_udirel.thirdName,basic_udirel.isUseDy,
|
|
basic_udirel.thirdId1,basic_udirel.thirdId2,basic_udirel.thirdId3,basic_udirel.thirdId4,
|
|
basic_udirel.ybbm,basic_udirel.sptm,basic_udirel.isDisable,
|
|
basic_udirel.thirdName1,basic_udirel.thirdName2,basic_udirel.thirdName3,basic_udirel.thirdName4,
|
|
basic_udirel.manufactory,basic_udirel.measname,
|
|
basic_products.nameCode,basic_products.packRatio,basic_products.packLevel,basic_products.bhxjsl,basic_products.bhzxxsbzsl,basic_products.zxxsbzbhsydysl,basic_products.bhxjcpbm,basic_products.bzcj,basic_products.addType,basic_products.deviceRecordKey,basic_products.cpmctymc,basic_products.cplb,basic_products.flbm,basic_products.ggxh,basic_products.qxlb,basic_products.tyshxydm,basic_products.ylqxzcrbarmc,basic_products.zczbhhzbapzbh,basic_products.ylqxzcrbarywmc,basic_products.sydycpbs,basic_products.uuid,basic_products.sjcpbm,basic_products.versionNumber,basic_products.diType
|
|
FROM basic_products
|
|
right JOIN basic_udirel
|
|
ON basic_products.uuid = basic_udirel.uuid
|
|
<where>
|
|
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
|
|
AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc},'%')
|
|
</if>
|
|
<if test="cpmctymc != '' and cpmctymc != null">
|
|
AND cpmctymc LIKE concat(#{cpmctymc},'%')
|
|
</if>
|
|
<if test="nameCode != '' and nameCode != null">
|
|
AND nameCode LIKE concat(#{nameCode},'%')
|
|
</if>
|
|
|
|
<if test="unionCode != '' and unionCode != null">
|
|
or nameCode LIKE concat('%',#{unionCode},'%')
|
|
or basic_udirel.ybbm LIKE concat('%',#{unionCode},'%')
|
|
or basic_udirel.sptm LIKE concat('%',#{unionCode},'%')
|
|
</if>
|
|
|
|
<if test="thrPiId != '' and thrPiId != null">
|
|
or thirdId LIKE concat('%',#{thrPiId},'%')
|
|
or thirdId1 LIKE concat('%',#{thrPiId},'%')
|
|
or thirdId2 LIKE concat('%',#{thrPiId},'%')
|
|
or thirdId3 LIKE concat('%',#{thrPiId},'%')
|
|
or thirdId4 LIKE concat('%',#{thrPiId},'%')
|
|
</if>
|
|
|
|
|
|
<if test="uuid != '' and uuid != null">
|
|
AND uuid = #{uuid}
|
|
</if>
|
|
<if test="thirdId != '' and thirdId != null">
|
|
AND thirdId = #{thirdId}
|
|
</if>
|
|
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
|
|
AND zczbhhzbapzbh LIKE concat(#{zczbhhzbapzbh},'%')
|
|
</if>
|
|
<if test="diType != '' and diType != null">
|
|
AND diType =#{diType}
|
|
</if>
|
|
<if test="filterType != null and filterType == 1">
|
|
AND (thirdId <![CDATA[<>]]> '' or thirdId1 <![CDATA[<>]]> '' or thirdId2 <![CDATA[<>]]> '' or
|
|
thirdId3 <![CDATA[<>]]> '' or thirdId4 <![CDATA[<>]]> '' )
|
|
and basic_products.flbm <![CDATA[<>]]> ''
|
|
</if>
|
|
|
|
<if test="filterType != null and filterType == 2">
|
|
AND basic_products.flbm is NULL
|
|
</if>
|
|
|
|
<if test="filterType != null and filterType == 3">
|
|
AND thirdId is NULL and basic_products.flbm <![CDATA[<>]]> ''
|
|
</if>
|
|
<if test="filterType != null and filterType == 4">
|
|
AND thirdId1 is NULL and basic_products.flbm <![CDATA[<>]]> ''
|
|
</if>
|
|
<if test="filterType != null and filterType == 5">
|
|
AND thirdId2 is NULL and basic_products.flbm <![CDATA[<>]]> ''
|
|
</if>
|
|
<if test="filterType != null and filterType == 6">
|
|
AND thirdId3 is NULL and basic_products.flbm <![CDATA[<>]]> ''
|
|
</if>
|
|
<if test="filterType != null and filterType == 7">
|
|
AND thirdId4 is NULL and basic_products.flbm <![CDATA[<>]]> ''
|
|
</if>
|
|
|
|
|
|
</where>
|
|
ORDER BY updateTime DESC
|
|
</select>
|
|
<!-- GROUP BY
|
|
uuid,basic_udirel.thirdId,basic_udirel.thirdId1,basic_udirel.thirdId2,basic_udirel.thirdId3,basic_udirel.thirdId4-->
|
|
<select id="selectByUuid" parameterType="java.lang.String"
|
|
resultType="com.glxp.api.admin.entity.basic.UdiRelevanceEntity">
|
|
select * FROM basic_udirel
|
|
<where>
|
|
<if test="uuid != '' and uuid != null">
|
|
AND uuid = #{uuid}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
|
|
<select id="selectById" parameterType="java.lang.String"
|
|
resultType="com.glxp.api.admin.entity.basic.UdiRelevanceEntity">
|
|
select * FROM basic_udirel WHERE id = #{id}
|
|
</select>
|
|
<select id="selectByThirdId" parameterType="com.glxp.api.admin.req.basic.FilterUdiInfoRequest"
|
|
resultType="com.glxp.api.admin.entity.basic.UdiRelevanceEntity">
|
|
select * FROM basic_udirel
|
|
<where>
|
|
<if test="thirdId != '' and thirdId != null">
|
|
AND thirdId = #{thirdId}
|
|
</if>
|
|
<if test="thirdId1 != '' and thirdId1 != null">
|
|
AND thirdId1 = #{thirdId1}
|
|
</if>
|
|
<if test="thirdId2 != '' and thirdId2 != null">
|
|
AND thirdId2 = #{thirdId2}
|
|
</if>
|
|
<if test="thirdId3 != '' and thirdId3 != null">
|
|
AND thirdId3 = #{thirdId3}
|
|
</if>
|
|
<if test="thirdId4 != '' and thirdId4 != null">
|
|
AND thirdId4 = #{thirdId4}
|
|
</if>
|
|
</where>
|
|
|
|
limit 1
|
|
</select>
|
|
|
|
<select id="filterEntity" parameterType="com.glxp.api.admin.req.basic.FilterUdiInfoRequest"
|
|
resultType="com.glxp.api.admin.entity.basic.UdiRelevanceEntity">
|
|
select * FROM basic_udirel
|
|
<where>
|
|
<if test="thirdId != '' and thirdId != null">
|
|
AND thirdId = #{thirdId}
|
|
</if>
|
|
<if test="thirdId1 != '' and thirdId1 != null">
|
|
AND thirdId1 = #{thirdId1}
|
|
</if>
|
|
<if test="thirdId2 != '' and thirdId2 != null">
|
|
AND thirdId2 = #{thirdId2}
|
|
</if>
|
|
<if test="thirdId3 != '' and thirdId3 != null">
|
|
AND thirdId3 = #{thirdId3}
|
|
</if>
|
|
<if test="thirdId4 != '' and thirdId4 != null">
|
|
AND thirdId4 = #{thirdId4}
|
|
</if>
|
|
<if test="uuid != '' and uuid != null">
|
|
AND uuid = #{uuid}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
|
|
<insert id="insertUdiRelevance" keyProperty="id" parameterType="com.glxp.api.admin.entity.basic.UdiRelevanceEntity">
|
|
replace INTO basic_udirel
|
|
(
|
|
thirdId,thirdName,uuid,isUseDy,updateTime,
|
|
thirdId1,thirdId2,thirdId3,thirdId4,thirdName1,thirdName2,thirdName3,thirdName4,manufactory,measname,ybbm,sptm,isDisable
|
|
)
|
|
values
|
|
(
|
|
#{thirdId},
|
|
#{thirdName},
|
|
#{uuid},
|
|
#{isUseDy},
|
|
#{updateTime},
|
|
#{thirdId1}, #{thirdId2}, #{thirdId3}, #{thirdId4},
|
|
#{thirdName1}, #{thirdName2}, #{thirdName3}, #{thirdName4},
|
|
#{manufactory}, #{measname},#{ybbm},#{sptm},#{isDisable}
|
|
)
|
|
</insert>
|
|
|
|
|
|
<delete id="deleteById" parameterType="Map">
|
|
DELETE FROM basic_udirel WHERE id = #{id}
|
|
</delete>
|
|
<delete id="deleteByIds" parameterType="java.util.List">
|
|
DELETE FROM basic_udirel WHERE id in
|
|
<foreach collection="ids" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
</delete>
|
|
<delete id="deleteByUuid" parameterType="Map">
|
|
DELETE FROM basic_udirel WHERE uuid = #{uuid}
|
|
</delete>
|
|
|
|
<update id="updateUdiRelevance" parameterType="com.glxp.api.admin.entity.basic.UdiRelevanceEntity">
|
|
UPDATE basic_udirel
|
|
<set>
|
|
<if test="thirdId != null">thirdId=#{thirdId},</if>
|
|
<if test="thirdName != null">thirdName=#{thirdName},</if>
|
|
<if test="uuid != null">uuid=#{uuid},</if>
|
|
<if test="isUseDy != null">isUseDy=#{isUseDy},</if>
|
|
<if test="thirdId1 != null">thirdId1=#{thirdId1},</if>
|
|
<if test="thirdId2 != null">thirdId2=#{thirdId2},</if>
|
|
<if test="thirdId3 != null">thirdId3=#{thirdId3},</if>
|
|
<if test="thirdId4 != null">thirdId4=#{thirdId4},</if>
|
|
<if test="thirdName1 != null">thirdName1=#{thirdName1},</if>
|
|
<if test="thirdName2 != null">thirdName2=#{thirdName2},</if>
|
|
<if test="thirdName3 != null">thirdName3=#{thirdName3},</if>
|
|
<if test="thirdName4 != null">thirdName4=#{thirdName4},</if>
|
|
<if test="manufactory != null">manufactory=#{manufactory},</if>
|
|
<if test="measname != null">measname=#{measname},</if>
|
|
<if test="ybbm != null">ybbm=#{ybbm},</if>
|
|
<if test="sptm != null">sptm=#{sptm},</if>
|
|
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
|
<if test="isDisable != null">isDisable=#{isDisable},</if>
|
|
</set>
|
|
WHERE id = #{id}
|
|
</update>
|
|
</mapper> |