Merge branch '20231205-jmh-fixSearchChoicenessSourceItem'

master
jianminghui 12 months ago
commit 372a4cb0d7

@ -5,6 +5,7 @@ import com.ms.dal.entity.DdCategoryToSourceRelation;
import com.ms.api.service.DdCategoryToSourceRelationIdService;
import com.ms.dal.mapper.DdCategoryToSourceRelationIdMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -63,7 +64,7 @@ public class DdCategoryToSourceRelationIdServiceImpl implements DdCategoryToSour
}
@Override
public Integer getSingleDdCanUsedDsCid(Long shopId, String curCid) {
public Integer getSingleDdCanUsedDsCid(@Param("shopId") Long shopId, @Param("curCid") String curCid) {
String dsCid = ddCategoryToSourceRelationIdMapper.getSingleDdCanUsedDsCid(shopId, curCid);
if (dsCid == null) {
return 0;

@ -61,7 +61,7 @@ public class SearchChoicenessSourceItemService extends SPIBaseService implements
}
if(ddCanUsed != null && ddCanUsed > 0 && cid != null && cid > 0) {
cid = getSingleDdCanUsedDsCid(cid);
cid = getSingleDdCanUsedDsCid(String.valueOf(cid));
if (cid == 0) {
result.put("result", "success");
result.put("sourceItems", new ArrayList<>());
@ -148,8 +148,8 @@ public class SearchChoicenessSourceItemService extends SPIBaseService implements
return getDsCidByDdCid(ddCid);
}
private Integer getSingleDdCanUsedDsCid(Integer curCid) {
return ddCategoryToSourceRelationIdService.getSingleDdCanUsedDsCid(shopId, String.valueOf(curCid));
private Integer getSingleDdCanUsedDsCid(String curCid) {
return ddCategoryToSourceRelationIdService.getSingleDdCanUsedDsCid(shopId, curCid);
}
private Integer getDsCidByDdCid(Long ddCid) {

@ -158,10 +158,12 @@
<select id="getSingleDdCanUsedDsCid" resultType="java.lang.String">
select m.source_category_id from dd_category_to_source_relation m
left join category_shop c on m.dd_category_id = c.category_id
where c.shop_id = #{shopId}
<where>
c.shop_id = #{shopId}
<if test="curCid != null">
and source_category_id = #{curCid,jdbcType=VARCHAR}
and source_category_id = #{curCid}
</if>
</where>
limit 1
</select>
<insert id="batchInsert" keyColumn="dd_category_to_source_relation_id" keyProperty="ddCategoryToSourceRelationId" >

Loading…
Cancel
Save