123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302 |
- <?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.SysDictionaryInpMapper" >
- <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.SysDictionary" >
- <id column="SD_ID" property="sdId" jdbcType="INTEGER" />
- <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
- <result column="SD_DicDM" property="sdDicDM" jdbcType="VARCHAR"/>
- <result column="SD_DicName" property="sdDicName" jdbcType="VARCHAR"/>
- <result column="SD_SupID" property="sdSupID" jdbcType="INTEGER"/>
- <result column="SD_IsDel" property="sdIsDel" jdbcType="INTEGER"/>
- <result column="SD_PinyinCode" property="sdPinyinCode" jdbcType="VARCHAR"/>
- <result column="SD_WubiCode" property="sdWubiCode" jdbcType="VARCHAR"/>
- <result column="SD_OtherCode" property="sdOtherCode" jdbcType="VARCHAR"/>
- <result column="SD_Sort" property="sdSort" jdbcType="INTEGER" />
- <result column="UI_ID" property="uiId" jdbcType="VARCHAR" />
- <result column="SD_Update_Time" property="sdUpdateTime" jdbcType="TIMESTAMP" />
- </resultMap>
- <sql id="Base_Column_List" >
- SD_ID, HI_ID, SD_DicDM, SD_DicName, SD_SupID, SD_IsDel, SD_PinyinCode, SD_WubiCode,
- SD_OtherCode, SD_Sort, UI_ID, SD_Update_Time
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from sys_dictionary
- where SD_IsDel = 0 and SD_ID = #{sdId,jdbcType=INTEGER}
- </select>
- <select id="selectBySDDicDM" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from sys_dictionary
- where SD_IsDel = 0 and SD_DicDM = #{SD_DicDM,jdbcType=VARCHAR} and (HI_ID = #{hiId,jdbcType=INTEGER} or HI_ID = 0 )
- </select>
- <select id="selectBySDDicCode" resultType="com.xinxin.topro.inpnurseservice.response.DictionaryInfoResponse"
- parameterType="java.lang.String">
- select T2.SDD_Detail_Code AS sddCode,T2.SDD_ID AS sddID,T2.SDD_Detail_Name AS sddName from sys_dictionary T
- LEFT JOIN sys_dictionary_detail T2
- on T2.SD_ID = T.SD_ID
- where T.SD_IsDel = 0 and T.SD_DicDM=#{sdDicDM,jdbcType=VARCHAR}
- and T2.SDD_IsDel = 0
- </select>
- <select id="selectNameBySdcode" resultType="java.lang.String"
- parameterType="com.xinxin.topro.inpnurseservice.vo.InpDictionarySelectNameByCodeVo">
- select T2.SDD_Detail_Name from sys_dictionary T
- LEFT JOIN sys_dictionary_detail T2
- on T2.SD_ID = T.SD_ID
- where T.SD_IsDel = 0
- and T2.SDD_Detail_Code=#{SdDicDM,jdbcType=VARCHAR}
- </select>
- <select id="selectAll" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from sys_dictionary
- where SD_IsDel = 0
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from sys_dictionary
- where SD_ID = #{sdId,jdbcType=INTEGER}
- </delete>
- <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.SysDictionary" >
- insert into sys_dictionary
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="sdId != null" >
- SD_ID,
- </if>
- <if test="hiId != null" >
- HI_ID,
- </if>
- <if test="sdDicDM != null">
- SD_DicDM,
- </if>
- <if test="sdDicName != null">
- SD_DicName,
- </if>
- <if test="sdSupID != null">
- SD_SupID,
- </if>
- <if test="sdIsDel != null">
- SD_IsDel,
- </if>
- <if test="sdPinyinCode != null">
- SD_PinyinCode,
- </if>
- <if test="sdWubiCode != null">
- SD_WubiCode,
- </if>
- <if test="sdOtherCode != null">
- SD_OtherCode,
- </if>
- <if test="sdSort != null" >
- SD_Sort,
- </if>
- <if test="uiId != null" >
- UI_ID,
- </if>
- <if test="sdUpdateTime != null" >
- SD_Update_Time,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="sdId != null" >
- #{sdId,jdbcType=INTEGER},
- </if>
- <if test="hiId != null" >
- #{hiId,jdbcType=INTEGER},
- </if>
- <if test="sdDicDM != null">
- #{sdDicDM,jdbcType=VARCHAR},
- </if>
- <if test="sdDicName != null">
- #{sdDicName,jdbcType=VARCHAR},
- </if>
- <if test="sdSupID != null">
- #{sdSupID,jdbcType=INTEGER},
- </if>
- <if test="sdIsDel != null">
- #{sdIsDel,jdbcType=INTEGER},
- </if>
- <if test="sdPinyinCode != null">
- #{sdPinyinCode,jdbcType=VARCHAR},
- </if>
- <if test="sdWubiCode != null">
- #{sdWubiCode,jdbcType=VARCHAR},
- </if>
- <if test="sdOtherCode != null">
- #{sdOtherCode,jdbcType=VARCHAR},
- </if>
- <if test="sdSort != null" >
- #{sdSort,jdbcType=INTEGER}, UPDATE
- </if>
- <if test="uiId != null" >
- #{uiId,jdbcType=VARCHAR},
- </if>
- <if test="sdUpdateTime != null" >
- #{sdUpdateTime,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.SysDictionary" >
- update sys_dictionary
- <set >
- <if test="hiId != null" >
- HI_ID = #{hiId,jdbcType=INTEGER},
- </if>
- <if test="sdDicDM != null">
- SD_DicDM = #{sdDicDM,jdbcType=VARCHAR},
- </if>
- <if test="sdDicName != null">
- SD_DicName = #{sdDicName,jdbcType=VARCHAR},
- </if>
- <if test="sdSupID != null">
- SD_SupID = #{sdSupID,jdbcType=INTEGER},
- </if>
- <if test="sdIsDel != null">
- SD_IsDel = #{sdIsDel,jdbcType=INTEGER},
- </if>
- <if test="sdPinyinCode != null">
- SD_PinyinCode = #{sdPinyinCode,jdbcType=VARCHAR},
- </if>
- <if test="sdWubiCode != null">
- SD_WubiCode = #{sdWubiCode,jdbcType=VARCHAR},
- </if>
- <if test="sdOtherCode != null">
- SD_OtherCode = #{sdOtherCode,jdbcType=VARCHAR},
- </if>
- <if test="sdSort != null" >
- SD_Sort = #{sdSort,jdbcType=INTEGER},
- </if>
- <if test="uiId != null" >
- UI_ID = #{uiId,jdbcType=VARCHAR},
- </if>
- <if test="sdUpdateTime != null" >
- SD_Update_Time = #{sdUpdateTime,jdbcType=TIMESTAMP},
- </if>
- </set>
- where SD_ID = #{sdId,jdbcType=INTEGER}
- </update>
- <select id="selectByCode" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from sys_dictionary
- where SD_IsDel = 0
- AND
- SD_DicDM = #{sdDicDM,jdbcType=VARCHAR}
- </select>
- <select id="selectListBySDDicCode" resultType="com.xinxin.topro.inpnurseservice.vo.DictionaryInfoResponseVo"
- parameterType="java.util.List">
- select T.SD_DicDM as sdCode,T2.SDD_Detail_Code AS sddCode,T2.SDD_ID AS sddID,T2.SDD_Detail_Name AS sddName from sys_dictionary T
- LEFT JOIN sys_dictionary_detail T2
- on T2.SD_ID = T.SD_ID
- <if test="sdDicDmList != null">
- where T.SD_IsDel = 0
- and T2.SDD_IsDel= 0
- and (T2.HI_ID = #{hiId,jdbcType=INTEGER} or T2.HI_ID = 0 )
- and T.SD_DicDM in
- <foreach item="sdDicDmList" index="index" collection="sdDicDmList" open="(" separator="," close=")">
- #{sdDicDmList}
- </foreach>
- </if>
- </select>
- <resultMap id="VOResultMap" type="com.xinxin.topro.inpnurseservice.vo.SysDictionaryVO" extends="BaseResultMap">
- <collection property="detailList" ofType="com.xinxin.topro.inpnurseservice.vo.SysDictionaryDetailVO">
- <result column="SDD_ID" property="sddId" 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" />
- </collection>
- </resultMap>
- <select id="getDetailByCodeList" resultMap="VOResultMap">
- select sd.SD_ID, SD_DicDM, SD_DicName, SDD_ID, SDD_Detail_Code, SDD_Detail_Name
- from sys_dictionary sd left join sys_dictionary_detail sdd on sd.SD_ID = sdd.SD_ID and sdd.SDD_IsDel = 0
- where sd.SD_DicDM in
- <foreach collection="list" item="item" separator="," open="(" close=")">
- #{item,jdbcType=VARCHAR}
- </foreach>
- and sd.SD_IsDel = 0
- and (sd.HI_ID = #{hiId,jdbcType=INTEGER} or sd.HI_ID = 0)
- order by sd.SD_ID, sdd.SDD_Sort
- </select>
- <select id="selectAllByHiId" resultType="com.xinxin.topro.base.vo.DictionaryPubVo">
- SELECT
- sd.SD_DicDM sdCode,
- sdd.SDD_Detail_Code sddCode,
- sdd.SDD_Detail_Name sddName
- 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=0 or sd.HI_ID = #{hiId,jdbcType=INTEGER})
- </select>
- <select id="selectAllByHiIdAndCode" resultType="com.xinxin.topro.inpnurseservice.vo.DictionaryCodeVo">
- SELECT
- sd.SD_DicDM sdCode,
- sdd.SDD_Detail_Code sddCode,
- sdd.SDD_Detail_Name sddName,
- sdd.SDD_OtherCode sddOtherCode
- 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=0 or sd.HI_ID = #{hiId,jdbcType=INTEGER})
- and sd.SD_DicDM in
- <foreach item="sdDicDmList" index="index" collection="sdDicDmList" open="(" separator="," close=")">
- #{sdDicDmList}
- </foreach>
- </select>
- <select id="selectListByCode" resultType="com.xinxin.topro.base.vo.DictionaryPubVo">
- SELECT
- sd.SD_DicDM sdCode,
- sdd.SDD_Detail_Code sddCode,
- sdd.SDD_Detail_Name sddName
- FROM
- sys_dictionary sd
- INNER JOIN sys_dictionary_detail sdd ON sd.SD_ID = sdd.SD_ID
- WHERE
- sd.SD_DicDM = #{sdDicDM,jdbcType=VARCHAR}
- AND sd.SD_IsDel = 0
- AND sdd.SDD_IsDel = 0
- AND (
- sdd.SDD_PinyinCode LIKE CONCAT(#{keyword,jdbcType=VARCHAR}, '%')
- OR sdd.SDD_WubiCode LIKE CONCAT(#{keyword,jdbcType=VARCHAR}, '%')
- OR sdd.SDD_Detail_Name LIKE CONCAT(#{keyword,jdbcType=VARCHAR}, '%')
- )
- </select>
- <select id="selectByCodes" resultType="java.lang.String">
- SELECT
- sdd.SDD_Detail_Code
- 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.SD_DicDM in
- <foreach item="item" index="index" collection="codes" open="(" separator="," close=")">
- #{item}
- </foreach>
- </select>
- </mapper>
|