yangys
2024-04-02 1a77b1a7c072b136925d6d73c4d8f017ca016e3a
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
44
45
46
<?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.qianwen.smartman.modules.system.mapper.PostMapper">
    <delete id="removePost">
        delete
        from blade_post
    </delete>
 
    <delete id="removePostByIds">
        delete from blade_post
        <if test="roleIds != null and roleIds.size() > 0">
            where id IN
            <foreach collection="roleIds" item="roleId" open="(" separator="," close=")">
                #{roleId}
            </foreach>
        </if>
    </delete>
 
    <select id="selectPostPage" resultType="com.qianwen.smartman.modules.system.vo.PostDetailVO">
        select id,post_name,post_code,status
        from blade_post
        where is_deleted = 0
        <if test="query.keywords != null and query.keywords != ''">
            and post_code LIKE concat(concat('%', #{query.keywords}),'%')
            or post_name LIKE concat(concat('%', #{query.keywords}),'%')
        </if>
        <if test="query.status != null">
            and status = #{query.status}
        </if>
        order by create_time desc,id desc
    </select>
 
    <select id="getPostNames" resultType="java.lang.String">
        SELECT
        post_name
        FROM
        blade_post
        WHERE
        id IN
        <foreach collection="array" item="ids" index="index" open="(" close=")" separator=",">
            #{ids}
        </foreach>
        and is_deleted = 0
    </select>
 
</mapper>