Commit fc33d842 by 郑云飞

init

parent 22eba737
......@@ -6,6 +6,7 @@ import com.yunniu.farming.common.plugin.PageInfo;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author zyf
......@@ -60,4 +61,10 @@ public class GroupArea {
@JsonInclude(JsonInclude.Include.NON_NULL)
private Integer pagesize;
@TableField(exist = false)
private Long groupBuyId;
@TableField(exist = false)
private List<Integer> areaIds;
}
package com.yunniu.farming.webadmin.service.impl;
import com.alibaba.fastjson.JSON;
import com.yunniu.farming.result.Result;
import com.yunniu.farming.webadmin.dao.GroupAreaDao;
import com.yunniu.farming.webadmin.dao.GroupBuyDao;
import com.yunniu.farming.webadmin.model.GroupArea;
import com.yunniu.farming.webadmin.model.GroupBuy;
import com.yunniu.farming.webadmin.service.GroupAreaService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -23,9 +26,15 @@ public class GroupAreaServiceimpl implements GroupAreaService {
@Autowired
private GroupAreaDao mapper;
@Autowired
private GroupBuyDao groupBuyDao;
@Override
public List<GroupArea> findPageList(GroupArea item) {
GroupBuy groupBuy = groupBuyDao.selectById(item.getGroupBuyId());
if (StringUtils.isNotEmpty(groupBuy.getAreaIds())) {
List<Integer> areaids = JSON.parseArray(groupBuy.getAreaIds(), Integer.class);
item.setAreaIds(areaids);
}
return mapper.findPageList(item);
}
......
......@@ -12,6 +12,12 @@
<if test="areaAddress != null and areaAddress != ''">
and areaAddress like concat('%', #{areaAddress,jdbcType=VARCHAR}, '%')
</if>
<if test="areaIds != null and areaIds.size > 0">
and id in
<foreach collection="areaIds" separator="," open="(" item="item" index="index" close=")" nullable="true">
#{areaIds[${index}]}
</foreach>
</if>
</where>
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment