|
@@ -0,0 +1,188 @@
|
|
|
+<?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.steerinfo.dil.mapper.DilRoleOrgcodeTableMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.DilRoleOrgcodeTable">
|
|
|
+ <id column="PRIMARY_ID" jdbcType="DECIMAL" property="primaryId" />
|
|
|
+ <result column="ORG_CODE" jdbcType="VARCHAR" property="orgCode" />
|
|
|
+ <result column="USER_NAME" jdbcType="VARCHAR" property="userName" />
|
|
|
+ <result column="COLUMN_ID" jdbcType="DECIMAL" property="columnId" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="columns">
|
|
|
+ PRIMARY_ID, ORG_CODE, USER_NAME, COLUMN_ID
|
|
|
+ </sql>
|
|
|
+ <sql id="columns_alias">
|
|
|
+ t.PRIMARY_ID, t.ORG_CODE, t.USER_NAME, t.COLUMN_ID
|
|
|
+ </sql>
|
|
|
+ <sql id="select">
|
|
|
+ SELECT <include refid="columns"/> FROM DIL_ROLE_ORGCODE_TABLE
|
|
|
+ </sql>
|
|
|
+ <sql id="select_alias">
|
|
|
+ SELECT <include refid="columns_alias"/> FROM DIL_ROLE_ORGCODE_TABLE t
|
|
|
+ </sql>
|
|
|
+ <sql id="where">
|
|
|
+ <where>
|
|
|
+ <if test="primaryId != null">
|
|
|
+ and PRIMARY_ID = #{primaryId}
|
|
|
+ </if>
|
|
|
+ <if test="orgCode != null and orgCode != ''">
|
|
|
+ and ORG_CODE = #{orgCode}
|
|
|
+ </if>
|
|
|
+ <if test="userName != null and userName != ''">
|
|
|
+ and USER_NAME = #{userName}
|
|
|
+ </if>
|
|
|
+ <if test="columnId != null">
|
|
|
+ and COLUMN_ID = #{columnId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <sql id="whereLike">
|
|
|
+ <where>
|
|
|
+ <if test="primaryId != null">
|
|
|
+ and PRIMARY_ID = #{primaryId}
|
|
|
+ </if>
|
|
|
+ <if test="orgCode != null and orgCode != ''">
|
|
|
+ and ORG_CODE LIKE '%${orgCode}%'
|
|
|
+ </if>
|
|
|
+ <if test="userName != null and userName != ''">
|
|
|
+ and USER_NAME LIKE '%${userName}%'
|
|
|
+ </if>
|
|
|
+ <if test="columnId != null">
|
|
|
+ and COLUMN_ID = #{columnId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
|
|
|
+ delete from DIL_ROLE_ORGCODE_TABLE
|
|
|
+ where PRIMARY_ID = #{primaryId,jdbcType=DECIMAL}
|
|
|
+ </delete>
|
|
|
+ <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
|
|
|
+ delete from DIL_ROLE_ORGCODE_TABLE
|
|
|
+ where 1!=1
|
|
|
+ <if test="orgCode != null and orgCode != ''">
|
|
|
+ or ORG_CODE = #{orgCode}
|
|
|
+ </if>
|
|
|
+ <if test="userName != null and userName != ''">
|
|
|
+ or USER_NAME = #{userName}
|
|
|
+ </if>
|
|
|
+ <if test="columnId != null">
|
|
|
+ or COLUMN_ID = #{columnId}
|
|
|
+ </if>
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.steerinfo.dil.model.DilRoleOrgcodeTable">
|
|
|
+ insert into DIL_ROLE_ORGCODE_TABLE (PRIMARY_ID, ORG_CODE, USER_NAME,
|
|
|
+ COLUMN_ID)
|
|
|
+ values (#{primaryId,jdbcType=DECIMAL}, #{orgCode,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR},
|
|
|
+ #{columnId,jdbcType=DECIMAL})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.steerinfo.dil.model.DilRoleOrgcodeTable">
|
|
|
+ insert into DIL_ROLE_ORGCODE_TABLE
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="primaryId != null">
|
|
|
+ PRIMARY_ID,
|
|
|
+ </if>
|
|
|
+ <if test="orgCode != null">
|
|
|
+ ORG_CODE,
|
|
|
+ </if>
|
|
|
+ <if test="userName != null">
|
|
|
+ USER_NAME,
|
|
|
+ </if>
|
|
|
+ <if test="columnId != null">
|
|
|
+ COLUMN_ID,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="primaryId != null">
|
|
|
+ #{primaryId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="orgCode != null">
|
|
|
+ #{orgCode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="userName != null">
|
|
|
+ #{userName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="columnId != null">
|
|
|
+ #{columnId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.DilRoleOrgcodeTable">
|
|
|
+ update DIL_ROLE_ORGCODE_TABLE
|
|
|
+ set ORG_CODE = #{orgCode,jdbcType=VARCHAR},
|
|
|
+ USER_NAME = #{userName,jdbcType=VARCHAR},
|
|
|
+ COLUMN_ID = #{columnId,jdbcType=DECIMAL}
|
|
|
+ where PRIMARY_ID = #{primaryId,jdbcType=DECIMAL}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.DilRoleOrgcodeTable">
|
|
|
+ update DIL_ROLE_ORGCODE_TABLE
|
|
|
+ <set>
|
|
|
+ <if test="orgCode != null">
|
|
|
+ ORG_CODE = #{orgCode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="userName != null">
|
|
|
+ USER_NAME = #{userName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="columnId != null">
|
|
|
+ COLUMN_ID = #{columnId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where PRIMARY_ID = #{primaryId,jdbcType=DECIMAL}
|
|
|
+ </update>
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
|
|
|
+ <include refid="select"/>
|
|
|
+ where PRIMARY_ID = #{primaryId,jdbcType=DECIMAL}
|
|
|
+ </select>
|
|
|
+ <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
|
|
|
+ <include refid="select"/>
|
|
|
+ <include refid="where"/>
|
|
|
+ </select>
|
|
|
+ <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
|
|
|
+ <include refid="select"/>
|
|
|
+ <include refid="whereLike"/>
|
|
|
+ </select>
|
|
|
+ <insert id="batchInsert" parameterType="java.util.List">
|
|
|
+ insert into DIL_ROLE_ORGCODE_TABLE
|
|
|
+ (PRIMARY_ID,
|
|
|
+ ORG_CODE, USER_NAME, COLUMN_ID
|
|
|
+ )
|
|
|
+ ( <foreach collection="list" item="item" separator="union all">
|
|
|
+ select
|
|
|
+ #{item.primaryId,jdbcType=DECIMAL},
|
|
|
+ #{item.orgCode,jdbcType=VARCHAR}, #{item.userName,jdbcType=VARCHAR}, #{item.columnId,jdbcType=DECIMAL}
|
|
|
+ from dual
|
|
|
+ </foreach> )
|
|
|
+ </insert>
|
|
|
+ <update id="batchUpdate" parameterType="java.util.List">
|
|
|
+ update DIL_ROLE_ORGCODE_TABLE
|
|
|
+ set
|
|
|
+ PRIMARY_ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case PRIMARY_ID" close="end">
|
|
|
+ when #{item.primaryId,jdbcType=DECIMAL} then #{item.primaryId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,ORG_CODE=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case PRIMARY_ID" close="end">
|
|
|
+ when #{item.primaryId,jdbcType=DECIMAL} then #{item.orgCode,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,USER_NAME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case PRIMARY_ID" close="end">
|
|
|
+ when #{item.primaryId,jdbcType=DECIMAL} then #{item.userName,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,COLUMN_ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case PRIMARY_ID" close="end">
|
|
|
+ when #{item.primaryId,jdbcType=DECIMAL} then #{item.columnId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ where PRIMARY_ID in
|
|
|
+ <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
|
|
|
+ #{item.primaryId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+ <delete id="batchDelete" parameterType="java.util.List">
|
|
|
+ delete from DIL_ROLE_ORGCODE_TABLE
|
|
|
+ where PRIMARY_ID in
|
|
|
+ <foreach collection="list" item="id" open="(" close=")" separator=",">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+ <!-- 友情提示!!!-->
|
|
|
+ <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
|
|
|
+
|
|
|
+</mapper>
|