SysUserMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  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.js.kbt.mapper.SysUserMapper">
  4. <resultMap id="BaseResultMap" type="com.js.kbt.model.SysUser">
  5. <!--
  6. WARNING - @mbggenerated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Tue Jul 04 16:24:58 CST 2017.
  9. -->
  10. <id column="id" jdbcType="BIGINT" property="id" />
  11. <result column="mobile" jdbcType="VARCHAR" property="mobile" />
  12. <result column="pwd" jdbcType="VARCHAR" property="pwd" />
  13. <result column="name" jdbcType="VARCHAR" property="name" />
  14. <result column="role" jdbcType="VARCHAR" property="role" />
  15. <result column="indate" jdbcType="TIMESTAMP" property="indate" />
  16. <result column="is_leave" jdbcType="INTEGER" property="isLeave" />
  17. <result column="district_id" jdbcType="INTEGER" property="districtId" />
  18. </resultMap>
  19. <sql id="Example_Where_Clause">
  20. <!--
  21. WARNING - @mbggenerated
  22. This element is automatically generated by MyBatis Generator, do not modify.
  23. This element was generated on Tue Jul 04 16:24:58 CST 2017.
  24. -->
  25. <where>
  26. <foreach collection="oredCriteria" item="criteria" separator="or">
  27. <if test="criteria.valid">
  28. <trim prefix="(" prefixOverrides="and" suffix=")">
  29. <foreach collection="criteria.criteria" item="criterion">
  30. <choose>
  31. <when test="criterion.noValue">
  32. and ${criterion.condition}
  33. </when>
  34. <when test="criterion.singleValue">
  35. and ${criterion.condition} #{criterion.value}
  36. </when>
  37. <when test="criterion.betweenValue">
  38. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  39. </when>
  40. <when test="criterion.listValue">
  41. and ${criterion.condition}
  42. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  43. #{listItem}
  44. </foreach>
  45. </when>
  46. </choose>
  47. </foreach>
  48. </trim>
  49. </if>
  50. </foreach>
  51. </where>
  52. </sql>
  53. <sql id="Update_By_Example_Where_Clause">
  54. <!--
  55. WARNING - @mbggenerated
  56. This element is automatically generated by MyBatis Generator, do not modify.
  57. This element was generated on Tue Jul 04 16:24:58 CST 2017.
  58. -->
  59. <where>
  60. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  61. <if test="criteria.valid">
  62. <trim prefix="(" prefixOverrides="and" suffix=")">
  63. <foreach collection="criteria.criteria" item="criterion">
  64. <choose>
  65. <when test="criterion.noValue">
  66. and ${criterion.condition}
  67. </when>
  68. <when test="criterion.singleValue">
  69. and ${criterion.condition} #{criterion.value}
  70. </when>
  71. <when test="criterion.betweenValue">
  72. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  73. </when>
  74. <when test="criterion.listValue">
  75. and ${criterion.condition}
  76. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  77. #{listItem}
  78. </foreach>
  79. </when>
  80. </choose>
  81. </foreach>
  82. </trim>
  83. </if>
  84. </foreach>
  85. </where>
  86. </sql>
  87. <sql id="Base_Column_List">
  88. <!--
  89. WARNING - @mbggenerated
  90. This element is automatically generated by MyBatis Generator, do not modify.
  91. This element was generated on Tue Jul 04 16:24:58 CST 2017.
  92. -->
  93. id, mobile, pwd, name, role, indate, is_leave, district_id
  94. </sql>
  95. <select id="selectByExample" parameterType="com.js.kbt.model.SysUserExample" resultMap="BaseResultMap">
  96. <!--
  97. WARNING - @mbggenerated
  98. This element is automatically generated by MyBatis Generator, do not modify.
  99. This element was generated on Tue Jul 04 16:24:58 CST 2017.
  100. -->
  101. select
  102. <if test="distinct">
  103. distinct
  104. </if>
  105. <include refid="Base_Column_List" />
  106. from sys_user
  107. <if test="_parameter != null">
  108. <include refid="Example_Where_Clause" />
  109. </if>
  110. <if test="orderByClause != null">
  111. order by ${orderByClause}
  112. </if>
  113. </select>
  114. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  115. <!--
  116. WARNING - @mbggenerated
  117. This element is automatically generated by MyBatis Generator, do not modify.
  118. This element was generated on Tue Jul 04 16:24:58 CST 2017.
  119. -->
  120. select
  121. <include refid="Base_Column_List" />
  122. from sys_user
  123. where id = #{id,jdbcType=BIGINT}
  124. </select>
  125. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  126. <!--
  127. WARNING - @mbggenerated
  128. This element is automatically generated by MyBatis Generator, do not modify.
  129. This element was generated on Tue Jul 04 16:24:58 CST 2017.
  130. -->
  131. delete from sys_user
  132. where id = #{id,jdbcType=BIGINT}
  133. </delete>
  134. <delete id="deleteByExample" parameterType="com.js.kbt.model.SysUserExample">
  135. <!--
  136. WARNING - @mbggenerated
  137. This element is automatically generated by MyBatis Generator, do not modify.
  138. This element was generated on Tue Jul 04 16:24:58 CST 2017.
  139. -->
  140. delete from sys_user
  141. <if test="_parameter != null">
  142. <include refid="Example_Where_Clause" />
  143. </if>
  144. </delete>
  145. <insert id="insert" parameterType="com.js.kbt.model.SysUser">
  146. <!--
  147. WARNING - @mbggenerated
  148. This element is automatically generated by MyBatis Generator, do not modify.
  149. This element was generated on Tue Jul 04 16:24:58 CST 2017.
  150. -->
  151. <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
  152. SELECT LAST_INSERT_ID()
  153. </selectKey>
  154. insert into sys_user (mobile, pwd, name,
  155. role, indate, is_leave,
  156. district_id)
  157. values (#{mobile,jdbcType=VARCHAR}, #{pwd,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
  158. #{role,jdbcType=VARCHAR}, #{indate,jdbcType=TIMESTAMP}, #{isLeave,jdbcType=INTEGER},
  159. #{districtId,jdbcType=INTEGER})
  160. </insert>
  161. <insert id="insertSelective" parameterType="com.js.kbt.model.SysUser">
  162. <!--
  163. WARNING - @mbggenerated
  164. This element is automatically generated by MyBatis Generator, do not modify.
  165. This element was generated on Tue Jul 04 16:24:58 CST 2017.
  166. -->
  167. <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
  168. SELECT LAST_INSERT_ID()
  169. </selectKey>
  170. insert into sys_user
  171. <trim prefix="(" suffix=")" suffixOverrides=",">
  172. <if test="mobile != null">
  173. mobile,
  174. </if>
  175. <if test="pwd != null">
  176. pwd,
  177. </if>
  178. <if test="name != null">
  179. name,
  180. </if>
  181. <if test="role != null">
  182. role,
  183. </if>
  184. <if test="indate != null">
  185. indate,
  186. </if>
  187. <if test="isLeave != null">
  188. is_leave,
  189. </if>
  190. <if test="districtId != null">
  191. district_id,
  192. </if>
  193. </trim>
  194. <trim prefix="values (" suffix=")" suffixOverrides=",">
  195. <if test="mobile != null">
  196. #{mobile,jdbcType=VARCHAR},
  197. </if>
  198. <if test="pwd != null">
  199. #{pwd,jdbcType=VARCHAR},
  200. </if>
  201. <if test="name != null">
  202. #{name,jdbcType=VARCHAR},
  203. </if>
  204. <if test="role != null">
  205. #{role,jdbcType=VARCHAR},
  206. </if>
  207. <if test="indate != null">
  208. #{indate,jdbcType=TIMESTAMP},
  209. </if>
  210. <if test="isLeave != null">
  211. #{isLeave,jdbcType=INTEGER},
  212. </if>
  213. <if test="districtId != null">
  214. #{districtId,jdbcType=INTEGER},
  215. </if>
  216. </trim>
  217. </insert>
  218. <select id="countByExample" parameterType="com.js.kbt.model.SysUserExample" resultType="java.lang.Integer">
  219. <!--
  220. WARNING - @mbggenerated
  221. This element is automatically generated by MyBatis Generator, do not modify.
  222. This element was generated on Tue Jul 04 16:24:58 CST 2017.
  223. -->
  224. select count(*) from sys_user
  225. <if test="_parameter != null">
  226. <include refid="Example_Where_Clause" />
  227. </if>
  228. </select>
  229. <update id="updateByExampleSelective" parameterType="map">
  230. <!--
  231. WARNING - @mbggenerated
  232. This element is automatically generated by MyBatis Generator, do not modify.
  233. This element was generated on Tue Jul 04 16:24:58 CST 2017.
  234. -->
  235. update sys_user
  236. <set>
  237. <if test="record.id != null">
  238. id = #{record.id,jdbcType=BIGINT},
  239. </if>
  240. <if test="record.mobile != null">
  241. mobile = #{record.mobile,jdbcType=VARCHAR},
  242. </if>
  243. <if test="record.pwd != null">
  244. pwd = #{record.pwd,jdbcType=VARCHAR},
  245. </if>
  246. <if test="record.name != null">
  247. name = #{record.name,jdbcType=VARCHAR},
  248. </if>
  249. <if test="record.role != null">
  250. role = #{record.role,jdbcType=VARCHAR},
  251. </if>
  252. <if test="record.indate != null">
  253. indate = #{record.indate,jdbcType=TIMESTAMP},
  254. </if>
  255. <if test="record.isLeave != null">
  256. is_leave = #{record.isLeave,jdbcType=INTEGER},
  257. </if>
  258. <if test="record.districtId != null">
  259. district_id = #{record.districtId,jdbcType=INTEGER},
  260. </if>
  261. </set>
  262. <if test="_parameter != null">
  263. <include refid="Update_By_Example_Where_Clause" />
  264. </if>
  265. </update>
  266. <update id="updateByExample" parameterType="map">
  267. <!--
  268. WARNING - @mbggenerated
  269. This element is automatically generated by MyBatis Generator, do not modify.
  270. This element was generated on Tue Jul 04 16:24:58 CST 2017.
  271. -->
  272. update sys_user
  273. set id = #{record.id,jdbcType=BIGINT},
  274. mobile = #{record.mobile,jdbcType=VARCHAR},
  275. pwd = #{record.pwd,jdbcType=VARCHAR},
  276. name = #{record.name,jdbcType=VARCHAR},
  277. role = #{record.role,jdbcType=VARCHAR},
  278. indate = #{record.indate,jdbcType=TIMESTAMP},
  279. is_leave = #{record.isLeave,jdbcType=INTEGER},
  280. district_id = #{record.districtId,jdbcType=INTEGER}
  281. <if test="_parameter != null">
  282. <include refid="Update_By_Example_Where_Clause" />
  283. </if>
  284. </update>
  285. <update id="updateByPrimaryKeySelective" parameterType="com.js.kbt.model.SysUser">
  286. <!--
  287. WARNING - @mbggenerated
  288. This element is automatically generated by MyBatis Generator, do not modify.
  289. This element was generated on Tue Jul 04 16:24:58 CST 2017.
  290. -->
  291. update sys_user
  292. <set>
  293. <if test="mobile != null">
  294. mobile = #{mobile,jdbcType=VARCHAR},
  295. </if>
  296. <if test="pwd != null">
  297. pwd = #{pwd,jdbcType=VARCHAR},
  298. </if>
  299. <if test="name != null">
  300. name = #{name,jdbcType=VARCHAR},
  301. </if>
  302. <if test="role != null">
  303. role = #{role,jdbcType=VARCHAR},
  304. </if>
  305. <if test="indate != null">
  306. indate = #{indate,jdbcType=TIMESTAMP},
  307. </if>
  308. <if test="isLeave != null">
  309. is_leave = #{isLeave,jdbcType=INTEGER},
  310. </if>
  311. <if test="districtId != null">
  312. district_id = #{districtId,jdbcType=INTEGER},
  313. </if>
  314. </set>
  315. where id = #{id,jdbcType=BIGINT}
  316. </update>
  317. <update id="updateByPrimaryKey" parameterType="com.js.kbt.model.SysUser">
  318. <!--
  319. WARNING - @mbggenerated
  320. This element is automatically generated by MyBatis Generator, do not modify.
  321. This element was generated on Tue Jul 04 16:24:58 CST 2017.
  322. -->
  323. update sys_user
  324. set mobile = #{mobile,jdbcType=VARCHAR},
  325. pwd = #{pwd,jdbcType=VARCHAR},
  326. name = #{name,jdbcType=VARCHAR},
  327. role = #{role,jdbcType=VARCHAR},
  328. indate = #{indate,jdbcType=TIMESTAMP},
  329. is_leave = #{isLeave,jdbcType=INTEGER},
  330. district_id = #{districtId,jdbcType=INTEGER}
  331. where id = #{id,jdbcType=BIGINT}
  332. </update>
  333. </mapper>