123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- <?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.sysservice.dao.mysqlmapper.SysDictionaryInpMapper" >
- <resultMap id="BaseResultMap" type="com.xinxin.topro.sysservice.dao.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>
- <resultMap id="HashMap" type="com.xinxin.topro.sysservice.vo.SysDictionaryVO" >
- <collection property="list" ofType="com.xinxin.topro.sysservice.dao.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" />
- </collection>
- </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" parameterType="java.lang.String" >
- select
- <include refid="Base_Column_List" />
- from sys_dictionary
- where SD_IsDel = 0 and SD_DicDM = #{SD_DicDM,jdbcType=VARCHAR}
- </select>
- <select id="selectBySDDicCode" resultType="com.xinxin.topro.sysservice.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}
- </select>
- <select id="selectNameBySdcode" resultType="java.lang.String" parameterType="java.lang.String">
- 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
- and (HI_ID = #{hiId,jdbcType=INTEGER} or HI_ID = 0)
- </select>
- <insert id="insert" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysDictionary" useGeneratedKeys="true" keyProperty="sdId">
- insert into sys_dictionary(HI_ID, SD_DicDM, SD_DicName, SD_SupID, SD_IsDel, SD_PinyinCode, SD_WubiCode,
- SD_OtherCode, SD_Sort, UI_ID, SD_Update_Time)
- values(#{hiId,jdbcType=INTEGER},#{sdDicDM,jdbcType=VARCHAR},#{sdDicName,jdbcType=VARCHAR},
- #{sdSupID,jdbcType=INTEGER},0,#{sdPinyinCode,jdbcType=VARCHAR},#{sdWubiCode,jdbcType=VARCHAR},
- #{sdOtherCode,jdbcType=VARCHAR},#{sdSort,jdbcType=INTEGER}, #{uiId,jdbcType=VARCHAR},now())
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysDictionary" >
- update sys_dictionary
- <set >
- <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>
- SD_Update_Time = now()
- </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="selectPart" resultMap="HashMap">
- SELECT
- sdd.SDD_Detail_Code,
- sdd.SDD_Detail_Name,
- sd.SD_DicDM,
- sd.SD_DicName,
- sd.SD_ID,
- sdd.SDD_ID
- FROM
- sys_dictionary sd,
- sys_dictionary_detail sdd
- <where>
- sd.SD_ID = sdd.SD_ID
- AND sdd.SDD_IsDel = 0
- AND sd.SD_IsDel = 0
- and (sd.HI_ID = #{hiId,jdbcType=INTEGER} or sd.HI_ID = 0)
- <if test="sddDetailName != null and sddDetailName != '' ">
- and (SDD_Detail_Name like concat('%',#{sddDetailName,jdbcType=VARCHAR},'%')
- or SDD_Detail_Code like concat('%',#{sddDetailName,jdbcType=VARCHAR},'%')
- or SDD_PinyinCode like concat('%',#{sddDetailName,jdbcType=VARCHAR},'%')
- or SDD_WubiCode like concat('%',#{sddDetailName,jdbcType=VARCHAR},'%'))
- </if>
- AND sd.SD_DicDM in
- <foreach collection="list" separator="," open="(" close=")" item="item">
- #{item}
- </foreach>
- order by sd.SD_Sort
- </where>
- </select>
- <select id="selectByHiId" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from sys_dictionary
- where (HI_ID = #{hiId,jdbcType=INTEGER} or HI_ID = 0)
- and SD_IsDel = 0
- order by SD_Sort
- </select>
- <select id="countByCodeExcludeId" resultType="java.lang.Integer">
- select count(1) from sys_dictionary
- where SD_DicDM = #{sdDicCode,jdbcType=VARCHAR}
- <if test="sdId != null">
- and SD_ID != #{sdId,jdbcType=INTEGER}
- </if>
- </select>
- <select id="countBySupId" resultType="java.lang.Integer">
- select count(1) from sys_dictionary
- where SD_SupID = #{sdSupId,jdbcType=INTEGER}
- and SD_IsDel = 0
- </select>
- <update id="deleteBySdId">
- update sys_dictionary set
- SD_IsDel = -1,
- SD_Update_Time = now(),
- UI_ID = #{uiId,jdbcType=VARCHAR}
- where SD_ID = #{sdId,jdbcType=INTEGER}
- </update>
- </mapper>
|