kongzy
2023-11-27 59ae9759fd50568059fa44f43832f5a414edb3e9
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
<?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=#{user_id}
            <if test="type!=null and type!=''">
                and type=#{type}
            </if>
            <if test="type==null">
                and type in (1,2,3)
            </if>
        </where>
    </delete>
 
    <select id="getAttachsByUserId" resultType="com.gkhy.assess.system.domain.SysAttach">
        select * from sys_attach
        <where>
            and user_id=#{userId}
            <if test="type!=null and type!=''">
               and type=#{type}
            </if>
        </where>
    </select>
</mapper>