feat:消费机更新
feat:人员调用钱包部门不调动的bug
This commit is contained in:
1 parent
1c86c227ee
commit
2ca14aa1e0
38 files changed
+1903
-35
No files matched your search
@@ -126,4 +126,79 @@
|
||||
order by a.create_time desc, a.id desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="countSyncDuplicateAutoCodes" resultType="java.lang.Long">
|
||||
select count(0)
|
||||
from (
|
||||
select cast(a.auto_code as unsigned) as numeric_auto_code
|
||||
from sys_user_face a
|
||||
inner join sys_user u on u.user_id = a.user_id and u.del_flag = '0'
|
||||
inner join sys_dept d on d.dept_id = u.dept_id and d.del_flag = '0'
|
||||
where a.del_flag = '0'
|
||||
and a.process_status = #{processStatus}
|
||||
and a.auto_code regexp '^[0-9]+$'
|
||||
and d.dept_id in
|
||||
<foreach collection="deptIds" item="deptId" open="(" close=")" separator=",">
|
||||
#{deptId}
|
||||
</foreach>
|
||||
group by cast(a.auto_code as unsigned)
|
||||
having count(0) > 1
|
||||
) duplicate_codes
|
||||
</select>
|
||||
|
||||
<select id="selectSyncSnapshotMaxId" resultType="java.lang.Long">
|
||||
select coalesce(max(a.id), 0)
|
||||
from sys_user_face a
|
||||
inner join sys_user u on u.user_id = a.user_id and u.del_flag = '0'
|
||||
where a.del_flag = '0'
|
||||
and a.process_status = #{processStatus}
|
||||
and u.dept_id in
|
||||
<foreach collection="deptIds" item="deptId" open="(" close=")" separator=",">
|
||||
#{deptId}
|
||||
</foreach>
|
||||
<if test="userId != null">
|
||||
and a.user_id = #{userId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="listSyncSnapshotRecords" resultType="com.bsd.pjcloud.admin.api.vo.SysUserFaceSyncRecordVo">
|
||||
select a.id,
|
||||
a.auto_code as sampleId,
|
||||
a.user_id as userId,
|
||||
u.name as username,
|
||||
d.dept_id as deptId,
|
||||
d.name as deptName,
|
||||
a.face_img as faceImg,
|
||||
coalesce(a.update_time, a.create_time) as sourceUpdatedAt
|
||||
from sys_user_face a
|
||||
inner join sys_user u on u.user_id = a.user_id and u.del_flag = '0'
|
||||
inner join sys_dept d on d.dept_id = u.dept_id and d.del_flag = '0'
|
||||
where a.del_flag = '0'
|
||||
and a.process_status = #{processStatus}
|
||||
and a.id > #{afterId}
|
||||
and a.id <= #{snapshotMaxId}
|
||||
and d.dept_id in
|
||||
<foreach collection="deptIds" item="deptId" open="(" close=")" separator=",">
|
||||
#{deptId}
|
||||
</foreach>
|
||||
<if test="userId != null">
|
||||
and a.user_id = #{userId}
|
||||
</if>
|
||||
order by a.id asc
|
||||
limit #{fetchSize}
|
||||
</select>
|
||||
|
||||
<select id="listStatusCounts" resultType="com.bsd.pjcloud.admin.api.vo.SysUserFaceStatusCountVo">
|
||||
select user_id as userId,
|
||||
sum(case when process_status = #{availableStatus} then 1 else 0 end) as availableCount,
|
||||
sum(case when process_status = #{pendingStatus} then 1 else 0 end) as pendingCount
|
||||
from sys_user_face
|
||||
where del_flag = '0'
|
||||
and user_id in
|
||||
<foreach collection="userIds" item="userId" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
and process_status in (#{availableStatus}, #{pendingStatus})
|
||||
group by user_id
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in new issue
Block a user