123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <?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.gxzc.zen.api.sys.mapper.SysRoleMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.gxzc.zen.api.sys.model.SysRole">
- <result column="id" property="id"/>
- <result column="enable" property="enable"/>
- <result column="remark" property="remark"/>
- <result column="create_time" property="createTime"/>
- <result column="create_by" property="createBy"/>
- <result column="update_time" property="updateTime"/>
- <result column="update_by" property="updateBy"/>
- <result column="name" property="name"/>
- <result column="code" property="code"/>
- <result column="perms" property="perms"/>
- </resultMap>
- <sql id="dynamicSqlWhere">
- <where>
- <if test="p != null">
- <if test="p.enable != null">
- <choose>
- <when test="p.enable == true">
- AND enable = 1
- </when>
- <otherwise>
- AND enable = 0
- </otherwise>
- </choose>
- </if>
- <if test="p.name != null">
- AND `name` LIKE CONCAT('%', #{p.name}, '%')
- </if>
- <if test="p.code != null">
- AND code LIKE CONCAT('%', #{p.code}, '%')
- </if>
- <if test="p.id != null">
- AND id = #{p.id}
- </if>
- </if>
- </where>
- </sql>
- <sql id="dynamicSqlSet">
- <set>
- <if test="et.name != null">
- `name` = #{et.name},
- </if>
- <if test="et.code != null">
- code = #{et.code},
- </if>
- <if test="et.perms != null">
- perms = #{et.perms},
- </if>
- <if test="et.createTime != null">
- create_time = #{et.createTime},
- </if>
- <if test="et.createBy != null">
- create_by = #{et.createBy},
- </if>
- <if test="et.updateTime != null">
- update_time = #{et.updateTime},
- </if>
- <if test="et.updateBy != null">
- update_by = #{et.updateBy},
- </if>
- <if test="et.remark != null">
- remark = #{et.remark},
- </if>
- <if test="et.enable != null">
- <choose>
- <when test="et.enable == true">
- `enable` = 1
- </when>
- <otherwise>
- `enable` = 0
- </otherwise>
- </choose>
- </if>
- </set>
- </sql>
- <select id="selectByParams" resultType="com.gxzc.zen.api.sys.model.SysRole">
- SELECT *
- FROM sys_role
- <include refid="dynamicSqlWhere"/>
- ORDER BY id
- </select>
- <select id="selectByParamsPage" resultType="com.gxzc.zen.api.sys.model.SysRole">
- SELECT *
- FROM sys_role
- <include refid="dynamicSqlWhere"/>
- ORDER BY id
- </select>
- <update id="updateNoLogic" parameterType="com.gxzc.zen.api.sys.model.SysRole">
- UPDATE sys_role
- <include refid="dynamicSqlSet"/>
- <where>
- ${ew.sqlSegment}
- </where>
- </update>
- <delete id="physicalDelete">
- DELETE FROM sys_role
- <where>
- ${ew.sqlSegment}
- </where>
- </delete>
- </mapper>
|