双屏机查询人脸、人员信息条件优化
This commit is contained in:
parent
b3cd13d4a4
commit
11b71392f6
|
|
@ -31,6 +31,7 @@ public class UserServiceImpl implements UserService {
|
||||||
return AjaxResult.success(new ArrayList<>());
|
return AjaxResult.success(new ArrayList<>());
|
||||||
}
|
}
|
||||||
List<UserInfoVo> moneyList = mapper.getMoneyList();
|
List<UserInfoVo> moneyList = mapper.getMoneyList();
|
||||||
|
if (!moneyList.isEmpty()){
|
||||||
// 构建 userId 到 moneyVo 的映射,提升查找效率
|
// 构建 userId 到 moneyVo 的映射,提升查找效率
|
||||||
Map<String, UserInfoVo> moneyMap = moneyList.stream().collect(Collectors.toMap(UserInfoVo::getUserId, vo -> vo, (a, b) -> a));
|
Map<String, UserInfoVo> moneyMap = moneyList.stream().collect(Collectors.toMap(UserInfoVo::getUserId, vo -> vo, (a, b) -> a));
|
||||||
list.forEach(userInfoVo -> {
|
list.forEach(userInfoVo -> {
|
||||||
|
|
@ -42,7 +43,9 @@ public class UserServiceImpl implements UserService {
|
||||||
userInfoVo.setPersonalWalletBalance(money.getPersonalWalletBalance());
|
userInfoVo.setPersonalWalletBalance(money.getPersonalWalletBalance());
|
||||||
userInfoVo.setSubsidiesBalance(money.getSubsidiesBalance());
|
userInfoVo.setSubsidiesBalance(money.getSubsidiesBalance());
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
face_state
|
face_state
|
||||||
from user_face
|
from user_face
|
||||||
<where>
|
<where>
|
||||||
|
<if test="userId != null and userId != '' and userId != 0 and userId != '0'">
|
||||||
|
and user_id = #{userId}
|
||||||
|
</if>
|
||||||
<if test="time != null and time != ''">
|
<if test="time != null and time != ''">
|
||||||
and update_time >= #{time} - INTERVAL 5 SECOND;
|
and update_time >= #{time} - INTERVAL 10 SECOND
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.bonus.canteen.core.android.mapper.UserMapper">
|
<mapper namespace="com.bonus.canteen.core.android.mapper.UserMapper">
|
||||||
<select id="getUserInfo" resultType="com.bonus.canteen.core.android.vo.UserInfoVo">
|
<select id="getUserInfo" resultType="com.bonus.canteen.core.android.vo.UserInfoVo">
|
||||||
select
|
select su.user_id as userId,
|
||||||
su.user_id as userId,
|
|
||||||
su.user_name as userName,
|
su.user_name as userName,
|
||||||
su.nick_name as nickName,
|
su.nick_name as nickName,
|
||||||
ac.account_id as accId,
|
ac.account_id as accId,
|
||||||
|
|
@ -23,12 +22,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</if>
|
</if>
|
||||||
<if test="type == 'user'">
|
<if test="type == 'user'">
|
||||||
<if test="time != null and time != ''">
|
<if test="time != null and time != ''">
|
||||||
AND su.update_time >= (#{time} - INTERVAL 5 SECOND)
|
AND su.update_time >= (#{time} - INTERVAL 10 SECOND)
|
||||||
</if>
|
</if>
|
||||||
</if>
|
</if>
|
||||||
<if test="type == 'card'">
|
<if test="type == 'card'">
|
||||||
<if test="time != null and time != ''">
|
<if test="time != null and time != ''">
|
||||||
AND ac.update_time >= (#{time} - INTERVAL 5 SECOND)
|
AND ac.update_time >= (#{time} - INTERVAL 10 SECOND)
|
||||||
</if>
|
</if>
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue