DicIOMapper.xml 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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.DicIOMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.sysservice.dao.mysqlmodel.SysDicIO" >
  5. <id column="DIO_ID" property="dioId" jdbcType="INTEGER" />
  6. <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
  7. <result column="DW_WardDm" property="dwWarddm" jdbcType="VARCHAR" />
  8. <result column="DIO_IO_Code" property="dioCode" jdbcType="VARCHAR"/>
  9. <result column="DIO_Type" property="dioType" jdbcType="INTEGER" />
  10. <result column="DIO_IOName" property="dioIoname" jdbcType="VARCHAR" />
  11. <result column="DIO_IsAdvice" property="dioIsadvice" jdbcType="INTEGER" />
  12. <result column="DIO_Operation_Time" property="dioOperationTime" jdbcType="TIMESTAMP" />
  13. <result column="DIO_Operator" property="dioOperator" jdbcType="VARCHAR" />
  14. <result column="DIO_PinyinCode" property="dioPinyinCode" jdbcType="VARCHAR"/>
  15. <result column="DIO_WubiCode" property="dioWubiCode" jdbcType="VARCHAR"/>
  16. <result column="DIO_OtherCode" property="dioOtherCode" jdbcType="VARCHAR"/>
  17. <result column="DIO_IsDel" property="dioIsdel" jdbcType="INTEGER" />
  18. <result column="DIO_Sort" property="dioSort" jdbcType="INTEGER"/>
  19. </resultMap>
  20. <sql id="Base_Column_List" >
  21. DIO_ID, HI_ID, DW_WardDm, DIO_IO_Code,DIO_Type, DIO_IOName, DIO_IsAdvice, DIO_Operation_Time,
  22. DIO_Operator,DIO_PinyinCode,DIO_WubiCode,DIO_OtherCode, DIO_IsDel,DIO_Sort
  23. </sql>
  24. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  25. select
  26. <include refid="Base_Column_List" />
  27. from dic_io
  28. where DIO_ID = #{dioId,jdbcType=INTEGER} order by DIO_Sort desc
  29. </select>
  30. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  31. delete from dic_io
  32. where DIO_ID = #{dioId,jdbcType=INTEGER}
  33. </delete>
  34. <insert id="insert" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysDicIO" >
  35. insert into dic_io (DIO_ID, HI_ID, DW_WardDm, DIO_IO_Code,
  36. DIO_Type, DIO_IOName, DIO_IsAdvice,
  37. DIO_Operation_Time, DIO_Operator,DIO_PinyinCode,DIO_WubiCode,DIO_OtherCode, DIO_IsDel,DIO_Sort
  38. )
  39. values (#{dioId,jdbcType=INTEGER}, #{hiId,jdbcType=INTEGER}, #{dwWarddm,jdbcType=VARCHAR}, #{dioCode,jdbcType=VARCHAR},
  40. #{dioType,jdbcType=INTEGER}, #{dioIoname,jdbcType=VARCHAR}, #{dioIsadvice,jdbcType=INTEGER},
  41. #{dioOperationTime,jdbcType=TIMESTAMP}, #{dioOperator,jdbcType=VARCHAR},#{dioPinyinCode,jdbcType=VARCHAR},
  42. #{dioWubiCode,jdbcType=VARCHAR},#{dioOtherCode,jdbcType=VARCHAR}, #{dioIsdel,jdbcType=INTEGER},#{dioSort,jdbcType=INTEGER}
  43. )
  44. </insert>
  45. <insert id="insertSelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysDicIO" >
  46. insert into dic_io
  47. <trim prefix="(" suffix=")" suffixOverrides="," >
  48. <if test="dioId != null" >
  49. DIO_ID,
  50. </if>
  51. <if test="hiId != null" >
  52. HI_ID,
  53. </if>
  54. <if test="dwWarddm != null" >
  55. DW_WardDm,
  56. </if>
  57. <if test="dioCode != null" >
  58. DIO_IO_Code,
  59. </if>
  60. <if test="dioType != null" >
  61. DIO_Type,
  62. </if>
  63. <if test="dioIoname != null" >
  64. DIO_IOName,
  65. </if>
  66. <if test="dioIsadvice != null" >
  67. DIO_IsAdvice,
  68. </if>
  69. <if test="dioOperationTime != null" >
  70. DIO_Operation_Time,
  71. </if>
  72. <if test="dioOperator != null" >
  73. DIO_Operator,
  74. </if>
  75. <if test="dioPinyinCode != null" >
  76. DIO_PinyinCode,
  77. </if>
  78. <if test="dioWubiCode != null" >
  79. DIO_WubiCode,
  80. </if>
  81. <if test="dioOtherCode != null" >
  82. DIO_OtherCode,
  83. </if>
  84. <if test="dioIsdel != null" >
  85. DIO_IsDel,
  86. </if>
  87. <if test="dioSort != null">,
  88. DIO_Sort
  89. </if>
  90. </trim>
  91. <trim prefix="values (" suffix=")" suffixOverrides="," >
  92. <if test="dioId != null" >
  93. #{dioId,jdbcType=INTEGER},
  94. </if>
  95. <if test="hiId != null" >
  96. #{hiId,jdbcType=INTEGER},
  97. </if>
  98. <if test="dwWarddm != null" >
  99. #{dwWarddm,jdbcType=VARCHAR},
  100. </if>
  101. <if test="dioCode != null" >
  102. #{dioCode,jdbcType=VARCHAR},
  103. </if>
  104. <if test="dioType != null" >
  105. #{dioType,jdbcType=INTEGER},
  106. </if>
  107. <if test="dioIoname != null" >
  108. #{dioIoname,jdbcType=VARCHAR},
  109. </if>
  110. <if test="dioIsadvice != null" >
  111. #{dioIsadvice,jdbcType=INTEGER},
  112. </if>
  113. <if test="dioOperationTime != null" >
  114. #{dioOperationTime,jdbcType=TIMESTAMP},
  115. </if>
  116. <if test="dioOperator != null" >
  117. #{dioOperator,jdbcType=VARCHAR},
  118. </if>
  119. <if test="dioPinyinCode != null" >
  120. #{dioPinyinCode,jdbcType=VARCHAR},
  121. </if>
  122. <if test="dioWubiCode != null" >
  123. #{dioWubiCode,jdbcType=VARCHAR},
  124. </if>
  125. <if test="dioOtherCode != null" >
  126. #{dioOtherCode,jdbcType=VARCHAR},
  127. </if>
  128. <if test="dioIsdel != null" >
  129. #{dioIsdel,jdbcType=INTEGER},
  130. </if>
  131. <if test="dioSort =null">
  132. #{dioSort,jdbcTpye=INTEGER},
  133. </if>
  134. </trim>
  135. </insert>
  136. <insert id="addDicIO" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysDicIO">
  137. insert into dic_io (HI_ID,
  138. DIO_Type,DIO_IO_Code, DIO_IOName, DIO_IsAdvice,
  139. DIO_Operation_Time, DIO_Operator,DIO_PinyinCode,DIO_WubiCode,DIO_OtherCode, DIO_IsDel,DIO_Sort)
  140. values (#{hiId,jdbcType=INTEGER}, #{dioType,jdbcType=INTEGER},#{dioCode,jdbcType=VARCHAR}, #{dioIoname,jdbcType=VARCHAR}, #{dioIsadvice,jdbcType=INTEGER},
  141. now(), #{dioOperator,jdbcType=VARCHAR}, #{dioPinyinCode,jdbcType=VARCHAR},#{dioWubiCode,jdbcType=VARCHAR},#{dioOtherCode,jdbcType=VARCHAR},#{dioIsdel,jdbcType=INTEGER},#{dioSort,jdbcType=INTEGER}
  142. )
  143. </insert>
  144. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysDicIO" >
  145. update dic_io
  146. <set >
  147. <if test="hiId != null" >
  148. HI_ID = #{hiId,jdbcType=INTEGER},
  149. </if>
  150. <if test="dwWarddm != null" >
  151. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  152. </if>
  153. <if test="dioCode != null" >
  154. DIO_IO_Code = #{dioCode,jdbcType=VARCHAR},
  155. </if>
  156. <if test="dioType != null" >
  157. DIO_Type = #{dioType,jdbcType=INTEGER},
  158. </if>
  159. <if test="dioIoname != null" >
  160. DIO_IOName = #{dioIoname,jdbcType=VARCHAR},
  161. </if>
  162. <if test="dioIsadvice != null" >
  163. DIO_IsAdvice = #{dioIsadvice,jdbcType=INTEGER},
  164. </if>
  165. <if test="dioOperationTime != null" >
  166. DIO_Operation_Time = #{dioOperationTime,jdbcType=TIMESTAMP},
  167. </if>
  168. <if test="dioOperator != null" >
  169. DIO_Operator = #{dioOperator,jdbcType=VARCHAR},
  170. </if>
  171. <if test="dioPinyinCode != null" >
  172. DIO_PinyinCode = #{dioPinyinCode,jdbcType=VARCHAR},
  173. </if>
  174. <if test="dioWubiCode != null" >
  175. DIO_WubiCode = #{dioWubiCode,jdbcType=VARCHAR},
  176. </if>
  177. <if test="dioOtherCode != null" >
  178. DIO_OtherCode = #{dioOtherCode,jdbcType=VARCHAR},
  179. </if>
  180. <if test="dioIsdel != null" >
  181. DIO_IsDel = #{dioIsdel,jdbcType=INTEGER},
  182. </if>
  183. <if test="dioSort != null" >
  184. DIO_Sort = #{dioSort,jdbcType=INTEGER},
  185. </if>
  186. </set>
  187. where DIO_ID = #{dioId,jdbcType=INTEGER}
  188. </update>
  189. <update id="delDicIO" parameterType="java.lang.Integer">
  190. update dic_io
  191. set DIO_IsDel = -1
  192. where DIO_ID = #{dioId,jdbcType=INTEGER}
  193. </update>
  194. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysDicIO" >
  195. update dic_io
  196. set HI_ID = #{hiId,jdbcType=INTEGER},
  197. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  198. DIO_IO_Code = #{dioCode,jdbcType=VARCHAR},
  199. DIO_Type = #{dioType,jdbcType=INTEGER},
  200. DIO_IOName = #{dioIoname,jdbcType=VARCHAR},
  201. DIO_IsAdvice = #{dioIsadvice,jdbcType=INTEGER},
  202. DIO_Operation_Time = #{dioOperationTime,jdbcType=TIMESTAMP},
  203. DIO_Operator = #{dioOperator,jdbcType=VARCHAR},
  204. DIO_PinyinCode = #{dioPinyinCode,jdbcType=VARCHAR},
  205. DIO_WubiCode = #{dioWubiCode,jdbcType=VARCHAR},
  206. DIO_OtherCode = #{dioOtherCode,jdbcType=VARCHAR},
  207. DIO_IsDel = #{dioIsdel,jdbcType=INTEGER},
  208. DIO_Sort = #{dioSort,jdbcType=INTEGER}
  209. where DIO_ID = #{dioId,jdbcType=INTEGER}
  210. </update>
  211. <select id="selectSysDicAll" resultMap="BaseResultMap">
  212. select <include refid="Base_Column_List" /> from dic_io where DIO_IsDel = 0 order by DIO_Sort desc
  213. </select>
  214. <select id="getDicIOListByKeyWord" resultMap="BaseResultMap" parameterType="java.lang.String">
  215. select <include refid="Base_Column_List" /> from dic_io where DIO_IOName like concat('%',#{keyWord,jdbcType=VARCHAR},'%')
  216. </select>
  217. <select id="selectBySelective" resultMap="BaseResultMap">
  218. select <include refid="Base_Column_List" />
  219. from dic_io
  220. where DIO_IsDel = 0
  221. <if test="hiId != null" >
  222. AND HI_ID = #{hiId,jdbcType=INTEGER}
  223. </if>
  224. <if test="dioCode != null" >
  225. AND DIO_IO_Code = #{dioCode,jdbcType=VARCHAR}
  226. </if>
  227. </select>
  228. <select id="countCodeExcludeId" resultType="java.lang.Integer">
  229. select count(1)
  230. from dic_io
  231. where DIO_IsDel = 0
  232. AND (HI_ID = #{hiId,jdbcType=INTEGER} or HI_ID = 0)
  233. AND DIO_IO_Code = #{dioCode,jdbcType=VARCHAR}
  234. <if test="dioId != null">
  235. and DIO_ID != #{dioId,jdbcType=INTEGER}
  236. </if>
  237. </select>
  238. </mapper>