heheng
2025-03-27 5d2cfd4562f74496a5263db3451c1e78ff53aead
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
<?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.gkhy.assess.system.mapper.SysAttachMapper">
 
    <delete id="deleteAttachsByUserId">
        delete from sys_attach
        <where>
            and user_id=#{userId}
            <if test="type!=null and type!=''">
                and type=#{type}
            </if>
            <if test="type==null">
                and type in (1,2,3)
            </if>
        </where>
    </delete>
 
    <delete id="deleteAttachsByIds">
        delete from sys_attach where id in
        <foreach collection="ids" item="id" separator="," open="(" close=")">
            #{id}
        </foreach>
    </delete>
 
    <select id="getAttachsByUserId" resultType="com.gkhy.assess.system.domain.SysAttach">
        select * from sys_attach where user_id=#{userId}
        <if test="type!=null and type!=''">
           and type=#{type}
        </if>
    </select>
</mapper>