DicPartPositionMapper.xml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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.DicPartPositionMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.sysservice.dao.mysqlmodel.DicPartPosition" >
  5. <id column="DPL_ID" property="dplId" jdbcType="INTEGER" />
  6. <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
  7. <result column="DPL_Part_Code" property="dplPartCode" jdbcType="VARCHAR" />
  8. <result column="DPL_Position_Code" property="dplPositionCode" jdbcType="VARCHAR" />
  9. <result column="DPL_IsDel" property="dplIsdel" jdbcType="INTEGER" />
  10. <result column="DPL_UserId" property="dplUserid" jdbcType="VARCHAR" />
  11. <result column="DPL_UpdateTime" property="dplUpdatetime" jdbcType="TIMESTAMP" />
  12. </resultMap>
  13. <resultMap id="HashMap" type="com.xinxin.topro.sysservice.vo.DicPartPositionVO" extends="BaseResultMap">
  14. <collection property="list" ofType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysDictionaryDetail">
  15. <id column="SDD_ID" property="sddId" jdbcType="INTEGER" />
  16. <result column="SD_ID" property="sdId" jdbcType="INTEGER" />
  17. <result column="SDD_Detail_Code" property="sddDetailCode" jdbcType="VARCHAR" />
  18. <result column="SDD_Detail_Name" property="sddDetailName" jdbcType="VARCHAR" />
  19. <result column="SDD_PinyinCode" property="sddPinyincode" jdbcType="VARCHAR" />
  20. <result column="SDD_WubiCode" property="sddWubicode" jdbcType="VARCHAR" />
  21. <result column="SDD_OtherCode" property="sddOthercode" jdbcType="VARCHAR" />
  22. <result column="SDD_Sort" property="sddSort" jdbcType="INTEGER" />
  23. <result column="UI_ID" property="uiId" jdbcType="VARCHAR" />
  24. <result column="SDD_Update_Time" property="sddUpdateTime" jdbcType="TIMESTAMP" />
  25. <result column="SDD_IsDel" property="sddIsdel" jdbcType="INTEGER" />
  26. </collection>
  27. </resultMap>
  28. <sql id="Base_Column_List" >
  29. DPL_ID, HI_ID, DPL_Part_Code, DPL_Position_Code, DPL_IsDel, DPL_UserId, DPL_UpdateTime
  30. </sql>
  31. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  32. select
  33. <include refid="Base_Column_List" />
  34. from dic_part_position
  35. where DPL_ID = #{dplId,jdbcType=INTEGER}
  36. </select>
  37. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  38. delete from dic_part_position
  39. where DPL_ID = #{dplId,jdbcType=INTEGER}
  40. </delete>
  41. <insert id="insert" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicPartPosition" >
  42. insert into dic_part_position (DPL_ID, HI_ID, DPL_Part_Code,
  43. DPL_Position_Code, DPL_IsDel, DPL_UserId,
  44. DPL_UpdateTime)
  45. values (#{dplId,jdbcType=INTEGER}, #{hiId,jdbcType=INTEGER}, #{dplPartCode,jdbcType=VARCHAR},
  46. #{dplPositionCode,jdbcType=VARCHAR}, #{dplIsdel,jdbcType=INTEGER}, #{dplUserid,jdbcType=VARCHAR},
  47. now())
  48. </insert>
  49. <insert id="insertSelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicPartPosition" >
  50. insert into dic_part_position
  51. <trim prefix="(" suffix=")" suffixOverrides="," >
  52. <if test="dplId != null" >
  53. DPL_ID,
  54. </if>
  55. <if test="hiId != null" >
  56. HI_ID,
  57. </if>
  58. <if test="dplPartCode != null" >
  59. DPL_Part_Code,
  60. </if>
  61. <if test="dplPositionCode != null" >
  62. DPL_Position_Code,
  63. </if>
  64. <if test="dplIsdel != null" >
  65. DPL_IsDel,
  66. </if>
  67. <if test="dplUserid != null" >
  68. DPL_UserId,
  69. </if>
  70. <if test="dplUpdatetime != null" >
  71. DPL_UpdateTime,
  72. </if>
  73. </trim>
  74. <trim prefix="values (" suffix=")" suffixOverrides="," >
  75. <if test="dplId != null" >
  76. #{dplId,jdbcType=INTEGER},
  77. </if>
  78. <if test="hiId != null" >
  79. #{hiId,jdbcType=INTEGER},
  80. </if>
  81. <if test="dplPartCode != null" >
  82. #{dplPartCode,jdbcType=VARCHAR},
  83. </if>
  84. <if test="dplPositionCode != null" >
  85. #{dplPositionCode,jdbcType=VARCHAR},
  86. </if>
  87. <if test="dplIsdel != null" >
  88. #{dplIsdel,jdbcType=INTEGER},
  89. </if>
  90. <if test="dplUserid != null" >
  91. #{dplUserid,jdbcType=VARCHAR},
  92. </if>
  93. <if test="dplUpdatetime != null" >
  94. #{dplUpdatetime,jdbcType=TIMESTAMP},
  95. </if>
  96. </trim>
  97. </insert>
  98. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicPartPosition" >
  99. update dic_part_position
  100. <set >
  101. <if test="hiId != null" >
  102. HI_ID = #{hiId,jdbcType=INTEGER},
  103. </if>
  104. <if test="dplPartCode != null" >
  105. DPL_Part_Code = #{dplPartCode,jdbcType=VARCHAR},
  106. </if>
  107. <if test="dplPositionCode != null" >
  108. DPL_Position_Code = #{dplPositionCode,jdbcType=VARCHAR},
  109. </if>
  110. <if test="dplIsdel != null" >
  111. DPL_IsDel = #{dplIsdel,jdbcType=INTEGER},
  112. </if>
  113. <if test="dplUserid != null" >
  114. DPL_UserId = #{dplUserid,jdbcType=VARCHAR},
  115. </if>
  116. DPL_UpdateTime = now(),
  117. </set>
  118. where DPL_ID = #{dplId,jdbcType=INTEGER}
  119. </update>
  120. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicPartPosition" >
  121. update dic_part_position
  122. set
  123. DPL_Part_Code = #{dplPartCode,jdbcType=VARCHAR},
  124. DPL_Position_Code = #{dplPositionCode,jdbcType=VARCHAR},
  125. DPL_UserId = #{dplUserid,jdbcType=VARCHAR},
  126. DPL_UpdateTime = now()
  127. where DPL_ID = #{dplId,jdbcType=INTEGER}
  128. </update>
  129. <select id="selectPosition" resultMap="HashMap">
  130. SELECT
  131. sdd.SDD_Detail_Name,
  132. sdd.SDD_ID,
  133. dpp.DPL_ID,
  134. sdd.SDD_Detail_Code,
  135. dpp.DPL_Part_Code
  136. FROM
  137. dic_part_position dpp,
  138. sys_dictionary_detail sdd
  139. WHERE
  140. sdd.SDD_Detail_Code = dpp.DPL_Position_Code
  141. and sdd.SD_ID = (select SD_ID from sys_dictionary where SD_DicDM = 'position')
  142. AND dpp.DPL_Part_Code = #{dplPartCode,jdbcType=VARCHAR}
  143. and sdd.SDD_IsDel = 0
  144. and dpp.DPL_IsDel = 0
  145. and (dpp.HI_ID = #{hiId,jdbcType=INTEGER} or dpp.HI_ID = 0)
  146. <if test="sddDetailName != null and sddDetailName != '' ">
  147. and (SDD_Detail_Name like concat('%',#{sddDetailName,jdbcType=VARCHAR},'%')
  148. or SDD_Detail_Code like concat('%',#{sddDetailName,jdbcType=VARCHAR},'%')
  149. or SDD_PinyinCode like concat('%',#{sddDetailName,jdbcType=VARCHAR},'%')
  150. or SDD_WubiCode like concat('%',#{sddDetailName,jdbcType=VARCHAR},'%'))
  151. </if>
  152. </select>
  153. <select id="selectByCode" resultType="java.lang.Integer" >
  154. select
  155. COUNT(1)
  156. from dic_part_position
  157. where DPL_Part_Code = #{dplPartCode,jdbcType=VARCHAR}
  158. and DPL_Position_Code = #{dplPositionCode,jdbcType=VARCHAR}
  159. and DPL_IsDel = 0
  160. and (HI_ID = #{hiId,jdbcType=INTEGER} or HI_ID = 0)
  161. </select>
  162. <update id="updateDel" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicPartPosition" >
  163. update dic_part_position
  164. set
  165. DPL_IsDel = #{dplIsdel,jdbcType=INTEGER},
  166. DPL_UserId = #{dplUserid,jdbcType=VARCHAR},
  167. DPL_UpdateTime = now()
  168. where DPL_ID = #{dplId,jdbcType=INTEGER}
  169. </update>
  170. </mapper>