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.
udi-spms-java/src/main/resources/mybatis/mapper/basic/CompanyProductRelevanceDao.xml

227 lines
9.7 KiB
XML

2 years ago
<?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.dao.basic.CompanyProductRelevanceDao">
<insert id="insertCompanyProductRelevance"
parameterType="com.glxp.api.entity.basic.CompanyProductRelevanceEntity">
replace
2 years ago
INTO company_product_relevance(customerId, productId, enterpriseId, registrationId,
createTime, updateTime, auditStatus, productUuid, udiRlIdFk, unitFk,
price)
values (#{customerId},
#{productId},
#{enterpriseId},
#{registrationId},
#{createTime},
#{updateTime},
#{auditStatus},
#{productUuid},
#{udiRlIdFk},
#{unitFk}, #{price})
2 years ago
</insert>
<insert id="importCompanyProductRelevance"
parameterType="com.glxp.api.entity.basic.CompanyProductRelevanceEntity">
replace
2 years ago
INTO company_product_relevance(id, customerId, productId, enterpriseId, registrationId,
create_time, update_time, auditStatus, productUuid, udiRlIdFk, unitFk,
price)
values (#{id},
#{customerId},
#{productId},
#{enterpriseId},
#{registrationId},
#{create_time},
#{update_time},
#{auditStatus},
#{productUuid},
#{udiRlIdFk},
#{unitFk}, #{price})
2 years ago
</insert>
<delete id="deleteById" parameterType="Map">
DELETE
FROM company_product_relevance
WHERE id = #{id}
</delete>
<delete id="deleteByRlId" parameterType="Map">
DELETE
FROM company_product_relevance
WHERE udiRlIdFk = #{id}
</delete>
<select id="filterUdiGp" parameterType="com.glxp.api.req.basic.CompanyProductRelevanceRequest"
resultType="com.glxp.api.res.basic.CompanyProductRelevanceResponse">
2 years ago
SELECT company_product_relevance.id,
company_product_relevance.customerId,
company_product_relevance.auditStatus,
basic_udirel.thirdId,
basic_udirel.id rlId,
basic_udirel.isUseDy,
basic_udirel.isLock,
basic_udirel.thirdId1,
basic_udirel.thirdId2,
basic_udirel.thirdId3,
basic_udirel.thirdId4,
basic_udirel.lockStatus,
basic_products.allowNoBatch,
basic_products.allowNoExpire,
basic_products.allowNoProduct,
basic_products.allowNoSerial,
basic_products.productType,
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_udirel.isDisable,
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,
customer_info.companyName,
basic_udirel.mainId,
basic_udirel.isAdavence,
basic_products.scbssfbhph,
basic_products.scbssfbhxlh,
basic_products.scbssfbhscrq,
basic_products.cpdls,
basic_products.scbssfbhsxrq,
basic_products.cpms,
basic_products.originUuid,
company_product_relevance.price,
basic_products.spmc,
basic_products.basicPrductRemak1,
basic_products.basicPrductRemak2,
basic_products.basicPrductRemak3,
basic_products.basicPrductRemak4,
basic_products.basicPrductRemak5,
basic_products.basicPrductRemak6,
basic_products.basicPrductRemak7,
basic_products.basicPrductRemak8
FROM company_product_relevance
INNER JOIN basic_udirel ON company_product_relevance.udiRlIdFk = basic_udirel.id
INNER JOIN basic_products ON basic_udirel.uuid = basic_products.uuid
INNER JOIN customer_info ON customer_info.customerId = company_product_relevance.customerId
2 years ago
<where>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
2 years ago
AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc}, '%')
2 years ago
</if>
<if test="cpmctymc != '' and cpmctymc != null">
2 years ago
AND cpmctymc LIKE concat(#{cpmctymc}, '%')
2 years ago
</if>
<if test="nameCode != '' and nameCode != null">
2 years ago
AND nameCode LIKE concat(#{nameCode}, '%')
2 years ago
</if>
<if test="ggxh != '' and ggxh != null">
2 years ago
AND ggxh LIKE concat('%', #{ggxh}, '%')
2 years ago
</if>
<if test="unionCode != '' and unionCode != null">
and (
2 years ago
nameCode LIKE concat('%', #{unionCode}, '%')
or basic_products.ybbm LIKE concat('%', #{unionCode}, '%')
or basic_products.sptm LIKE concat('%', #{unionCode}, '%')
)
2 years ago
</if>
<if test="thrPiId != '' and thrPiId != null">
and (
2 years ago
thirdId LIKE concat('%', #{thrPiId}, '%')
or thirdId1 LIKE concat('%', #{thrPiId}, '%')
or thirdId2 LIKE concat('%', #{thrPiId}, '%')
or thirdId3 LIKE concat('%', #{thrPiId}, '%')
or thirdId4 LIKE concat('%', #{thrPiId}, '%')
)
2 years ago
</if>
<if test="uuid != '' and uuid != null">
AND basic_udirel.uuid = #{uuid}
</if>
<if test="thirdId != '' and thirdId != null">
AND thirdId = #{thirdId}
</if>
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
2 years ago
AND zczbhhzbapzbh LIKE concat(#{zczbhhzbapzbh}, '%')
2 years ago
</if>
<if test="diType != '' and diType != null">
2 years ago
AND diType = #{diType}
2 years ago
</if>
<if test="filterType != null and filterType == 1">
AND (thirdId <![CDATA[<>]]> '' or thirdId1 <![CDATA[<>]]> '' or thirdId2 <![CDATA[<>]]> '' or
2 years ago
thirdId3 <![CDATA[<>]]> '' or thirdId4 <![CDATA[<>]]> '')
2 years ago
and basic_products.originUuid <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 2">
AND basic_products.originUuid is NULL
</if>
<if test="filterType != null and filterType == 3">
2 years ago
AND mainId is NULL
and basic_products.originUuid <![CDATA[<>]]> ''
2 years ago
</if>
<if test="filterType != null and filterType == 4">
2 years ago
AND thirdId1 is NULL
and basic_products.flbm <![CDATA[<>]]> ''
2 years ago
</if>
<if test="filterType != null and filterType == 5">
2 years ago
AND thirdId2 is NULL
and basic_products.flbm <![CDATA[<>]]> ''
2 years ago
</if>
<if test="filterType != null and filterType == 6">
2 years ago
AND thirdId3 is NULL
and basic_products.flbm <![CDATA[<>]]> ''
2 years ago
</if>
<if test="filterType != null and filterType == 7">
2 years ago
AND thirdId4 is NULL
and basic_products.flbm <![CDATA[<>]]> ''
2 years ago
</if>
<if test="filterType != null and filterType == 10">
AND basic_udirel.updateTime is NULL
</if>
<if test="customerId != '' and customerId != null">
AND company_product_relevance.customerId = #{customerId}
</if>
<if test="auditStatus != '' and auditStatus != null">
AND company_product_relevance.auditStatus = #{auditStatus}
</if>
<if test="id != '' and id != null">
AND basic_udirel.id = #{id}
</if>
<if test="companyName != '' and companyName != null">
AND customer_info.companyName = #{companyName}
</if>
<if test="lockStatus != '' and lockStatus != null">
AND basic_udirel.lockStatus = #{lockStatus}
</if>
<if test="isAdavence != '' and isAdavence != null">
AND basic_udirel.isAdavence = #{isAdavence}
</if>
<if test="unitFk != null and unitFk != ''">
and unitFk = #{unitFk}
</if>
2 years ago
<if test="originUuid != null and originUuid != ''">
and originUuid = #{originUuid}
</if>
2 years ago
<if test="isDisable == false">
2 years ago
AND (basic_udirel.isDisable is null or basic_udirel.isDisable = false)
2 years ago
</if>
</where>
2 years ago
ORDER BY company_product_relevance.updateTime DESC
2 years ago
</select>
</mapper>