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-cpt-java/src/main/resources/mybatis/mapper/basic/BasicUdiRelMapper.xml

108 lines
3.9 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.dao.basic.BasicUdiRelMapper">
<select id="filterList" parameterType="com.glxp.api.req.basic.FilterUdiRelRequest"
resultType="com.glxp.api.res.basic.BasicUdiRelResponse">
select bur.*,
uc.companyName,
nameCode,
packRatio,
packLevel,
bhxjsl,
bhzxxsbzsl,
zxxsbzbhsydysl,
bhxjcpbm,
sjcpbm,
bzcj,
thirdProductNo,
thirdProductName,
addType,
deviceRecordKey,
isUseDy,
cpmctymc,
cplb,
flbm,
ggxh,
qxlb,
tyshxydm,
ylqxzcrbarmc,
zczbhhzbapzbh,
ylqxzcrbarywmc,
sydycpbs,
versionNumber,
diType,
scbssfbhph,
scbssfbhxlh,
scbssfbhscrq,
scbssfbhsxrq,
ybbm,
spmc,
cphhhbh,
cpms,
cpbsbmtxmc,
cplx,
hchzsb,
sfwblztlcp,
cgzmraqxgxx,
sfbjwycxsy,
zdcfsycs,
sfwwjbz,
syqsfxyjxmj,
qtxxdwzlj,
mjfs
FROM basic_udi_rel bur
left JOIN productinfo p on bur.uuid = p.uuid
left join user_company uc on bur.companyIdFk = uc.id
<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 bur.uuid = #{uuid}
</if>
<if test="id != '' and id != null">
AND bur.id = #{id}
</if>
<if test="diType != null">
AND diType = #{diType}
</if>
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
AND zczbhhzbapzbh LIKE concat(#{zczbhhzbapzbh}, '%')
</if>
<if test="lastUpdateTime != null and lastUpdateTime != ''">
<![CDATA[
and DATE_FORMAT(bur.updateTime, '%Y-%m-%d %H:%i:%S') >=
DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="unionFilterStr != '' and unionFilterStr != null">
or p.cpmctymc LIKE concat('%', #{unionFilterStr}, '%')
or p.ylqxzcrbarmc LIKE concat('%', #{unionFilterStr}, '%')
or p.ggxh LIKE concat('%', #{unionFilterStr}, '%')
or p.zczbhhzbapzbh LIKE concat('%', #{unionFilterStr}, '%')
</if>
<if test="uniqueNameCode != '' and uniqueNameCode != null">
AND nameCode = #{uniqueNameCode}
</if>
</where>
ORDER BY bur.updateTime DESC
</select>
<select id="findByNameCode" parameterType="java.lang.String"
resultType="com.glxp.api.entity.sup.UserCompanyEntity">
select user_company.*
from basic_udi_rel
INNER JOIN basic_udi_product on basic_udi_rel.uuid = basic_udi_product.uuid
INNER JOIN user_company on basic_udi_rel.companyIdFk = user_company.id
where basic_udi_product.nameCode = #{nameCode}
limit 1
</select>
</mapper>