Commit 1c6c7c3a7221908f11aed7eea99478382a088364
Merge remote-tracking branch 'origin/dev' into test
Showing
2 changed files
with
24 additions
and
5 deletions
fw-shirasawa-dao/src/main/resources/mapper/FollowRecordMapper.xml
... | ... | @@ -123,7 +123,10 @@ |
123 | 123 | </foreach> |
124 | 124 | </if> |
125 | 125 | <if test="condition.state != null"> |
126 | - and t1.out_time = #{condition.state} | |
126 | + and t1.out_time in | |
127 | + <foreach collection="condition.state" item="id" index="index" open="(" close=")" separator=","> | |
128 | + #{id} | |
129 | + </foreach> | |
127 | 130 | </if> |
128 | 131 | <if test="condition.startTime1 !=null"> |
129 | 132 | and DATE_FORMAT(t1.plan_time, '%Y-%m-%d') >= DATE_FORMAT(#{condition.startTime1}, '%Y-%m-%d') |
... | ... | @@ -192,7 +195,10 @@ |
192 | 195 | </foreach> |
193 | 196 | </if> |
194 | 197 | <if test="condition.state != null"> |
195 | - and t1.out_time = #{condition.state} | |
198 | + and t1.out_time in | |
199 | + <foreach collection="condition.state" item="id" index="index" open="(" close=")" separator=","> | |
200 | + #{id} | |
201 | + </foreach> | |
196 | 202 | </if> |
197 | 203 | <if test="condition.startTime1 !=null"> |
198 | 204 | and DATE_FORMAT(t1.plan_time, '%Y-%m-%d') >= DATE_FORMAT(#{condition.startTime1}, '%Y-%m-%d') | ... | ... |
fw-shirasawa-domain/src/main/java/cn/fw/shirasawa/domain/query/FollowRecordPoolQuery.java
... | ... | @@ -8,14 +8,16 @@ import lombok.EqualsAndHashCode; |
8 | 8 | import lombok.ToString; |
9 | 9 | import org.apache.commons.lang3.StringUtils; |
10 | 10 | import org.apache.commons.lang3.math.NumberUtils; |
11 | +import org.springframework.util.CollectionUtils; | |
11 | 12 | |
12 | 13 | import javax.validation.constraints.NotNull; |
13 | 14 | import java.time.Instant; |
14 | -import java.time.LocalDate; | |
15 | 15 | import java.time.LocalDateTime; |
16 | 16 | import java.time.ZoneId; |
17 | +import java.util.Arrays; | |
17 | 18 | import java.util.Date; |
18 | -import java.util.Objects; | |
19 | +import java.util.List; | |
20 | +import java.util.stream.Collectors; | |
19 | 21 | |
20 | 22 | /** |
21 | 23 | * @author : kurisu |
... | ... | @@ -42,7 +44,7 @@ public class FollowRecordPoolQuery extends PoolQuery { |
42 | 44 | /** |
43 | 45 | * 状态 |
44 | 46 | */ |
45 | - private Integer state; | |
47 | + private String state; | |
46 | 48 | /** |
47 | 49 | * 查询自己的数据 |
48 | 50 | */ |
... | ... | @@ -81,4 +83,15 @@ public class FollowRecordPoolQuery extends PoolQuery { |
81 | 83 | } |
82 | 84 | return null; |
83 | 85 | } |
86 | + | |
87 | + public List<Integer> getState() { | |
88 | + if (StringUtils.isBlank(state)) { | |
89 | + return null; | |
90 | + } | |
91 | + List<Integer> list = Arrays.stream(state.split(",")).filter(StringUtils::isNoneBlank).map(Integer::valueOf).collect(Collectors.toList()); | |
92 | + if (CollectionUtils.isEmpty(list)) { | |
93 | + return null; | |
94 | + } | |
95 | + return list; | |
96 | + } | |
84 | 97 | } | ... | ... |