|
|
|
<?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_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>
|
|
|
|
</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.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="uuid != '' and uuid != null">
|
|
|
|
AND uuid = #{uuid}
|
|
|
|
</if>
|
|
|
|
<if test="thirdId != '' and thirdId != null">
|
|
|
|
AND thirdId = #{thirdId}
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
group by uuid
|
|
|
|
ORDER BY updateTime DESC
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
|
|
<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
|
|
|
|
)
|
|
|
|
values
|
|
|
|
(
|
|
|
|
#{thirdId},
|
|
|
|
#{thirdName},
|
|
|
|
#{uuid},
|
|
|
|
#{isUseDy},
|
|
|
|
#{updateTime},
|
|
|
|
#{thirdId1}, #{thirdId2}, #{thirdId3}, #{thirdId4},
|
|
|
|
#{thirdName1}, #{thirdName2}, #{thirdName3}, #{thirdName4},
|
|
|
|
#{manufactory}, #{measname},#{ybbm},#{sptm}
|
|
|
|
)
|
|
|
|
</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>
|
|
|
|
</set>
|
|
|
|
WHERE id = #{id}
|
|
|
|
</update>
|
|
|
|
</mapper>
|