第三方产品信息接口新增厂家编码,供应商编码

pro
anthonywj 2 years ago
parent 3e53fea186
commit 17827ab959

@ -48,5 +48,7 @@ public class ThrProductsResponse {
private String updateUser;
private Date updateTime;
private String remark;
private String manufactoryCode;
private String supCode;
}

@ -240,7 +240,7 @@ public class BasicBackUpdateProductService {
udiRelevanceEntity1.setThirdId(thrProductsEntity.getCode());
udiRelevanceEntity1.setUpdateTime(new Date());
udiRelevanceEntity1.setModifyTime(new Date());
udiRelevanceEntity1.setId(IdUtil.getSnowflakeNextId());
udiRelevanceEntity1.setId(gennerOrderUtils.getRelId());
udiRelevanceService.insertUdiRelevanceignore(udiRelevanceEntity1);
}
}

@ -295,6 +295,8 @@ public class ThrProductsServiceImpl extends ServiceImpl<ThrProductsDao, ThrProdu
thrProductsEntity.setRemark2(thrProductsResponse.getRemark2());
thrProductsEntity.setRemark3(thrProductsResponse.getRemark3());
thrProductsEntity.setPrice(thrProductsResponse.getPrice());
thrProductsEntity.setManufactoryCode(thrProductsResponse.getManufactoryCode());
thrProductsEntity.setSupCode(thrProductsResponse.getSupCode());
//比对更新完的对象和原对象是否发生变化,若有变化则说明书有更新
return !thrProductsEntity.equals(oldData);

@ -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 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}
@ -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,23 +61,25 @@
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
= #{unionCode}
or code LIKE = #{unionCode}
or sptm = #{unionCode}
or ybbm LIKE
= #{unionCode}
</if>
<if test="thirdSysFk != '' and thirdSysFk != null">
AND thirdSysFk = #{thirdSysFk}
@ -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
LEFT JOIN thr_system on thr_products.thirdSysFk = thr_system.thirdId
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>
@ -153,58 +166,60 @@
<insert id="insertThrProducts" keyProperty="id"
parameterType="com.glxp.api.entity.thrsys.ThrProductsEntity">
replace
INTO thr_products
(id,code, `name`, measname, spec, registerNo, manufactory,
INTO thr_products
(id, 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 (
#{id},
#{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}
)
thirdSysFk, updateTime, supName, model, standard, qtbm, zczyxqz, remark, remark1, remark2, remark3,
price, createUser, createTime, updateUser, manufactoryCode, supCode)
values (#{id},
#{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}, #{manufactoryCode}, #{supCode})
</insert>
<select id="selectByLastTime" resultType="com.glxp.api.entity.thrsys.ThrProductsEntity">
select * from thr_products where updateTime >= #{lastUpdateTime}
select *
from thr_products
where updateTime >= #{lastUpdateTime}
</select>
<insert id="insertThrProductsList">
replace
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
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, manufactoryCode, supCode)
values
<foreach collection="list" index="index" item="item" open="(" close=")" separator=",">
#{item.code},
#{item.name},
@ -236,7 +251,7 @@
#{item.price},
#{item.createUser},
#{item.createTime},
#{item.updateUser}
#{item.updateUser}, #{manufactoryCode}, #{supCode}
</foreach>
</insert>
@ -268,7 +283,9 @@
remark1,
remark2,
remark3,
price
price,
manufactoryCode,
supCode
from thr_products
<where>
<if test="code != null and code != ''">
@ -283,33 +300,35 @@
<update id="updateEntityById" parameterType="com.glxp.api.entity.thrsys.ThrProductsEntity">
update thr_products
<set>
code = #{code,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
measname = #{measname,jdbcType=VARCHAR},
spec = #{spec,jdbcType=VARCHAR},
registerNo = #{registerNo,jdbcType=VARCHAR},
manufactory = #{manufactory,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}
code = #{code,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
measname = #{measname,jdbcType=VARCHAR},
spec = #{spec,jdbcType=VARCHAR},
registerNo = #{registerNo,jdbcType=VARCHAR},
manufactory = #{manufactory,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},
manufactoryCode = #{manufactoryCode,jdbcType=VARCHAR},
supCode = #{supCode,jdbcType=VARCHAR}
</set>
where id = #{id,jdbcType=INTEGER}
</update>

Loading…
Cancel
Save