SysDictionaryMapper.xml 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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.ssm.mapper.system.SysDictionaryMapper" >
  4. <resultMap id="BaseResultMap" type="com.ssm.model.system.SysDictionary" >
  5. <id column="DictID" property="dictid" jdbcType="INTEGER" />
  6. <result column="IsActive" property="isactive" jdbcType="BIT" />
  7. <result column="CreatedUserID" property="createduserid" jdbcType="INTEGER" />
  8. <result column="CreatedDatetime" property="createddatetime" jdbcType="TIMESTAMP" />
  9. <result column="LastUpdateUserID" property="lastupdateuserid" jdbcType="INTEGER" />
  10. <result column="LastUpdateDatetime" property="lastupdatedatetime" jdbcType="TIMESTAMP" />
  11. <result column="Subitems" property="subitems" jdbcType="INTEGER" />
  12. <result column="DictValue" property="dictvalue" jdbcType="CLOB" />
  13. <result column="DictName" property="dictname" jdbcType="CLOB" />
  14. <result column="DictNameEN" property="dictnameen" jdbcType="CLOB" />
  15. <result column="DictMemo" property="dictmemo" jdbcType="CLOB" />
  16. <result column="NameSpace" property="namespace" jdbcType="CLOB" />
  17. </resultMap>
  18. <sql id="Base_Column_List" >
  19. DictID, IsActive, CreatedUserID, CreatedDatetime, LastUpdateUserID, LastUpdateDatetime,
  20. Subitems
  21. </sql>
  22. <sql id="Blob_Column_List" >
  23. DictValue, DictName, DictNameEN, DictMemo, NameSpace
  24. </sql>
  25. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  26. select
  27. <include refid="Base_Column_List" />
  28. ,
  29. <include refid="Blob_Column_List" />
  30. from SysDictionary
  31. where DictID = #{dictid,jdbcType=INTEGER}
  32. </select>
  33. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  34. delete from SysDictionary
  35. where DictID = #{dictid,jdbcType=INTEGER}
  36. </delete>
  37. <insert id="insert" parameterType="com.ssm.model.system.SysDictionary" >
  38. insert into SysDictionary (DictID, IsActive, CreatedUserID,
  39. CreatedDatetime, LastUpdateUserID, LastUpdateDatetime,
  40. Subitems, DictValue, DictName,
  41. DictNameEN, DictMemo, NameSpace
  42. )
  43. values (#{dictid,jdbcType=INTEGER}, #{isactive,jdbcType=BIT}, #{createduserid,jdbcType=INTEGER},
  44. #{createddatetime,jdbcType=TIMESTAMP}, #{lastupdateuserid,jdbcType=INTEGER}, #{lastupdatedatetime,jdbcType=TIMESTAMP},
  45. #{subitems,jdbcType=INTEGER}, #{dictvalue,jdbcType=CLOB}, #{dictname,jdbcType=CLOB},
  46. #{dictnameen,jdbcType=CLOB}, #{dictmemo,jdbcType=CLOB}, #{namespace,jdbcType=CLOB}
  47. )
  48. </insert>
  49. <insert id="insertSelective" parameterType="com.ssm.model.system.SysDictionary" >
  50. insert into SysDictionary
  51. <trim prefix="(" suffix=")" suffixOverrides="," >
  52. <if test="dictid != null" >
  53. DictID,
  54. </if>
  55. <if test="isactive != null" >
  56. IsActive,
  57. </if>
  58. <if test="createduserid != null" >
  59. CreatedUserID,
  60. </if>
  61. <if test="createddatetime != null" >
  62. CreatedDatetime,
  63. </if>
  64. <if test="lastupdateuserid != null" >
  65. LastUpdateUserID,
  66. </if>
  67. <if test="lastupdatedatetime != null" >
  68. LastUpdateDatetime,
  69. </if>
  70. <if test="subitems != null" >
  71. Subitems,
  72. </if>
  73. <if test="dictvalue != null" >
  74. DictValue,
  75. </if>
  76. <if test="dictname != null" >
  77. DictName,
  78. </if>
  79. <if test="dictnameen != null" >
  80. DictNameEN,
  81. </if>
  82. <if test="dictmemo != null" >
  83. DictMemo,
  84. </if>
  85. <if test="namespace != null" >
  86. NameSpace,
  87. </if>
  88. </trim>
  89. <trim prefix="values (" suffix=")" suffixOverrides="," >
  90. <if test="dictid != null" >
  91. #{dictid,jdbcType=INTEGER},
  92. </if>
  93. <if test="isactive != null" >
  94. #{isactive,jdbcType=BIT},
  95. </if>
  96. <if test="createduserid != null" >
  97. #{createduserid,jdbcType=INTEGER},
  98. </if>
  99. <if test="createddatetime != null" >
  100. #{createddatetime,jdbcType=TIMESTAMP},
  101. </if>
  102. <if test="lastupdateuserid != null" >
  103. #{lastupdateuserid,jdbcType=INTEGER},
  104. </if>
  105. <if test="lastupdatedatetime != null" >
  106. #{lastupdatedatetime,jdbcType=TIMESTAMP},
  107. </if>
  108. <if test="subitems != null" >
  109. #{subitems,jdbcType=INTEGER},
  110. </if>
  111. <if test="dictvalue != null" >
  112. #{dictvalue,jdbcType=CLOB},
  113. </if>
  114. <if test="dictname != null" >
  115. #{dictname,jdbcType=CLOB},
  116. </if>
  117. <if test="dictnameen != null" >
  118. #{dictnameen,jdbcType=CLOB},
  119. </if>
  120. <if test="dictmemo != null" >
  121. #{dictmemo,jdbcType=CLOB},
  122. </if>
  123. <if test="namespace != null" >
  124. #{namespace,jdbcType=CLOB},
  125. </if>
  126. </trim>
  127. </insert>
  128. <update id="updateByPrimaryKeySelective" parameterType="com.ssm.model.system.SysDictionary" >
  129. update SysDictionary
  130. <set >
  131. <if test="isactive != null" >
  132. IsActive = #{isactive,jdbcType=BIT},
  133. </if>
  134. <if test="createduserid != null" >
  135. CreatedUserID = #{createduserid,jdbcType=INTEGER},
  136. </if>
  137. <if test="createddatetime != null" >
  138. CreatedDatetime = #{createddatetime,jdbcType=TIMESTAMP},
  139. </if>
  140. <if test="lastupdateuserid != null" >
  141. LastUpdateUserID = #{lastupdateuserid,jdbcType=INTEGER},
  142. </if>
  143. <if test="lastupdatedatetime != null" >
  144. LastUpdateDatetime = #{lastupdatedatetime,jdbcType=TIMESTAMP},
  145. </if>
  146. <if test="subitems != null" >
  147. Subitems = #{subitems,jdbcType=INTEGER},
  148. </if>
  149. <if test="dictvalue != null" >
  150. DictValue = #{dictvalue,jdbcType=CLOB},
  151. </if>
  152. <if test="dictname != null" >
  153. DictName = #{dictname,jdbcType=CLOB},
  154. </if>
  155. <if test="dictnameen != null" >
  156. DictNameEN = #{dictnameen,jdbcType=CLOB},
  157. </if>
  158. <if test="dictmemo != null" >
  159. DictMemo = #{dictmemo,jdbcType=CLOB},
  160. </if>
  161. <if test="namespace != null" >
  162. NameSpace = #{namespace,jdbcType=CLOB},
  163. </if>
  164. </set>
  165. where DictID = #{dictid,jdbcType=INTEGER}
  166. </update>
  167. <update id="updateByPrimaryKey" parameterType="com.ssm.model.system.SysDictionary" >
  168. update SysDictionary
  169. set IsActive = #{isactive,jdbcType=BIT},
  170. CreatedUserID = #{createduserid,jdbcType=INTEGER},
  171. CreatedDatetime = #{createddatetime,jdbcType=TIMESTAMP},
  172. LastUpdateUserID = #{lastupdateuserid,jdbcType=INTEGER},
  173. LastUpdateDatetime = #{lastupdatedatetime,jdbcType=TIMESTAMP},
  174. Subitems = #{subitems,jdbcType=INTEGER},
  175. DictValue = #{dictvalue,jdbcType=CLOB},
  176. DictName = #{dictname,jdbcType=CLOB},
  177. DictNameEN = #{dictnameen,jdbcType=CLOB},
  178. DictMemo = #{dictmemo,jdbcType=CLOB},
  179. NameSpace = #{namespace,jdbcType=CLOB}
  180. where DictID = #{dictid,jdbcType=INTEGER}
  181. </update>
  182. <select id="selectByNamespace" resultMap="BaseResultMap" parameterType="java.lang.String" >
  183. SELECT * from SysDictionary s where s.NameSpace=#{namespace}
  184. </select>
  185. <select id="selectByEnabledNamespace" resultMap="BaseResultMap" parameterType="java.lang.String" >
  186. SELECT * from SysDictionary s where s.NameSpace=#{namespace} and s.isactive = 1
  187. </select>
  188. <select id="selectConstCategory" resultMap="BaseResultMap" >
  189. SELECT * from SysDictionary s where s.NameSpace='const_category'
  190. ORDER BY s.DictID
  191. </select>
  192. <select id="selectByCondition" parameterType="com.ssm.model.system.SysDictionary" resultMap="BaseResultMap">
  193. SELECT * from SysDictionary where 1= 1
  194. <if test="namespace != null" >
  195. and NameSpace = #{namespace,jdbcType=CLOB}
  196. </if>
  197. <if test="dictname != null" >
  198. and DictName LIKE CONCAT('%',#{dictname,jdbcType=CLOB},'%')
  199. </if>
  200. <if test="dictvalue != null" >
  201. and DictValue LIKE CONCAT('%',#{dictvalue,jdbcType=CLOB},'%')
  202. </if>
  203. order by dictid asc
  204. </select>
  205. <select id="selectByCondition2" parameterType="com.ssm.model.system.SysDictionary" resultMap="BaseResultMap">
  206. SELECT * from SysDictionary where 1= 1 and NameSpace != 'CONST_CATEGORY'
  207. <if test="namespace != null" >
  208. and NameSpace = #{namespace,jdbcType=CLOB}
  209. </if>
  210. <if test="dictname != null" >
  211. and DictName LIKE CONCAT('%',#{dictname,jdbcType=CLOB},'%')
  212. </if>
  213. order by dictid asc
  214. </select>
  215. <select id="selectByNamespaceAndValue" resultMap="BaseResultMap" parameterType="java.lang.String">
  216. SELECT * from SysDictionary s where s.NameSpace=#{namespace} AND s.DictValue=#{value}
  217. </select>
  218. </mapper>