123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- <?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.xinxin.topro.inpnurseservice.mysqlmapper.SysDictionaryDetailInpMapper" >
- <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.SysDictionaryDetail" >
- <id column="SDD_ID" property="sddId" jdbcType="INTEGER" />
- <result column="SD_ID" property="sdId" jdbcType="INTEGER" />
- <result column="SDD_Detail_Code" property="sddDetailCode" jdbcType="VARCHAR" />
- <result column="SDD_Detail_Name" property="sddDetailName" jdbcType="VARCHAR" />
- <result column="SDD_PinyinCode" property="sddPinyincode" jdbcType="VARCHAR" />
- <result column="SDD_WubiCode" property="sddWubicode" jdbcType="VARCHAR" />
- <result column="SDD_OtherCode" property="sddOthercode" jdbcType="VARCHAR" />
- <result column="SDD_Sort" property="sddSort" jdbcType="INTEGER" />
- <result column="UI_ID" property="uiId" jdbcType="VARCHAR" />
- <result column="SDD_Update_Time" property="sddUpdateTime" jdbcType="TIMESTAMP" />
- <result column="SDD_IsDel" property="sddIsdel" jdbcType="INTEGER" />
- <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
- <result column="pop_up" property="popUp" jdbcType="INTEGER" />
- <result column="sdd_remark" property="sddRemark" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="Base_Column_List" >
- SDD_ID, SD_ID, SDD_Detail_Code, SDD_Detail_Name, SDD_PinyinCode, SDD_WubiCode, SDD_OtherCode,
- SDD_Sort, UI_ID, SDD_Update_Time, SDD_IsDel, HI_ID, pop_up, sdd_remark
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from sys_dictionary_detail
- where SDD_IsDel = 0 and SDD_ID = #{sddId,jdbcType=INTEGER}
- </select>
- <select id="selectByDetailCode" resultMap="BaseResultMap" parameterType="java.lang.String" >
- select
- <include refid="Base_Column_List" />
- from sys_dictionary_detail
- where SDD_IsDel = 0 and SDD_Detail_Code = #{code,jdbcType=VARCHAR}
- and SD_ID in (45, 50) limit 1
- </select>
- <select id="selectBySDID" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from sys_dictionary_detail
- where SDD_IsDel = 0 and SD_ID = #{SD_ID,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from sys_dictionary_detail
- where SDD_ID = #{sddId,jdbcType=INTEGER}
- </delete>
- <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.SysDictionaryDetail" >
- insert into sys_dictionary_detail
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="sddId != null" >
- SDD_ID,
- </if>
- <if test="sdId != null" >
- SD_ID,
- </if>
- <if test="sddDetailCode != null" >
- SDD_Detail_Code,
- </if>
- <if test="sddDetailName != null" >
- SDD_Detail_Name,
- </if>
- <if test="sddPinyincode != null" >
- SDD_PinyinCode,
- </if>
- <if test="sddWubicode != null" >
- SDD_WubiCode,
- </if>
- <if test="sddOthercode != null" >
- SDD_OtherCode,
- </if>
- <if test="sddSort != null" >
- SDD_Sort,
- </if>
- <if test="uiId != null" >
- UI_ID,
- </if>
- <if test="sddUpdateTime != null" >
- SDD_Update_Time,
- </if>
- <if test="sddIsdel != null" >
- SDD_IsDel,
- </if>
- <if test="hiId != null" >
- HI_ID,
- </if>
- <if test="popUp != null" >
- pop_up,
- </if>
- <if test="sddRemark != null" >
- sdd_remark,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="sddId != null" >
- #{sddId,jdbcType=INTEGER},
- </if>
- <if test="sdId != null" >
- #{sdId,jdbcType=INTEGER},
- </if>
- <if test="sddDetailCode != null" >
- #{sddDetailCode,jdbcType=VARCHAR},
- </if>
- <if test="sddDetailName != null" >
- #{sddDetailName,jdbcType=VARCHAR},
- </if>
- <if test="sddPinyincode != null" >
- #{sddPinyincode,jdbcType=VARCHAR},
- </if>
- <if test="sddWubicode != null" >
- #{sddWubicode,jdbcType=VARCHAR},
- </if>
- <if test="sddOthercode != null" >
- #{sddOthercode,jdbcType=VARCHAR},
- </if>
- <if test="sddSort != null" >
- #{sddSort,jdbcType=INTEGER},
- </if>
- <if test="uiId != null" >
- #{uiId,jdbcType=VARCHAR},
- </if>
- <if test="sddUpdateTime != null" >
- #{sddUpdateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="sddIsdel != null" >
- #{sddIsdel,jdbcType=INTEGER},
- </if>
- <if test="hiId != null" >
- #{hiId,jdbcType=INTEGER},
- </if>
- <if test="popUp != null" >
- #{popUp,jdbcType=INTEGER},
- </if>
- <if test="sddRemark != null" >
- #{sddRemark,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <insert id="batchInsert">
- INSERT INTO sys_dictionary_detail ( SD_ID, SDD_Detail_Code, SDD_Detail_Name, SDD_PinyinCode, SDD_WubiCode, SDD_OtherCode,
- SDD_Sort, UI_ID, SDD_Update_Time, SDD_IsDel, HI_ID, pop_up, sdd_remark)
- VALUES
- <foreach collection="list" item="item" separator=",">
- ( #{item.sdId,jdbcType=INTEGER}, #{item.sddDetailCode,jdbcType=VARCHAR},
- #{item.sddDetailName,jdbcType=VARCHAR}, #{item.sddPinyincode,jdbcType=VARCHAR}, #{item.sddWubicode,jdbcType=VARCHAR},
- #{item.sddOthercode,jdbcType=VARCHAR}, #{item.sddSort,jdbcType=INTEGER}, #{item.uiId,jdbcType=VARCHAR},
- #{item.sddUpdateTime,jdbcType=TIMESTAMP}, #{item.sddIsdel,jdbcType=INTEGER},#{item.hiId,jdbcType=INTEGER}, #{item.popUp,jdbcType=INTEGER}, #{item.sddRemark,jdbcType=VARCHAR})
- </foreach>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.SysDictionaryDetail" >
- update sys_dictionary_detail
- <set >
- <if test="sdId != null" >
- SD_ID = #{sdId,jdbcType=INTEGER},
- </if>
- <if test="sddDetailCode != null" >
- SDD_Detail_Code = #{sddDetailCode,jdbcType=VARCHAR},
- </if>
- <if test="sddDetailName != null" >
- SDD_Detail_Name = #{sddDetailName,jdbcType=VARCHAR},
- </if>
- <if test="sddPinyincode != null" >
- SDD_PinyinCode = #{sddPinyincode,jdbcType=VARCHAR},
- </if>
- <if test="sddWubicode != null" >
- SDD_WubiCode = #{sddWubicode,jdbcType=VARCHAR},
- </if>
- <if test="sddOthercode != null" >
- SDD_OtherCode = #{sddOthercode,jdbcType=VARCHAR},
- </if>
- <if test="sddSort != null" >
- SDD_Sort = #{sddSort,jdbcType=INTEGER},
- </if>
- <if test="uiId != null" >
- UI_ID = #{uiId,jdbcType=VARCHAR},
- </if>
- <if test="sddUpdateTime != null" >
- SDD_Update_Time = #{sddUpdateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="sddIsdel != null" >
- SDD_IsDel = #{sddIsdel,jdbcType=INTEGER},
- </if>
- <if test="hiId != null" >
- HI_ID = #{hiId,jdbcType=INTEGER},
- </if>
- <if test="popUp != null" >
- pop_up = #{popUp,jdbcType=INTEGER},
- </if>
- <if test="sddRemark != null" >
- sdd_remark = #{sddRemark,jdbcType=VARCHAR},
- </if>
- </set>
- where SDD_ID = #{sddId,jdbcType=INTEGER}
- </update>
- <select id="getDetailByCode" resultMap="BaseResultMap">
- select <include refid="Base_Column_List"/>
- from sys_dictionary_detail sdd
- where sdd.SDD_IsDel = 0
- and exists(select 1 from sys_dictionary sd
- where sd.SD_DicDM = #{sdDicDM,jdbcType=VARCHAR}
- and sd.SD_IsDel = 0
- and (sd.HI_ID = #{hiId,jdbcType=INTEGER} or sd.HI_ID = 0)
- and sd.SD_ID = sdd.SD_ID
- )
- order by SDD_Sort
- </select>
- <select id="getResponse" resultType="com.xinxin.topro.inpnurseservice.response.DictinoryResponse">
- SELECT sd.SD_DicDM AS sdDicDm, sdd.SDD_Detail_Code AS sddDetailCode, sdd.SDD_Detail_Name AS sddDetailName FROM sys_dictionary sd
- INNER JOIN sys_dictionary_detail sdd ON sd.SD_ID = sdd.SD_ID
- WHERE sd.SD_IsDel = 0
- AND sdd.SDD_IsDel = 0
- AND (sd.HI_ID = #{hiId,jdbcType=INTEGER} OR sd.HI_ID = 0)
- AND sd.SD_DicDM IN
- <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
- #{item, jdbcType=VARCHAR}
- </foreach>
- </select>
- </mapper>
|