Authored by gemingdan

update

... ... @@ -43,7 +43,7 @@
<if test="brand != null"> and brand = #{brand,jdbcType=INTEGER}</if>
<if test="type != null"> and type = #{type,jdbcType=INTEGER}</if>
<if test="state != null"> and state = #{state,jdbcType=INTEGER}</if>
limit {start},{size}
limit #{start},#{size}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from union_share_rebate_brand
... ... @@ -62,9 +62,6 @@
<insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" parameterType="com.yoho.unions.dal.model.UnionShareRebateBrand" >
insert into union_share_rebate_brand
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="brand != null" >
brand,
</if>
... ... @@ -91,9 +88,6 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="brand != null" >
#{brand,jdbcType=INTEGER},
</if>
... ... @@ -123,9 +117,6 @@
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.unions.dal.model.UnionShareRebateBrand" >
update union_share_rebate_brand
<set >
<if test="brand != null" >
brand = #{brand,jdbcType=INTEGER},
</if>
<if test="name != null" >
name = #{name,jdbcType=VARCHAR},
</if>
... ... @@ -153,9 +144,6 @@
<update id="updateWithLogid" parameterType="com.yoho.unions.dal.model.UnionShareRebateBrand" >
update union_share_rebate_brand
<set >
<if test="brand != null" >
brand = #{brand,jdbcType=INTEGER},
</if>
<if test="name != null" >
name = #{name,jdbcType=VARCHAR},
</if>
... ... @@ -179,7 +167,7 @@
</update>
<update id="updateByPrimaryKey" parameterType="com.yoho.unions.dal.model.UnionShareRebateBrand" >
update union_share_rebate_brand
set brand = #{brand,jdbcType=INTEGER},
set
name = #{name,jdbcType=VARCHAR},
type = #{type,jdbcType=INTEGER},
state = #{state,jdbcType=INTEGER},
... ...
... ... @@ -46,7 +46,7 @@
<if test="brand != null"> and brand = #{brand,jdbcType=INTEGER}</if>
<if test="type != null"> and type = #{type,jdbcType=INTEGER}</if>
<if test="state != null"> and state = #{state,jdbcType=INTEGER}</if>
limit {start},{size}
limit #{start},#{size}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from union_share_rebate_skn
... ... @@ -65,9 +65,6 @@
<insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" parameterType="com.yoho.unions.dal.model.UnionShareRebateSkn" >
insert into union_share_rebate_skn
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="skn != null" >
skn,
</if>
... ... @@ -97,9 +94,6 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="skn != null" >
#{skn,jdbcType=INTEGER},
</if>
... ... @@ -132,9 +126,6 @@
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.unions.dal.model.UnionShareRebateSkn" >
update union_share_rebate_skn
<set >
<if test="skn != null" >
skn = #{skn,jdbcType=INTEGER},
</if>
<if test="brand != null" >
brand = #{brand,jdbcType=INTEGER},
</if>
... ... @@ -165,9 +156,6 @@
<update id="updateWithLogid" parameterType="com.yoho.unions.dal.model.UnionShareRebateSkn" >
update union_share_rebate_skn
<set >
<if test="skn != null" >
skn = #{skn,jdbcType=INTEGER},
</if>
<if test="brand != null" >
brand = #{brand,jdbcType=INTEGER},
</if>
... ... @@ -197,7 +185,7 @@
</update>
<update id="updateByPrimaryKey" parameterType="com.yoho.unions.dal.model.UnionShareRebateSkn" >
update union_share_rebate_skn
set skn = #{skn,jdbcType=INTEGER},
set
brand = #{brand,jdbcType=INTEGER},
name = #{name,jdbcType=VARCHAR},
rebate = #{rebate,jdbcType=INTEGER},
... ...
... ... @@ -323,9 +323,11 @@ public class UnionShareRebateServiceImpl implements IUnionShareRebateService,IBu
}
private Map<Integer, BrandBo> gerBrandInfoMap(List<Integer> brands){
logger.info("gerBrandInfoMap start.brands is {}",brands);
BatchBaseRequest<Integer> req = new BatchBaseRequest<Integer>();
req.setParams(brands);
BrandBo[] boArr = serviceCaller.call("product.queryBrandByIds", req, BrandBo[].class);
logger.info("gerBrandInfoMap start.call product.queryBrandByIds,brands is {},boArr is {},size is {}",brands,boArr,boArr.length);
Map<Integer, BrandBo> boMap = new HashMap<>();
for (int i = 0; i < boArr.length; i++) {
boMap.put(boArr[i].getId(), boArr[i]);
... ... @@ -333,13 +335,17 @@ public class UnionShareRebateServiceImpl implements IUnionShareRebateService,IBu
return boMap;
}
private Map<Integer, ProductBo> gerProductInfoMap(List<Integer> skns){
logger.info("gerProductInfoMap start.skns is {}",skns);
BatchBaseRequest<Integer> req = new BatchBaseRequest<Integer>();
req.setParams(skns);
ProductBo[] boArr = serviceCaller.call("product.batchQueryProductsForUnion", req, ProductBo[].class);
Map<Integer, ProductBo> boMap = new HashMap<>();
for (int i = 0; i < boArr.length; i++) {
boMap.put(boArr[i].getErpProductId(), boArr[i]);
ProductBo[] productArr = serviceCaller.call("product.batchQueryProductsForUnion", req, ProductBo[].class);
logger.info("gerProductInfoMap start.call product.batchQueryProductsForUnion,skns is {},productArr is {},size is {}",skns,productArr,productArr.length);
Map<Integer, ProductBo> productMap = new HashMap<>();
for (int i = 0; i < productArr.length; i++) {
productMap.put(productArr[i].getErpProductId(), productArr[i]);
logger.info("gerProductInfoMap . {},product is {}}",skns,productArr,productArr.length);
}
return boMap;
return productMap;
}
}
... ...