mybatis-mapper.XxlJobUserMapper.xml Maven / Gradle / Ivy
<?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.xxl.job.admin.dao.XxlJobUserDao"> <resultMap id="BaseResultMap" type="com.xxl.job.admin.core.model.XxlJobUser"> <result column="username" property="username" /> <result column="password" property="password" /> <result column="permission" property="permission" /> <result column="permission_data" property="permissionData" /> </resultMap> <sql id="Base_Column_List"> username, password, permission,permission_data </sql> <select id="loadByName" resultMap="BaseResultMap" parameterType="java.lang.String" > select <include refid="Base_Column_List" /> from XXL_JOB_QRTZ_USER where username = #{username} </select> <select id="pageList" parameterType="java.util.Map" resultMap="BaseResultMap"> SELECT <include refid="Base_Column_List" /> FROM XXL_JOB_QRTZ_USER AS t <trim prefix="WHERE" prefixOverrides="AND | OR" > <if test="username != null and username != '' "> AND t.username like CONCAT('%',#{username},'%') </if> <if test="permission gt -1"> AND t.permission = #{permission} </if> </trim> ORDER BY t.username LIMIT #{offset}, #{pagesize} </select> <select id="pageListCount" parameterType="java.util.Map" resultType="int"> SELECT count(1) FROM XXL_JOB_QRTZ_USER AS t <trim prefix="WHERE" prefixOverrides="AND | OR" > <if test="username != null and username != '' "> AND t.username like CONCAT('%',#{username},'%') </if> <if test="permission gt -1"> AND t.permission = #{permission} </if> </trim> </select> <insert id="add" parameterType="com.xxl.job.admin.core.model.XxlJobUser" > INSERT INTO XXL_JOB_QRTZ_USER( `username`, `password`, `permission`, `permission_data` ) VALUES( #{username}, #{password}, #{permission}, #{permissionData} ) </insert> <update id="update" parameterType="com.xxl.job.admin.core.model.XxlJobUser" > UPDATE XXL_JOB_QRTZ_USER SET `password` = #{password}, `permission` = #{permission}, `permission_data` = #{permissionData} WHERE `username` = #{username} </update> <delete id="delete" parameterType="java.util.Map" > DELETE FROM XXL_JOB_QRTZ_USER WHERE `username` = #{username} </delete> </mapper>