| | |
| | | select objectId as storeId from sys_user where id = #{userId} and objectType = 3 and objectId is not null |
| | | union all |
| | | select id as storeId from t_store where storeStaffId = #{userId} |
| | | ) relation_store |
| | | ) relation_store |
| | | </select> |
| | | <select id="getUserIdsByStoreIds" resultType="java.lang.Integer"> |
| | | select distinct userId from ( |
| | | select userId from sys_user_store |
| | | where isDeleted = 0 and storeId in |
| | | <foreach collection="storeIds" separator="," item="storeId" open="(" close=")"> |
| | | #{storeId} |
| | | </foreach> |
| | | union all |
| | | select id as userId from sys_user |
| | | where objectType = 3 and objectId in |
| | | <foreach collection="storeIds" separator="," item="storeId" open="(" close=")"> |
| | | #{storeId} |
| | | </foreach> |
| | | union all |
| | | select storeStaffId as userId from t_store |
| | | where storeStaffId is not null and id in |
| | | <foreach collection="storeIds" separator="," item="storeId" open="(" close=")"> |
| | | #{storeId} |
| | | </foreach> |
| | | ) relation_user |
| | | </select> |
| | | |
| | | <select id="getByAccount" resultType="com.dsh.guns.modular.system.model.User"> |