|
|
|
<?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_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 uuid = #{uuid}
|
|
|
|
</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_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 thirdId
|
|
|
|
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="java.lang.String"
|
|
|
|
resultType="com.glxp.api.admin.entity.basic.UdiRelevanceEntity">
|
|
|
|
select * FROM basic_udirel WHERE thirdId = #{thirdId} 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
|
|
|
|
)
|
|
|
|
values
|
|
|
|
(
|
|
|
|
#{thirdId},
|
|
|
|
#{thirdName},
|
|
|
|
#{uuid},
|
|
|
|
#{isUseDy},
|
|
|
|
#{updateTime}
|
|
|
|
|
|
|
|
)
|
|
|
|
</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="updateTime != null">updateTime=#{updateTime},</if>
|
|
|
|
</set>
|
|
|
|
WHERE id = #{id}
|
|
|
|
</update>
|
|
|
|
</mapper>
|