<?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="cn.com.basic.role.entity.SysFunctionitem">
|
|
<resultMap id="BaseResultMap" type="cn.com.basic.role.entity.SysFunctionitem" >
|
<id column="id" property="id" jdbcType="VARCHAR" />
|
<result column="name" property="name" jdbcType="VARCHAR" />
|
<result column="pid" property="pid" jdbcType="VARCHAR" />
|
<result column="src_url" property="srcUrl" jdbcType="VARCHAR" />
|
<result column="target_url" property="targetUrl" jdbcType="VARCHAR" />
|
<result column="url_param" property="urlParam" jdbcType="VARCHAR" />
|
<result column="default_privilege" property="defaultPrivilege" jdbcType="BIGINT" />
|
<result column="order_num" property="orderNum" jdbcType="BIGINT" />
|
<result column="comment" property="comment" jdbcType="VARCHAR" />
|
<result column="status" property="status" jdbcType="TINYINT" />
|
<result column="is_valid" property="isValid" jdbcType="TINYINT" />
|
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
<result column="update_user_id" property="updateUserId" jdbcType="VARCHAR" />
|
</resultMap>
|
<sql id="Base_Column_List" >
|
id, name, pid, src_url, target_url, url_param, default_privilege, order_num, comment, status, is_valid,
|
update_time, update_user_id
|
</sql>
|
|
<sql id="Base_Where_Clause">
|
<where>
|
<trim prefixOverrides="and">
|
<if test="id != null"> and ID = #{id}</if>
|
<if test="name != null" >
|
and name like CONCAT("%",#{name},"%")
|
</if>
|
<if test="pid != null" >
|
and pid = #{pid,jdbcType=VARCHAR}
|
</if>
|
<if test="srcUrl != null" >
|
and src_url = #{srcUrl,jdbcType=VARCHAR}
|
</if>
|
<if test="targetUrl != null" >
|
and target_url = #{targetUrl,jdbcType=VARCHAR}
|
</if>
|
<if test="urlParam != null" >
|
and url_param = #{urlParam,jdbcType=VARCHAR}
|
</if>
|
<if test="orderNum != null" >
|
and order_num = #{orderNum,jdbcType=BIGINT}
|
</if>
|
<if test="comment != null" >
|
and comment = #{comment,jdbcType=VARCHAR}
|
</if>
|
<if test="status != null" >
|
and status = #{status,jdbcType=TINYINT}
|
</if>
|
<if test="isValid != null" >
|
and is_valid = #{isValid,jdbcType=TINYINT}
|
</if>
|
<if test="updateTime != null" >
|
and update_time = #{updateTime,jdbcType=TIMESTAMP}
|
</if>
|
<if test="updateUserId != null" >
|
and update_user_id = #{updateUserId,jdbcType=VARCHAR}
|
</if>
|
</trim>
|
</where>
|
<if test="sorting != null">order by ${sorting}</if>
|
<if test="offset != null and limit != null">
|
limit #{offset}, #{limit}
|
</if>
|
</sql>
|
|
<!-- 查询总数 -->
|
<select id="selectCount" resultType="java.lang.Long" parameterType="java.util.Map">
|
select count(ID)
|
from t_sys_function_item
|
<include refid="Base_Where_Clause" />
|
</select>
|
|
<!-- 查询 -->
|
<select id="select" resultMap="BaseResultMap" parameterType="java.util.Map">
|
select
|
<include refid="Base_Column_List" />
|
from t_sys_function_item
|
<include refid="Base_Where_Clause" />
|
</select>
|
<!-- 根据ID删除-->
|
<delete id="deleteById" parameterType="java.lang.String">
|
delete from
|
t_sys_function_item
|
where ID = #{id}
|
</delete>
|
|
<!-- 根据ID查询 -->
|
<select id="selectById" resultMap="BaseResultMap" parameterType="java.lang.String">
|
select
|
<include refid="Base_Column_List" />
|
from t_sys_function_item
|
where ID = #{id}
|
</select>
|
<!-- 添加 -->
|
<insert id="insert" parameterType="cn.com.basic.role.entity.SysFunctionitem">
|
insert into t_sys_function_item (id, name, pid,
|
src_url, target_url, url_param,
|
default_privilege, order_num, comment,
|
status, is_valid, update_time,
|
update_user_id
|
)
|
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR},
|
#{srcUrl,jdbcType=VARCHAR}, #{targetUrl,jdbcType=VARCHAR}, #{urlParam,jdbcType=VARCHAR},
|
#{defaultPrivilege,jdbcType=BIGINT},#{orderNum,jdbcType=BIGINT}, #{comment,jdbcType=VARCHAR},
|
#{status,jdbcType=TINYINT},#{isValid,jdbcType=TINYINT}, #{updateTime,jdbcType=TIMESTAMP},
|
#{updateUserId,jdbcType=VARCHAR}
|
)
|
</insert>
|
|
<!-- 通过ID更新 -->
|
<update id="updateByIdSelective" parameterType="cn.com.basic.role.entity.SysFunctionitem">
|
update t_sys_function_item
|
<set >
|
<if test="name != null" >
|
name = #{name,jdbcType=VARCHAR},
|
</if>
|
<if test="pid != null" >
|
pid = #{pid,jdbcType=VARCHAR},
|
</if>
|
<if test="srcUrl != null" >
|
src_url = #{srcUrl,jdbcType=VARCHAR},
|
</if>
|
<if test="targetUrl != null" >
|
target_url = #{targetUrl,jdbcType=VARCHAR},
|
</if>
|
<if test="urlParam != null" >
|
url_param = #{urlParam,jdbcType=VARCHAR},
|
</if>
|
<if test="defaultPrivilege != null" >
|
default_privilege = #{defaultPrivilege,jdbcType=BIGINT},
|
</if>
|
<if test="orderNum != null" >
|
order_num = #{orderNum,jdbcType=BIGINT},
|
</if>
|
<if test="comment != null" >
|
comment = #{comment,jdbcType=VARCHAR},
|
</if>
|
<if test="status != null" >
|
status = #{status,jdbcType=TINYINT},
|
</if>
|
<if test="isValid != null" >
|
is_valid = #{isValid,jdbcType=TINYINT},
|
</if>
|
<if test="updateTime != null" >
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateUserId != null" >
|
update_user_id = #{updateUserId,jdbcType=VARCHAR},
|
</if>
|
</set>
|
where id = #{id,jdbcType=VARCHAR}
|
</update>
|
|
<!-- 根据IDs删除 -->
|
<delete id="deleteByIds">
|
delete from
|
t_sys_function_item
|
where
|
<foreach collection="array" item="id" open="id in (" close=")" separator=",">
|
'${id}'
|
</foreach>
|
</delete>
|
</mapper>
|