123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306 |
- <?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.bowintek.smartsearch.mapper.SysRoleMapper">
- <resultMap id="BaseResultMap" type="com.bowintek.smartsearch.model.SysRole">
- <id column="RoleID" jdbcType="VARCHAR" property="roleID" />
- <result column="UserTypeID" jdbcType="INTEGER" property="userTypeID" />
- <result column="Name" jdbcType="VARCHAR" property="name" />
- <result column="Description" jdbcType="VARCHAR" property="description" />
- <result column="IsDefault" jdbcType="BIT" property="isDefault" />
- <result column="DefaultDataRange" jdbcType="INTEGER" property="defaultDataRange" />
- <result column="RecordStatus" jdbcType="INTEGER" property="recordStatus" />
- <result column="CreateBy" jdbcType="VARCHAR" property="createBy" />
- <result column="CreateTime" jdbcType="TIMESTAMP" property="createTime" />
- <result column="UpdateBy" jdbcType="VARCHAR" property="updateBy" />
- <result column="UpdateTime" jdbcType="TIMESTAMP" property="updateTime" />
- </resultMap>
- <sql id="Example_Where_Clause">
- <where>
- <foreach collection="oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Update_By_Example_Where_Clause">
- <where>
- <foreach collection="example.oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Base_Column_List">
- RoleID, UserTypeID, Name, Description, IsDefault, DefaultDataRange, RecordStatus,
- CreateBy, CreateTime, UpdateBy, UpdateTime
- </sql>
- <select id="selectByExample" parameterType="com.bowintek.smartsearch.model.SysRoleExample" resultMap="BaseResultMap">
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- from sys_role
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null">
- order by ${orderByClause}
- </if>
- </select>
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from sys_role
- where RoleID = #{roleID,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- delete from sys_role
- where RoleID = #{roleID,jdbcType=VARCHAR}
- </delete>
- <delete id="deleteByExample" parameterType="com.bowintek.smartsearch.model.SysRoleExample">
- delete from sys_role
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <insert id="insert" parameterType="com.bowintek.smartsearch.model.SysRole">
- insert into sys_role (RoleID, UserTypeID, Name,
- Description, IsDefault, DefaultDataRange,
- RecordStatus, CreateBy, CreateTime,
- UpdateBy, UpdateTime)
- values (#{roleID,jdbcType=VARCHAR}, #{userTypeID,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
- #{description,jdbcType=VARCHAR}, #{isDefault,jdbcType=BIT}, #{defaultDataRange,jdbcType=INTEGER},
- #{recordStatus,jdbcType=INTEGER}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
- #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP})
- </insert>
- <insert id="insertSelective" parameterType="com.bowintek.smartsearch.model.SysRole">
- insert into sys_role
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="roleID != null">
- RoleID,
- </if>
- <if test="userTypeID != null">
- UserTypeID,
- </if>
- <if test="name != null">
- Name,
- </if>
- <if test="description != null">
- Description,
- </if>
- <if test="isDefault != null">
- IsDefault,
- </if>
- <if test="defaultDataRange != null">
- DefaultDataRange,
- </if>
- <if test="recordStatus != null">
- RecordStatus,
- </if>
- <if test="createBy != null">
- CreateBy,
- </if>
- <if test="createTime != null">
- CreateTime,
- </if>
- <if test="updateBy != null">
- UpdateBy,
- </if>
- <if test="updateTime != null">
- UpdateTime,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="roleID != null">
- #{roleID,jdbcType=VARCHAR},
- </if>
- <if test="userTypeID != null">
- #{userTypeID,jdbcType=INTEGER},
- </if>
- <if test="name != null">
- #{name,jdbcType=VARCHAR},
- </if>
- <if test="description != null">
- #{description,jdbcType=VARCHAR},
- </if>
- <if test="isDefault != null">
- #{isDefault,jdbcType=BIT},
- </if>
- <if test="defaultDataRange != null">
- #{defaultDataRange,jdbcType=INTEGER},
- </if>
- <if test="recordStatus != null">
- #{recordStatus,jdbcType=INTEGER},
- </if>
- <if test="createBy != null">
- #{createBy,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateBy != null">
- #{updateBy,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null">
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.bowintek.smartsearch.model.SysRoleExample" resultType="java.lang.Long">
- select count(*) from sys_role
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </select>
- <update id="updateByExampleSelective" parameterType="map">
- update sys_role
- <set>
- <if test="row.roleID != null">
- RoleID = #{row.roleID,jdbcType=VARCHAR},
- </if>
- <if test="row.userTypeID != null">
- UserTypeID = #{row.userTypeID,jdbcType=INTEGER},
- </if>
- <if test="row.name != null">
- Name = #{row.name,jdbcType=VARCHAR},
- </if>
- <if test="row.description != null">
- Description = #{row.description,jdbcType=VARCHAR},
- </if>
- <if test="row.isDefault != null">
- IsDefault = #{row.isDefault,jdbcType=BIT},
- </if>
- <if test="row.defaultDataRange != null">
- DefaultDataRange = #{row.defaultDataRange,jdbcType=INTEGER},
- </if>
- <if test="row.recordStatus != null">
- RecordStatus = #{row.recordStatus,jdbcType=INTEGER},
- </if>
- <if test="row.createBy != null">
- CreateBy = #{row.createBy,jdbcType=VARCHAR},
- </if>
- <if test="row.createTime != null">
- CreateTime = #{row.createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="row.updateBy != null">
- UpdateBy = #{row.updateBy,jdbcType=VARCHAR},
- </if>
- <if test="row.updateTime != null">
- UpdateTime = #{row.updateTime,jdbcType=TIMESTAMP},
- </if>
- </set>
- <if test="example != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByExample" parameterType="map">
- update sys_role
- set RoleID = #{row.roleID,jdbcType=VARCHAR},
- UserTypeID = #{row.userTypeID,jdbcType=INTEGER},
- Name = #{row.name,jdbcType=VARCHAR},
- Description = #{row.description,jdbcType=VARCHAR},
- IsDefault = #{row.isDefault,jdbcType=BIT},
- DefaultDataRange = #{row.defaultDataRange,jdbcType=INTEGER},
- RecordStatus = #{row.recordStatus,jdbcType=INTEGER},
- CreateBy = #{row.createBy,jdbcType=VARCHAR},
- CreateTime = #{row.createTime,jdbcType=TIMESTAMP},
- UpdateBy = #{row.updateBy,jdbcType=VARCHAR},
- UpdateTime = #{row.updateTime,jdbcType=TIMESTAMP}
- <if test="example != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.bowintek.smartsearch.model.SysRole">
- update sys_role
- <set>
- <if test="userTypeID != null">
- UserTypeID = #{userTypeID,jdbcType=INTEGER},
- </if>
- <if test="name != null">
- Name = #{name,jdbcType=VARCHAR},
- </if>
- <if test="description != null">
- Description = #{description,jdbcType=VARCHAR},
- </if>
- <if test="isDefault != null">
- IsDefault = #{isDefault,jdbcType=BIT},
- </if>
- <if test="defaultDataRange != null">
- DefaultDataRange = #{defaultDataRange,jdbcType=INTEGER},
- </if>
- <if test="recordStatus != null">
- RecordStatus = #{recordStatus,jdbcType=INTEGER},
- </if>
- <if test="createBy != null">
- CreateBy = #{createBy,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- CreateTime = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateBy != null">
- UpdateBy = #{updateBy,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null">
- UpdateTime = #{updateTime,jdbcType=TIMESTAMP},
- </if>
- </set>
- where RoleID = #{roleID,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.bowintek.smartsearch.model.SysRole">
- update sys_role
- set UserTypeID = #{userTypeID,jdbcType=INTEGER},
- Name = #{name,jdbcType=VARCHAR},
- Description = #{description,jdbcType=VARCHAR},
- IsDefault = #{isDefault,jdbcType=BIT},
- DefaultDataRange = #{defaultDataRange,jdbcType=INTEGER},
- RecordStatus = #{recordStatus,jdbcType=INTEGER},
- CreateBy = #{createBy,jdbcType=VARCHAR},
- CreateTime = #{createTime,jdbcType=TIMESTAMP},
- UpdateBy = #{updateBy,jdbcType=VARCHAR},
- UpdateTime = #{updateTime,jdbcType=TIMESTAMP}
- where RoleID = #{roleID,jdbcType=VARCHAR}
- </update>
- </mapper>
|