|
@@ -0,0 +1,111 @@
|
|
|
+<?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.jiuzhekan.cbkj.mapper.dic.TDicBaseMapper">
|
|
|
+
|
|
|
+ <resultMap id="BaseResultMap" type="com.jiuzhekan.cbkj.beans.dic.TDicBase">
|
|
|
+ <id column="dic_id" jdbcType="VARCHAR" property="dicId" />
|
|
|
+ <result column="dic_code" jdbcType="VARCHAR" property="dicCode" />
|
|
|
+ <result column="dic_name" jdbcType="VARCHAR" property="dicName" />
|
|
|
+ <result column="parent_id" jdbcType="VARCHAR" property="parentId" />
|
|
|
+ <result column="dic_desc" jdbcType="VARCHAR" property="dicDesc" />
|
|
|
+ <result column="sort" jdbcType="VARCHAR" property="sort" />
|
|
|
+ <result column="app_id" jdbcType="VARCHAR" property="appId" />
|
|
|
+ <result column="ins_code" jdbcType="VARCHAR" property="insCode" />
|
|
|
+ <result column="dept_id" jdbcType="VARCHAR" property="deptId" />
|
|
|
+ <result column="pha_id" jdbcType="VARCHAR" property="phaId" />
|
|
|
+ <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
|
|
|
+ <result column="create_user" jdbcType="VARCHAR" property="createUser" />
|
|
|
+ <result column="create_user_name" jdbcType="VARCHAR" property="createUserName" />
|
|
|
+ <result column="is_enable" jdbcType="VARCHAR" property="isEnable" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ dic_id,dic_code,dic_name,parent_id,dic_desc,sort,app_id,ins_code,dept_id,pha_id,create_date,create_user,create_user_name,is_enable
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="TDicBase">
|
|
|
+ delete from t_dic_base where dic_id = #{ dicId }
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteBylist" parameterType="ArrayList">
|
|
|
+ delete from t_dic_base where dic_id in
|
|
|
+ <foreach collection="array" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <insert id="insert" parameterType="TDicBase">
|
|
|
+ insert into t_dic_base (<include refid="Base_Column_List" />) values
|
|
|
+ (#{dicId},#{dicCode},#{dicName},#{parentId},#{dicDesc},#{sort},#{appId},#{insCode},#{deptId},#{phaId},#{createDate},#{createUser},#{createUserName},#{isEnable})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertList" parameterType="List">
|
|
|
+ insert into t_dic_base (<include refid="Base_Column_List" />) values
|
|
|
+ <foreach collection="list" item="item" index="index" separator="," >
|
|
|
+ (#{item.dicId},#{item.dicCode},#{item.dicName},#{item.parentId},#{item.dicDesc},#{item.sort},#{item.appId},#{item.insCode},#{item.deptId},#{item.phaId},#{item.createDate},#{item.createUser},#{item.createUserName},#{item.isEnable})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateByPrimaryKey" parameterType="TDicBase">
|
|
|
+ update t_dic_base
|
|
|
+ <set>
|
|
|
+ <if test="dicCode != null">
|
|
|
+ dic_code = #{ dicCode },
|
|
|
+ </if>
|
|
|
+ <if test="dicName != null">
|
|
|
+ dic_name = #{ dicName },
|
|
|
+ </if>
|
|
|
+ <if test="parentId != null">
|
|
|
+ parent_id = #{ parentId },
|
|
|
+ </if>
|
|
|
+ <if test="dicDesc != null">
|
|
|
+ dic_desc = #{ dicDesc },
|
|
|
+ </if>
|
|
|
+ <if test="sort != null">
|
|
|
+ sort = #{ sort },
|
|
|
+ </if>
|
|
|
+ <if test="appId != null">
|
|
|
+ app_id = #{ appId },
|
|
|
+ </if>
|
|
|
+ <if test="insCode != null">
|
|
|
+ ins_code = #{ insCode },
|
|
|
+ </if>
|
|
|
+ <if test="deptId != null">
|
|
|
+ dept_id = #{ deptId },
|
|
|
+ </if>
|
|
|
+ <if test="phaId != null">
|
|
|
+ pha_id = #{ phaId },
|
|
|
+ </if>
|
|
|
+ <if test="createDate != null">
|
|
|
+ create_date = #{ createDate },
|
|
|
+ </if>
|
|
|
+ <if test="createUser != null">
|
|
|
+ create_user = #{ createUser },
|
|
|
+ </if>
|
|
|
+ <if test="createUserName != null">
|
|
|
+ create_user_name = #{ createUserName },
|
|
|
+ </if>
|
|
|
+ <if test="isEnable != null">
|
|
|
+ is_enable = #{ isEnable },
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where dic_id = #{ dicId }
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="getObjectById" resultMap="BaseResultMap" parameterType="String">
|
|
|
+ select <include refid="Base_Column_List" />
|
|
|
+ from t_dic_base where dic_id = #{dicId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getPageListByObj" parameterType="TDicBase" resultMap="BaseResultMap">
|
|
|
+ SELECT dic_id,dic_code,dic_name,parent_id,dic_desc,sort,app_id,ins_code,dept_id,pha_id,create_date,create_user,create_user_name,is_enable
|
|
|
+ from t_dic_base
|
|
|
+ <where>
|
|
|
+ <if test=" dicName != null and dicName!='' ">
|
|
|
+ and dic_name like CONCAT('%',trim(#{dicName}),'%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|