94 lines
3.0 KiB
Plaintext
94 lines
3.0 KiB
Plaintext
|
|
<?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.bonus.sys.dao.SysDictTypeDao" >
|
||
|
|
<resultMap id="BaseResultMap" type="com.bonus.sys.beans.SysDictTypeBean" >
|
||
|
|
<id column="PID" property="id" jdbcType="INTEGER" />
|
||
|
|
<result column="PNAME" property="name" jdbcType="VARCHAR" />
|
||
|
|
<result column="ISACTIVE" property="isActive" jdbcType="INTEGER" />
|
||
|
|
|
||
|
|
<collection property="dicts" ofType="com.bonus.sys.beans.SysDataDictBean">
|
||
|
|
<collection property="data" ofType="com.bonus.sys.beans.ViewImgBean">
|
||
|
|
<id column="pid" property="pid" jdbcType="INTEGER" />
|
||
|
|
<result column="preName" property="alt" jdbcType="VARCHAR" />
|
||
|
|
<result column="saveName" property="src" jdbcType="VARCHAR" />
|
||
|
|
<result column="thumb" property="thumb" jdbcType="VARCHAR" />
|
||
|
|
</collection>
|
||
|
|
</collection>
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<resultMap id="resultMap" type="com.bonus.sys.beans.SysDictTypeBean" >
|
||
|
|
<id column="ID" property="id" jdbcType="INTEGER" />
|
||
|
|
<result column="NAME" property="name" jdbcType="VARCHAR" />
|
||
|
|
<result column="IS_ACTIVE" property="isActive" jdbcType="INTEGER" />
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<select id="findByPage" resultMap="resultMap" parameterType="com.bonus.sys.beans.SysDictTypeBean">
|
||
|
|
SELECT
|
||
|
|
sdt.*
|
||
|
|
FROM
|
||
|
|
sys_dict_type sdt
|
||
|
|
<where>
|
||
|
|
1 = 1
|
||
|
|
<if test="param.keyWord!= null">
|
||
|
|
AND sdt.NAME LIKE CONCAT('%',#{param.keyWord},'%')
|
||
|
|
</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="find" resultMap="resultMap" parameterType="com.bonus.sys.beans.SysDictTypeBean">
|
||
|
|
SELECT
|
||
|
|
sdt.*
|
||
|
|
FROM
|
||
|
|
sys_dict_type sdt
|
||
|
|
where
|
||
|
|
sdt.is_active = 1
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insert" parameterType="com.bonus.sys.beans.SysDictTypeBean" >
|
||
|
|
insert into
|
||
|
|
sys_dict_type(NAME,IS_ACTIVE)
|
||
|
|
values(
|
||
|
|
#{name},
|
||
|
|
#{isActive}
|
||
|
|
)
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<select id="findDictTypeById" parameterType="com.bonus.sys.beans.SysDictTypeBean" resultMap="BaseResultMap">
|
||
|
|
select
|
||
|
|
sdd.*,
|
||
|
|
sdt.ID as pid,
|
||
|
|
sdt.NAME as pname,
|
||
|
|
sdt.IS_ACTIVE as isActive
|
||
|
|
from sys_dict_type sdt, sys_data_dict sdd where sdt.ID=sdd.DICT_TYPE and sdt.ID=#{id}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
|
||
|
|
<update id="update" parameterType="com.bonus.sys.beans.SysDictTypeBean">
|
||
|
|
update sys_dict_type
|
||
|
|
<set>
|
||
|
|
<if test="name != null and name != ''">
|
||
|
|
NAME = #{name,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="isActive != null">
|
||
|
|
IS_ACTIVE = #{isActive,jdbcType=INTEGER},
|
||
|
|
</if>
|
||
|
|
</set>
|
||
|
|
where ID = #{id,jdbcType=INTEGER}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<delete id="delete" parameterType="com.bonus.sys.beans.SysDictTypeBean">
|
||
|
|
delete from sys_dict_type
|
||
|
|
where ID = #{id,jdbcType=INTEGER}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="batchDeleteByList" parameterType="java.util.List">
|
||
|
|
DELETE FROM sys_dict_type WHERE ID in(
|
||
|
|
<foreach item="id" collection="noHas" open="" separator=","
|
||
|
|
close="">
|
||
|
|
#{id}
|
||
|
|
</foreach>
|
||
|
|
)
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
|
||
|
|
</mapper>
|