|
|
@@ -15,7 +15,7 @@ import com.punchsettle.server.atomic.mapper.UserMapper;
|
|
|
import com.punchsettle.server.atomic.service.IUserService;
|
|
|
import com.punchsettle.server.common.utils.Assert;
|
|
|
|
|
|
-import io.micrometer.common.util.StringUtils;
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
import tk.mybatis.mapper.weekend.Weekend;
|
|
|
import tk.mybatis.mapper.weekend.WeekendCriteria;
|
|
|
|
|
|
@@ -41,7 +41,7 @@ public class UserServiceImpl implements IUserService {
|
|
|
|
|
|
@Override
|
|
|
public User getByOpenId(String openId) {
|
|
|
- if (StringUtils.isBlank(openId)) {
|
|
|
+ if (!StringUtils.hasText(openId)) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
@@ -90,4 +90,20 @@ public class UserServiceImpl implements IUserService {
|
|
|
Assert.notEmpty(users);
|
|
|
userMapper.batchUpdateSelective(users);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int countByCondition(String creationTimeFrom, String creationTimeTo) {
|
|
|
+ Assert.isNull(creationTimeFrom);
|
|
|
+ Assert.isNull(creationTimeTo);
|
|
|
+
|
|
|
+ Weekend<User> weekend = WeekendUtils.createExcludeAuditFields(User.class);
|
|
|
+ WeekendCriteria<User, Object> criteria = weekend.weekendCriteria();
|
|
|
+ if (StringUtils.hasText(creationTimeFrom)) {
|
|
|
+ criteria.andGreaterThanOrEqualTo(User::getCreationTime, creationTimeFrom);
|
|
|
+ }
|
|
|
+ if (StringUtils.hasText(creationTimeTo)) {
|
|
|
+ criteria.andLessThanOrEqualTo(User::getCreationTime, creationTimeTo);
|
|
|
+ }
|
|
|
+ return userMapper.selectCountByExample(weekend);
|
|
|
+ }
|
|
|
}
|