Pu Zhibing
2025-04-22 fd7b8fb7c89832c28a838b0449bbb8a392433ee2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.other.mapper.ShareMapper">
 
    <select id="authmanagelist" resultType="com.ruoyi.other.api.domain.Share">
        select * from t_share where del_flag = 0 and audit_status != 1
        <if test="null != name and '' != name">
            and name like CONCAT('%', #{name}, '%')
        </if>
        <if test="null != addType">
            and add_type = #{addType}
        </if>
        <if test="null != auditStatus">
            and audit_status = #{auditStatus}
        </if>
        <if test="null != userIds and userIds.size() > 0 and null != shopIds and shopIds.size() > 0">
            and (
                (add_type = 2 and object_id in
                <foreach collection="userIds" item="item" index="index" open="(" separator="," close=")">
                    #{item}
                </foreach>
                ) or (add_type = 3 and object_id in
                <foreach collection="shopIds" item="item" index="index" open="(" separator="," close=")">
                    #{item}
                </foreach>
                )
            )
        </if>
        <if test="null != userIds and userIds.size() > 0 and (null == shopIds or shopIds.size() == 0)">
            and add_type = 2 and object_id in
            <foreach collection="userIds" item="item" index="index" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        <if test="(null == userIds or userIds.size() == 0) and null != shopIds and shopIds.size() > 0">
            and add_type = 3 and object_id in
            <foreach collection="shopIds" item="item" index="index" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        order by create_time desc
    </select>
</mapper>