SysDictionaryDetailMapper.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.xinxin.topro.sysservice.dao.mysqlmapper.SysDictionaryDetailInpMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.sysservice.dao.mysqlmodel.SysDictionaryDetail" >
  5. <id column="SDD_ID" property="sddId" jdbcType="INTEGER" />
  6. <result column="SD_ID" property="sdId" jdbcType="INTEGER" />
  7. <result column="SDD_Detail_Code" property="sddDetailCode" jdbcType="VARCHAR" />
  8. <result column="SDD_Detail_Name" property="sddDetailName" jdbcType="VARCHAR" />
  9. <result column="SDD_PinyinCode" property="sddPinyincode" jdbcType="VARCHAR" />
  10. <result column="SDD_WubiCode" property="sddWubicode" jdbcType="VARCHAR" />
  11. <result column="SDD_OtherCode" property="sddOthercode" jdbcType="VARCHAR" />
  12. <result column="SDD_Sort" property="sddSort" jdbcType="INTEGER" />
  13. <result column="UI_ID" property="uiId" jdbcType="VARCHAR" />
  14. <result column="SDD_Update_Time" property="sddUpdateTime" jdbcType="TIMESTAMP" />
  15. <result column="SDD_IsDel" property="sddIsdel" jdbcType="INTEGER" />
  16. <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
  17. </resultMap>
  18. <sql id="Base_Column_List" >
  19. SDD_ID, SD_ID, SDD_Detail_Code, SDD_Detail_Name, SDD_PinyinCode, SDD_WubiCode, SDD_OtherCode,
  20. SDD_Sort, UI_ID, SDD_Update_Time, SDD_IsDel, HI_ID
  21. </sql>
  22. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  23. select
  24. <include refid="Base_Column_List" />
  25. from sys_dictionary_detail
  26. where SDD_IsDel = 0 and SDD_ID = #{sddId,jdbcType=INTEGER}
  27. </select>
  28. <select id="selectByDetailCode" resultMap="BaseResultMap" parameterType="java.lang.String" >
  29. select
  30. <include refid="Base_Column_List" />
  31. from sys_dictionary_detail
  32. where SDD_IsDel = 0 and SDD_Detail_Code = #{code,jdbcType=VARCHAR}
  33. </select>
  34. <select id="selectBySDID" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  35. select
  36. <include refid="Base_Column_List" />
  37. from sys_dictionary_detail
  38. where SDD_IsDel = 0 and SD_ID = #{SD_ID,jdbcType=INTEGER}
  39. </select>
  40. <insert id="insert" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysDictionaryDetail" >
  41. insert into sys_dictionary_detail(SD_ID, SDD_Detail_Code, SDD_Detail_Name, SDD_PinyinCode, SDD_WubiCode, SDD_OtherCode,
  42. SDD_Sort, UI_ID, SDD_Update_Time, SDD_IsDel,HI_ID)
  43. values
  44. (#{sdId,jdbcType=INTEGER},#{sddDetailCode,jdbcType=VARCHAR},#{sddDetailName,jdbcType=VARCHAR},
  45. #{sddPinyincode,jdbcType=VARCHAR},#{sddWubicode,jdbcType=VARCHAR},#{sddOthercode,jdbcType=VARCHAR},
  46. #{sddSort,jdbcType=INTEGER},#{uiId,jdbcType=VARCHAR}, now(), 0,#{hiId,jdbcType=INTEGER})
  47. </insert>
  48. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysDictionaryDetail" >
  49. update sys_dictionary_detail
  50. <set >
  51. <if test="sdId != null" >
  52. SD_ID = #{sdId,jdbcType=INTEGER},
  53. </if>
  54. <if test="sddDetailCode != null" >
  55. SDD_Detail_Code = #{sddDetailCode,jdbcType=VARCHAR},
  56. </if>
  57. <if test="sddDetailName != null" >
  58. SDD_Detail_Name = #{sddDetailName,jdbcType=VARCHAR},
  59. </if>
  60. <if test="sddPinyincode != null" >
  61. SDD_PinyinCode = #{sddPinyincode,jdbcType=VARCHAR},
  62. </if>
  63. <if test="sddWubicode != null" >
  64. SDD_WubiCode = #{sddWubicode,jdbcType=VARCHAR},
  65. </if>
  66. <if test="sddOthercode != null" >
  67. SDD_OtherCode = #{sddOthercode,jdbcType=VARCHAR},
  68. </if>
  69. <if test="sddSort != null" >
  70. SDD_Sort = #{sddSort,jdbcType=INTEGER},
  71. </if>
  72. <if test="uiId != null" >
  73. UI_ID = #{uiId,jdbcType=VARCHAR},
  74. </if>
  75. <if test="sddUpdateTime != null" >
  76. SDD_Update_Time = #{sddUpdateTime,jdbcType=TIMESTAMP},
  77. </if>
  78. <if test="sddIsdel != null" >
  79. SDD_IsDel = #{sddIsdel,jdbcType=INTEGER},
  80. </if>
  81. <if test="hiId != null" >
  82. HI_ID = #{hiId,jdbcType=INTEGER},
  83. </if>
  84. </set>
  85. where SDD_ID = #{sddId,jdbcType=INTEGER}
  86. </update>
  87. <update id="deleteBySdId">
  88. update sys_dictionary_detail
  89. set SDD_IsDel = -1,
  90. UI_ID = #{uiId,jdbcType=VARCHAR},
  91. SDD_Update_Time = now()
  92. where SD_ID = #{sdId,jdbcType=INTEGER}
  93. </update>
  94. <select id="countByCodeExcludeId" resultType="java.lang.Integer">
  95. select count(1) from sys_dictionary_detail
  96. where
  97. SDD_Detail_Code = #{sddDetailCode,jdbcType=VARCHAR}
  98. <if test="sddId != null">
  99. and SDD_ID != #{sddId,jdbcType=INTEGER}
  100. </if>
  101. </select>
  102. <update id="deleteBySddId">
  103. update sys_dictionary_detail
  104. set SDD_IsDel = -1,
  105. UI_ID = #{uiId,jdbcType=VARCHAR},
  106. SDD_Update_Time = now()
  107. where SDD_ID = #{sddId,jdbcType=INTEGER}
  108. </update>
  109. <select id="selectBySdIdName" resultMap="BaseResultMap">
  110. select <include refid="Base_Column_List"/>
  111. from sys_dictionary_detail
  112. where SDD_IsDel = 0
  113. and SD_ID = #{sdId,jdbcType=INTEGER}
  114. <if test="sddName != null and sddName != ''">
  115. and (
  116. SDD_Detail_Code like concat('%',#{sddName,jdbcType=VARCHAR},'%')
  117. or SDD_Detail_Name like concat('%',#{sddName,jdbcType=VARCHAR},'%'))
  118. </if>
  119. order by SDD_Sort
  120. </select>
  121. <update id="deleteBySddIds">
  122. update sys_dictionary_detail
  123. set SDD_IsDel = -1,
  124. UI_ID = #{uiId,jdbcType=VARCHAR},
  125. SDD_Update_Time = now()
  126. where SDD_ID in
  127. <foreach collection="list" item="item" open="(" close=")" separator=",">
  128. #{item,jdbcType=INTEGER}
  129. </foreach>
  130. </update>
  131. </mapper>