|
|
|
@ -1,36 +1,37 @@
|
|
|
|
|
<?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.thrsys.ThrProductsDao">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="filterThrProducts" parameterType="com.glxp.api.req.thrsys.FilterThrProductsRequest"
|
|
|
|
|
resultType="com.glxp.api.entity.thrsys.ThrProductsEntity">
|
|
|
|
|
SELECT * FROM thr_products
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM thr_products
|
|
|
|
|
<where>
|
|
|
|
|
<if test="name != '' and name != null">
|
|
|
|
|
AND name LIKE concat('%',#{name},'%')
|
|
|
|
|
AND name LIKE concat('%', #{name}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="code != '' and code != null">
|
|
|
|
|
AND code = #{code}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="sptm != '' and sptm != null">
|
|
|
|
|
AND sptm LIKE concat('%',#{sptm},'%')
|
|
|
|
|
AND sptm LIKE concat('%', #{sptm}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ybbm != '' and ybbm != null">
|
|
|
|
|
AND ybbm LIKE concat('%',#{ybbm},'%')
|
|
|
|
|
AND ybbm LIKE concat('%', #{ybbm}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="registerNo != '' and registerNo != null">
|
|
|
|
|
AND registerNo LIKE concat('%',#{registerNo},'%')
|
|
|
|
|
AND registerNo LIKE concat('%', #{registerNo}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="manufactory != '' and manufactory != null">
|
|
|
|
|
AND manufactory LIKE concat('%',#{manufactory},'%')
|
|
|
|
|
AND manufactory LIKE concat('%', #{manufactory}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="spec != '' and spec != null">
|
|
|
|
|
AND spec LIKE concat('%',#{spec},'%')
|
|
|
|
|
AND spec LIKE concat('%', #{spec}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="unionCode != '' and unionCode != null">
|
|
|
|
|
or code LIKE concat('%',#{unionCode},'%') or sptm LIKE concat('%',#{unionCode},'%') or ybbm LIKE
|
|
|
|
|
concat('%',#{unionCode},'%')
|
|
|
|
|
or code LIKE concat('%', #{unionCode}, '%')
|
|
|
|
|
or sptm LIKE concat('%', #{unionCode}, '%')
|
|
|
|
|
or ybbm LIKE
|
|
|
|
|
concat('%', #{unionCode}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="thirdSysFk != '' and thirdSysFk != null">
|
|
|
|
|
AND thirdSysFk = #{thirdSysFk}
|
|
|
|
@ -39,16 +40,19 @@
|
|
|
|
|
AND thirdSysFk = #{thirdSys}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="supName != '' and supName != null">
|
|
|
|
|
AND supName LIKE concat('%',#{supName},'%')
|
|
|
|
|
AND supName LIKE concat('%', #{supName}, '%')
|
|
|
|
|
</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 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>
|
|
|
|
|
</select>
|
|
|
|
|
<select id="filterThrProducts1" parameterType="com.glxp.api.req.thrsys.FilterThrProductsRequest"
|
|
|
|
|
resultType="com.glxp.api.entity.thrsys.ThrProductsEntity">
|
|
|
|
|
SELECT * FROM thr_products
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM thr_products
|
|
|
|
|
<where>
|
|
|
|
|
<if test="name != '' and name != null">
|
|
|
|
|
AND name = #{name}
|
|
|
|
@ -57,22 +61,24 @@
|
|
|
|
|
AND code = #{code}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="sptm != '' and sptm != null">
|
|
|
|
|
AND sptm= #{sptm}
|
|
|
|
|
AND sptm = #{sptm}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ybbm != '' and ybbm != null">
|
|
|
|
|
AND ybbm = #{ybbm}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="registerNo != '' and registerNo != null">
|
|
|
|
|
AND registerNo= #{registerNo}
|
|
|
|
|
AND registerNo = #{registerNo}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="manufactory != '' and manufactory != null">
|
|
|
|
|
AND manufactory= #{manufactory}
|
|
|
|
|
AND manufactory = #{manufactory}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="spec != '' and spec != null">
|
|
|
|
|
AND spec = #{spec}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="unionCode != '' and unionCode != null">
|
|
|
|
|
or code LIKE = #{unionCode} or sptm = #{unionCode} or ybbm LIKE
|
|
|
|
|
or code LIKE = #{unionCode}
|
|
|
|
|
or sptm = #{unionCode}
|
|
|
|
|
or ybbm LIKE
|
|
|
|
|
= #{unionCode}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="thirdSysFk != '' and thirdSysFk != null">
|
|
|
|
@ -84,8 +90,10 @@
|
|
|
|
|
<if test="supName != '' and supName != null">
|
|
|
|
|
AND supName LIKE = #{supName}
|
|
|
|
|
</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 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>
|
|
|
|
|
</select>
|
|
|
|
@ -93,33 +101,36 @@
|
|
|
|
|
|
|
|
|
|
<select id="filterJoinThrProducts" parameterType="com.glxp.api.req.thrsys.FilterThrProductsRequest"
|
|
|
|
|
resultType="com.glxp.api.res.thrsys.ThrProductsResponse">
|
|
|
|
|
SELECT thr_products.*,thr_system.thirdName thirdSysName FROM thr_products
|
|
|
|
|
SELECT thr_products.*, thr_system.thirdName thirdSysName
|
|
|
|
|
FROM thr_products
|
|
|
|
|
LEFT JOIN thr_system on thr_products.thirdSysFk = thr_system.thirdId
|
|
|
|
|
<where>
|
|
|
|
|
<if test="name != '' and name != null">
|
|
|
|
|
AND name LIKE concat('%',#{name},'%')
|
|
|
|
|
AND name LIKE concat('%', #{name}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="code != '' and code != null">
|
|
|
|
|
AND code LIKE concat('%',#{code},'%')
|
|
|
|
|
AND code LIKE concat('%', #{code}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="sptm != '' and sptm != null">
|
|
|
|
|
AND sptm LIKE concat('%',#{sptm},'%')
|
|
|
|
|
AND sptm LIKE concat('%', #{sptm}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ybbm != '' and ybbm != null">
|
|
|
|
|
AND ybbm LIKE concat('%',#{ybbm},'%')
|
|
|
|
|
AND ybbm LIKE concat('%', #{ybbm}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="registerNo != '' and registerNo != null">
|
|
|
|
|
AND registerNo LIKE concat('%',#{registerNo},'%')
|
|
|
|
|
AND registerNo LIKE concat('%', #{registerNo}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="manufactory != '' and manufactory != null">
|
|
|
|
|
AND manufactory LIKE concat('%',#{manufactory},'%')
|
|
|
|
|
AND manufactory LIKE concat('%', #{manufactory}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="spec != '' and spec != null">
|
|
|
|
|
AND spec LIKE concat('%',#{spec},'%')
|
|
|
|
|
AND spec LIKE concat('%', #{spec}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="unionCode != '' and unionCode != null">
|
|
|
|
|
or code LIKE concat('%',#{unionCode},'%') or sptm LIKE concat('%',#{unionCode},'%') or ybbm LIKE
|
|
|
|
|
concat('%',#{unionCode},'%')
|
|
|
|
|
or code LIKE concat('%', #{unionCode}, '%')
|
|
|
|
|
or sptm LIKE concat('%', #{unionCode}, '%')
|
|
|
|
|
or ybbm LIKE
|
|
|
|
|
concat('%', #{unionCode}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="thirdSysFk != '' and thirdSysFk != null">
|
|
|
|
|
AND thirdSysFk = #{thirdSysFk}
|
|
|
|
@ -128,10 +139,12 @@
|
|
|
|
|
AND thirdSysFk = #{thirdSys}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="supName != '' and supName != null">
|
|
|
|
|
AND supName LIKE concat('%',#{supName},'%')
|
|
|
|
|
AND supName LIKE concat('%', #{supName}, '%')
|
|
|
|
|
</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 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>
|
|
|
|
|
</select>
|
|
|
|
@ -156,9 +169,9 @@
|
|
|
|
|
INTO thr_products
|
|
|
|
|
(code, `name`, measname, spec, registerNo, manufactory,
|
|
|
|
|
cplb, flbm, qxlb, ybbm, sptm, tyshxydm, zczbhhzbapzbh, ylqxzcrbarmc, ylqxzcrbarywmc, cpms,
|
|
|
|
|
thirdSysFk, updateTime, supName, model, standard, qtbm, zczyxqz, remark, remark1, remark2, remark3,price,createUser,createTime,updateUser)
|
|
|
|
|
values (
|
|
|
|
|
#{code},
|
|
|
|
|
thirdSysFk, updateTime, supName, model, standard, qtbm, zczyxqz, remark, remark1, remark2, remark3, price,
|
|
|
|
|
createUser, createTime, updateUser)
|
|
|
|
|
values (#{code},
|
|
|
|
|
#{name},
|
|
|
|
|
#{measname},
|
|
|
|
|
#{spec},
|
|
|
|
@ -188,25 +201,25 @@
|
|
|
|
|
#{price},
|
|
|
|
|
#{createUser},
|
|
|
|
|
#{createTime},
|
|
|
|
|
#{updateUser}
|
|
|
|
|
)
|
|
|
|
|
#{updateUser})
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<select id="selectThrProducts" parameterType="com.glxp.api.req.thrsys.FilterThrProductsRequest"
|
|
|
|
|
resultType="com.glxp.api.entity.thrsys.ThrProductsEntity">
|
|
|
|
|
SELECT * FROM thr_products
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM thr_products
|
|
|
|
|
<where>
|
|
|
|
|
<if test="name != '' and name != null">
|
|
|
|
|
AND name =#{name}
|
|
|
|
|
AND name = #{name}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="code != '' and code != null">
|
|
|
|
|
AND code =#{code}
|
|
|
|
|
AND code = #{code}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="registerNo != '' and registerNo != null">
|
|
|
|
|
AND registerNo=#{registerNo}
|
|
|
|
|
AND registerNo = #{registerNo}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="manufactory != '' and manufactory != null">
|
|
|
|
|
AND manufactory=#{manufactory}
|
|
|
|
|
AND manufactory = #{manufactory}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="thirdSysFk != '' and thirdSysFk != null">
|
|
|
|
|
AND thirdSysFk = #{thirdSysFk}
|
|
|
|
@ -215,4 +228,119 @@
|
|
|
|
|
ORDER BY updateTime DESC
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id"
|
|
|
|
|
parameterType="com.glxp.api.entity.system.ThrProductsEntity" useGeneratedKeys="true">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
insert into thr_products
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">
|
|
|
|
|
id,
|
|
|
|
|
</if>
|
|
|
|
|
code,
|
|
|
|
|
`name`,
|
|
|
|
|
measname,
|
|
|
|
|
spec,
|
|
|
|
|
registerNo,
|
|
|
|
|
manufactory,
|
|
|
|
|
thirdSysFk,
|
|
|
|
|
cplb,
|
|
|
|
|
flbm,
|
|
|
|
|
qxlb,
|
|
|
|
|
ybbm,
|
|
|
|
|
sptm,
|
|
|
|
|
tyshxydm,
|
|
|
|
|
zczbhhzbapzbh,
|
|
|
|
|
ylqxzcrbarmc,
|
|
|
|
|
ylqxzcrbarywmc,
|
|
|
|
|
cpms,
|
|
|
|
|
updateTime,
|
|
|
|
|
supName,
|
|
|
|
|
model,
|
|
|
|
|
`standard`,
|
|
|
|
|
qtbm,
|
|
|
|
|
zczyxqz,
|
|
|
|
|
remark,
|
|
|
|
|
remark1,
|
|
|
|
|
remark2,
|
|
|
|
|
remark3,
|
|
|
|
|
price,
|
|
|
|
|
`createUser`,
|
|
|
|
|
createTime,
|
|
|
|
|
updateUser,
|
|
|
|
|
</trim>
|
|
|
|
|
values
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">
|
|
|
|
|
#{id,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
#{code,jdbcType=VARCHAR},
|
|
|
|
|
#{name,jdbcType=VARCHAR},
|
|
|
|
|
#{measname,jdbcType=VARCHAR},
|
|
|
|
|
#{spec,jdbcType=VARCHAR},
|
|
|
|
|
#{registerNo,jdbcType=VARCHAR},
|
|
|
|
|
#{manufactory,jdbcType=VARCHAR},
|
|
|
|
|
#{thirdSysFk,jdbcType=VARCHAR},
|
|
|
|
|
#{cplb,jdbcType=VARCHAR},
|
|
|
|
|
#{flbm,jdbcType=VARCHAR},
|
|
|
|
|
#{qxlb,jdbcType=VARCHAR},
|
|
|
|
|
#{ybbm,jdbcType=VARCHAR},
|
|
|
|
|
#{sptm,jdbcType=VARCHAR},
|
|
|
|
|
#{tyshxydm,jdbcType=VARCHAR},
|
|
|
|
|
#{zczbhhzbapzbh,jdbcType=VARCHAR},
|
|
|
|
|
#{ylqxzcrbarmc,jdbcType=VARCHAR},
|
|
|
|
|
#{ylqxzcrbarywmc,jdbcType=VARCHAR},
|
|
|
|
|
#{cpms,jdbcType=LONGVARCHAR},
|
|
|
|
|
#{updateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
#{supName,jdbcType=VARCHAR},
|
|
|
|
|
#{model,jdbcType=VARCHAR},
|
|
|
|
|
#{standard,jdbcType=VARCHAR},
|
|
|
|
|
#{qtbm,jdbcType=VARCHAR},
|
|
|
|
|
#{zczyxqz,jdbcType=VARCHAR},
|
|
|
|
|
#{remark,jdbcType=VARCHAR},
|
|
|
|
|
#{remark1,jdbcType=VARCHAR},
|
|
|
|
|
#{remark2,jdbcType=VARCHAR},
|
|
|
|
|
#{remark3,jdbcType=VARCHAR},
|
|
|
|
|
#{price,jdbcType=VARCHAR},
|
|
|
|
|
#{createUser,jdbcType=VARCHAR},
|
|
|
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
#{updateUser,jdbcType=VARCHAR},
|
|
|
|
|
</trim>
|
|
|
|
|
on duplicate key update
|
|
|
|
|
<trim suffixOverrides=",">
|
|
|
|
|
<if test="id != null">
|
|
|
|
|
id = #{id,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
code = #{code,jdbcType=VARCHAR},
|
|
|
|
|
`name` = #{name,jdbcType=VARCHAR},
|
|
|
|
|
measname = #{measname,jdbcType=VARCHAR},
|
|
|
|
|
spec = #{spec,jdbcType=VARCHAR},
|
|
|
|
|
registerNo = #{registerNo,jdbcType=VARCHAR},
|
|
|
|
|
manufactory = #{manufactory,jdbcType=VARCHAR},
|
|
|
|
|
thirdSysFk = #{thirdSysFk,jdbcType=VARCHAR},
|
|
|
|
|
cplb = #{cplb,jdbcType=VARCHAR},
|
|
|
|
|
flbm = #{flbm,jdbcType=VARCHAR},
|
|
|
|
|
qxlb = #{qxlb,jdbcType=VARCHAR},
|
|
|
|
|
ybbm = #{ybbm,jdbcType=VARCHAR},
|
|
|
|
|
sptm = #{sptm,jdbcType=VARCHAR},
|
|
|
|
|
tyshxydm = #{tyshxydm,jdbcType=VARCHAR},
|
|
|
|
|
zczbhhzbapzbh = #{zczbhhzbapzbh,jdbcType=VARCHAR},
|
|
|
|
|
ylqxzcrbarmc = #{ylqxzcrbarmc,jdbcType=VARCHAR},
|
|
|
|
|
ylqxzcrbarywmc = #{ylqxzcrbarywmc,jdbcType=VARCHAR},
|
|
|
|
|
cpms = #{cpms,jdbcType=LONGVARCHAR},
|
|
|
|
|
updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
supName = #{supName,jdbcType=VARCHAR},
|
|
|
|
|
model = #{model,jdbcType=VARCHAR},
|
|
|
|
|
`standard` = #{standard,jdbcType=VARCHAR},
|
|
|
|
|
qtbm = #{qtbm,jdbcType=VARCHAR},
|
|
|
|
|
zczyxqz = #{zczyxqz,jdbcType=VARCHAR},
|
|
|
|
|
remark = #{remark,jdbcType=VARCHAR},
|
|
|
|
|
remark1 = #{remark1,jdbcType=VARCHAR},
|
|
|
|
|
remark2 = #{remark2,jdbcType=VARCHAR},
|
|
|
|
|
remark3 = #{remark3,jdbcType=VARCHAR},
|
|
|
|
|
price = #{price,jdbcType=VARCHAR},
|
|
|
|
|
`createUser` = #{createUser,jdbcType=VARCHAR},
|
|
|
|
|
createTime = #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
updateUser = #{updateUser,jdbcType=VARCHAR},
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
</mapper>
|
|
|
|
|