liuxiaolong
2019-05-06 f99bc8c6a1d10610373738edd7d0aa0181c81d99
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
<?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.cloud.user.dao.SysPermissionDao">
 
    <sql id="where">
        <where>
            <if test="permission != null and permission != ''">
                and t.permission like concat('%', #{permission}, '%')
            </if>
            <if test="name != null and name != ''">
                and t.name like concat('%', #{name}, '%')
            </if>
        </where>
    </sql>
    <select id="count" resultType="int">
        select count(*) from sys_permission t
        <include refid="where" />
    </select>
 
    <select id="findData" resultType="com.cloud.model.sys.SysPermission">
        select * from sys_permission t
        <include refid="where" />
        order by t.id desc
        <if test="start != null and start >= 0 and length != null and length > 0">
            limit #{start}, #{length}
        </if>
    </select>
</mapper>