提交时间
This commit is contained in:
@@ -3,6 +3,7 @@ package com.cool.store.dao;
|
||||
import com.cool.store.entity.LinePayDO;
|
||||
import com.cool.store.mapper.LinePayMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -56,12 +57,19 @@ public class LinePayDAO {
|
||||
}
|
||||
|
||||
|
||||
public Map<Long,LinePayDO> getLinePayByLineIds(List<Long> lineIds) {
|
||||
if(Objects.isNull(lineIds) || lineIds.size() == 0){
|
||||
public Map<Long,LinePayDO> getLinePayByLineIds(List<Long> lineIds,Integer payBusinessType) {
|
||||
if(CollectionUtils.isEmpty(lineIds)){
|
||||
return new HashMap<>();
|
||||
}
|
||||
List<LinePayDO> linePayDO = linePayMapper.getLinePayByLineIds(lineIds);
|
||||
List<LinePayDO> linePayDO = linePayMapper.getLinePayByLineIds(lineIds,null,payBusinessType);
|
||||
return linePayDO.stream().collect(Collectors.toMap(LinePayDO::getLineId, linePayDO1 -> linePayDO1, (o, n) -> o));
|
||||
}
|
||||
|
||||
public Map<Long,LinePayDO> getLinePayByShopIds(List<Long> shopIds,Integer payBusinessType) {
|
||||
if(CollectionUtils.isEmpty(shopIds)){
|
||||
return new HashMap<>();
|
||||
}
|
||||
List<LinePayDO> linePayDO = linePayMapper.getLinePayByLineIds(null,shopIds,payBusinessType);
|
||||
return linePayDO.stream().collect(Collectors.toMap(LinePayDO::getShopId, linePayDO1 -> linePayDO1, (o, n) -> o));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public interface LinePayMapper {
|
||||
* @param lineIds
|
||||
* @return
|
||||
*/
|
||||
List<LinePayDO> getLinePayByLineIds(@Param("lineIds") List<Long> lineIds);
|
||||
List<LinePayDO> getLinePayByLineIds(@Param("lineIds") List<Long> lineIds, @Param("shopIds") List<Long> shopIds, @Param("businessType") Integer businessType);
|
||||
|
||||
void updateByPidAndLid(@Param("lineId") Long lineId,
|
||||
@Param("partnerId") String partnerId,
|
||||
|
||||
@@ -316,10 +316,20 @@
|
||||
|
||||
<select id="getLinePayByLineIds" resultMap="BaseResultMap">
|
||||
select * from xfsg_line_pay where deleted = 0
|
||||
<if test="lineIds !=null and lineIds.size>0">
|
||||
<foreach collection="lineIds" item="lineId" open="and line_id in (" close=")" separator=",">
|
||||
#{lineId}
|
||||
</foreach>
|
||||
</if>
|
||||
<where>
|
||||
<if test="businessType!=null">
|
||||
and pay_business_type = #{businessType}
|
||||
</if>
|
||||
<if test="lineIds !=null and lineIds.size>0">
|
||||
<foreach collection="lineIds" item="lineId" open="and line_id in (" close=")" separator=",">
|
||||
#{lineId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="shopIds !=null and shopIds.size>0">
|
||||
<foreach collection="shopIds" item="shopId" open="and shop_id in (" close=")" separator=",">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user