TbUserMapper.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  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.TbUserMapper">
  4. <resultMap id="BaseResultMap" type="com.js.kbt.model.TbUser">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Thu Aug 08 16:22:07 CST 2019.
  9. -->
  10. <id column="id" jdbcType="INTEGER" property="id" />
  11. <result column="account" jdbcType="VARCHAR" property="account" />
  12. <result column="username" jdbcType="VARCHAR" property="username" />
  13. <result column="password" jdbcType="VARCHAR" property="password" />
  14. <result column="mobile" jdbcType="VARCHAR" property="mobile" />
  15. <result column="role_type" jdbcType="INTEGER" property="roleType" />
  16. <result column="company_id" jdbcType="INTEGER" property="companyId" />
  17. <result column="parent_id" jdbcType="INTEGER" property="parentId" />
  18. <result column="sex" jdbcType="INTEGER" property="sex" />
  19. <result column="role_name" jdbcType="VARCHAR" property="roleName" />
  20. <result column="work_state" jdbcType="INTEGER" property="workState" />
  21. <result column="is_disable" jdbcType="INTEGER" property="isDisable" />
  22. <result column="indate" jdbcType="TIMESTAMP" property="indate" />
  23. <result column="head_imgurl" jdbcType="VARCHAR" property="headImgurl" />
  24. <result column="team_name" jdbcType="VARCHAR" property="teamName" />
  25. <result column="subordinate_type" jdbcType="INTEGER" property="subordinateType" />
  26. <result column="openid" jdbcType="VARCHAR" property="openid" />
  27. </resultMap>
  28. <sql id="Example_Where_Clause">
  29. <!--
  30. WARNING - @mbg.generated
  31. This element is automatically generated by MyBatis Generator, do not modify.
  32. This element was generated on Thu Aug 08 16:22:07 CST 2019.
  33. -->
  34. <where>
  35. <foreach collection="oredCriteria" item="criteria" separator="or">
  36. <if test="criteria.valid">
  37. <trim prefix="(" prefixOverrides="and" suffix=")">
  38. <foreach collection="criteria.criteria" item="criterion">
  39. <choose>
  40. <when test="criterion.noValue">
  41. and ${criterion.condition}
  42. </when>
  43. <when test="criterion.singleValue">
  44. and ${criterion.condition} #{criterion.value}
  45. </when>
  46. <when test="criterion.betweenValue">
  47. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  48. </when>
  49. <when test="criterion.listValue">
  50. and ${criterion.condition}
  51. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  52. #{listItem}
  53. </foreach>
  54. </when>
  55. </choose>
  56. </foreach>
  57. </trim>
  58. </if>
  59. </foreach>
  60. </where>
  61. </sql>
  62. <sql id="Update_By_Example_Where_Clause">
  63. <!--
  64. WARNING - @mbg.generated
  65. This element is automatically generated by MyBatis Generator, do not modify.
  66. This element was generated on Thu Aug 08 16:22:07 CST 2019.
  67. -->
  68. <where>
  69. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  70. <if test="criteria.valid">
  71. <trim prefix="(" prefixOverrides="and" suffix=")">
  72. <foreach collection="criteria.criteria" item="criterion">
  73. <choose>
  74. <when test="criterion.noValue">
  75. and ${criterion.condition}
  76. </when>
  77. <when test="criterion.singleValue">
  78. and ${criterion.condition} #{criterion.value}
  79. </when>
  80. <when test="criterion.betweenValue">
  81. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  82. </when>
  83. <when test="criterion.listValue">
  84. and ${criterion.condition}
  85. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  86. #{listItem}
  87. </foreach>
  88. </when>
  89. </choose>
  90. </foreach>
  91. </trim>
  92. </if>
  93. </foreach>
  94. </where>
  95. </sql>
  96. <sql id="Base_Column_List">
  97. <!--
  98. WARNING - @mbg.generated
  99. This element is automatically generated by MyBatis Generator, do not modify.
  100. This element was generated on Thu Aug 08 16:22:07 CST 2019.
  101. -->
  102. id, account, username, password, mobile, role_type, company_id, parent_id, sex, role_name,
  103. work_state, is_disable, indate, head_imgurl, team_name, subordinate_type, openid
  104. </sql>
  105. <select id="selectByExample" parameterType="com.js.kbt.model.TbUserExample" resultMap="BaseResultMap">
  106. <!--
  107. WARNING - @mbg.generated
  108. This element is automatically generated by MyBatis Generator, do not modify.
  109. This element was generated on Thu Aug 08 16:22:07 CST 2019.
  110. -->
  111. select
  112. <if test="distinct">
  113. distinct
  114. </if>
  115. <include refid="Base_Column_List" />
  116. from tb_user
  117. <if test="_parameter != null">
  118. <include refid="Example_Where_Clause" />
  119. </if>
  120. <if test="orderByClause != null">
  121. order by ${orderByClause}
  122. </if>
  123. </select>
  124. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  125. <!--
  126. WARNING - @mbg.generated
  127. This element is automatically generated by MyBatis Generator, do not modify.
  128. This element was generated on Thu Aug 08 16:22:07 CST 2019.
  129. -->
  130. select
  131. <include refid="Base_Column_List" />
  132. from tb_user
  133. where id = #{id,jdbcType=INTEGER}
  134. </select>
  135. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  136. <!--
  137. WARNING - @mbg.generated
  138. This element is automatically generated by MyBatis Generator, do not modify.
  139. This element was generated on Thu Aug 08 16:22:07 CST 2019.
  140. -->
  141. delete from tb_user
  142. where id = #{id,jdbcType=INTEGER}
  143. </delete>
  144. <delete id="deleteByExample" parameterType="com.js.kbt.model.TbUserExample">
  145. <!--
  146. WARNING - @mbg.generated
  147. This element is automatically generated by MyBatis Generator, do not modify.
  148. This element was generated on Thu Aug 08 16:22:07 CST 2019.
  149. -->
  150. delete from tb_user
  151. <if test="_parameter != null">
  152. <include refid="Example_Where_Clause" />
  153. </if>
  154. </delete>
  155. <insert id="insert" parameterType="com.js.kbt.model.TbUser">
  156. <!--
  157. WARNING - @mbg.generated
  158. This element is automatically generated by MyBatis Generator, do not modify.
  159. This element was generated on Thu Aug 08 16:22:07 CST 2019.
  160. -->
  161. <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
  162. SELECT LAST_INSERT_ID()
  163. </selectKey>
  164. insert into tb_user (account, username, password,
  165. mobile, role_type, company_id,
  166. parent_id, sex, role_name,
  167. work_state, is_disable, indate,
  168. head_imgurl, team_name, subordinate_type,
  169. openid)
  170. values (#{account,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
  171. #{mobile,jdbcType=VARCHAR}, #{roleType,jdbcType=INTEGER}, #{companyId,jdbcType=INTEGER},
  172. #{parentId,jdbcType=INTEGER}, #{sex,jdbcType=INTEGER}, #{roleName,jdbcType=VARCHAR},
  173. #{workState,jdbcType=INTEGER}, #{isDisable,jdbcType=INTEGER}, #{indate,jdbcType=TIMESTAMP},
  174. #{headImgurl,jdbcType=VARCHAR}, #{teamName,jdbcType=VARCHAR}, #{subordinateType,jdbcType=INTEGER},
  175. #{openid,jdbcType=VARCHAR})
  176. </insert>
  177. <insert id="insertSelective" parameterType="com.js.kbt.model.TbUser">
  178. <!--
  179. WARNING - @mbg.generated
  180. This element is automatically generated by MyBatis Generator, do not modify.
  181. This element was generated on Thu Aug 08 16:22:07 CST 2019.
  182. -->
  183. <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
  184. SELECT LAST_INSERT_ID()
  185. </selectKey>
  186. insert into tb_user
  187. <trim prefix="(" suffix=")" suffixOverrides=",">
  188. <if test="account != null">
  189. account,
  190. </if>
  191. <if test="username != null">
  192. username,
  193. </if>
  194. <if test="password != null">
  195. password,
  196. </if>
  197. <if test="mobile != null">
  198. mobile,
  199. </if>
  200. <if test="roleType != null">
  201. role_type,
  202. </if>
  203. <if test="companyId != null">
  204. company_id,
  205. </if>
  206. <if test="parentId != null">
  207. parent_id,
  208. </if>
  209. <if test="sex != null">
  210. sex,
  211. </if>
  212. <if test="roleName != null">
  213. role_name,
  214. </if>
  215. <if test="workState != null">
  216. work_state,
  217. </if>
  218. <if test="isDisable != null">
  219. is_disable,
  220. </if>
  221. <if test="indate != null">
  222. indate,
  223. </if>
  224. <if test="headImgurl != null">
  225. head_imgurl,
  226. </if>
  227. <if test="teamName != null">
  228. team_name,
  229. </if>
  230. <if test="subordinateType != null">
  231. subordinate_type,
  232. </if>
  233. <if test="openid != null">
  234. openid,
  235. </if>
  236. </trim>
  237. <trim prefix="values (" suffix=")" suffixOverrides=",">
  238. <if test="account != null">
  239. #{account,jdbcType=VARCHAR},
  240. </if>
  241. <if test="username != null">
  242. #{username,jdbcType=VARCHAR},
  243. </if>
  244. <if test="password != null">
  245. #{password,jdbcType=VARCHAR},
  246. </if>
  247. <if test="mobile != null">
  248. #{mobile,jdbcType=VARCHAR},
  249. </if>
  250. <if test="roleType != null">
  251. #{roleType,jdbcType=INTEGER},
  252. </if>
  253. <if test="companyId != null">
  254. #{companyId,jdbcType=INTEGER},
  255. </if>
  256. <if test="parentId != null">
  257. #{parentId,jdbcType=INTEGER},
  258. </if>
  259. <if test="sex != null">
  260. #{sex,jdbcType=INTEGER},
  261. </if>
  262. <if test="roleName != null">
  263. #{roleName,jdbcType=VARCHAR},
  264. </if>
  265. <if test="workState != null">
  266. #{workState,jdbcType=INTEGER},
  267. </if>
  268. <if test="isDisable != null">
  269. #{isDisable,jdbcType=INTEGER},
  270. </if>
  271. <if test="indate != null">
  272. #{indate,jdbcType=TIMESTAMP},
  273. </if>
  274. <if test="headImgurl != null">
  275. #{headImgurl,jdbcType=VARCHAR},
  276. </if>
  277. <if test="teamName != null">
  278. #{teamName,jdbcType=VARCHAR},
  279. </if>
  280. <if test="subordinateType != null">
  281. #{subordinateType,jdbcType=INTEGER},
  282. </if>
  283. <if test="openid != null">
  284. #{openid,jdbcType=VARCHAR},
  285. </if>
  286. </trim>
  287. </insert>
  288. <select id="countByExample" parameterType="com.js.kbt.model.TbUserExample" resultType="java.lang.Long">
  289. <!--
  290. WARNING - @mbg.generated
  291. This element is automatically generated by MyBatis Generator, do not modify.
  292. This element was generated on Thu Aug 08 16:22:07 CST 2019.
  293. -->
  294. select count(*) from tb_user
  295. <if test="_parameter != null">
  296. <include refid="Example_Where_Clause" />
  297. </if>
  298. </select>
  299. <update id="updateByExampleSelective" parameterType="map">
  300. <!--
  301. WARNING - @mbg.generated
  302. This element is automatically generated by MyBatis Generator, do not modify.
  303. This element was generated on Thu Aug 08 16:22:07 CST 2019.
  304. -->
  305. update tb_user
  306. <set>
  307. <if test="record.id != null">
  308. id = #{record.id,jdbcType=INTEGER},
  309. </if>
  310. <if test="record.account != null">
  311. account = #{record.account,jdbcType=VARCHAR},
  312. </if>
  313. <if test="record.username != null">
  314. username = #{record.username,jdbcType=VARCHAR},
  315. </if>
  316. <if test="record.password != null">
  317. password = #{record.password,jdbcType=VARCHAR},
  318. </if>
  319. <if test="record.mobile != null">
  320. mobile = #{record.mobile,jdbcType=VARCHAR},
  321. </if>
  322. <if test="record.roleType != null">
  323. role_type = #{record.roleType,jdbcType=INTEGER},
  324. </if>
  325. <if test="record.companyId != null">
  326. company_id = #{record.companyId,jdbcType=INTEGER},
  327. </if>
  328. <if test="record.parentId != null">
  329. parent_id = #{record.parentId,jdbcType=INTEGER},
  330. </if>
  331. <if test="record.sex != null">
  332. sex = #{record.sex,jdbcType=INTEGER},
  333. </if>
  334. <if test="record.roleName != null">
  335. role_name = #{record.roleName,jdbcType=VARCHAR},
  336. </if>
  337. <if test="record.workState != null">
  338. work_state = #{record.workState,jdbcType=INTEGER},
  339. </if>
  340. <if test="record.isDisable != null">
  341. is_disable = #{record.isDisable,jdbcType=INTEGER},
  342. </if>
  343. <if test="record.indate != null">
  344. indate = #{record.indate,jdbcType=TIMESTAMP},
  345. </if>
  346. <if test="record.headImgurl != null">
  347. head_imgurl = #{record.headImgurl,jdbcType=VARCHAR},
  348. </if>
  349. <if test="record.teamName != null">
  350. team_name = #{record.teamName,jdbcType=VARCHAR},
  351. </if>
  352. <if test="record.subordinateType != null">
  353. subordinate_type = #{record.subordinateType,jdbcType=INTEGER},
  354. </if>
  355. <if test="record.openid != null">
  356. openid = #{record.openid,jdbcType=VARCHAR},
  357. </if>
  358. </set>
  359. <if test="_parameter != null">
  360. <include refid="Update_By_Example_Where_Clause" />
  361. </if>
  362. </update>
  363. <update id="updateByExample" parameterType="map">
  364. <!--
  365. WARNING - @mbg.generated
  366. This element is automatically generated by MyBatis Generator, do not modify.
  367. This element was generated on Thu Aug 08 16:22:07 CST 2019.
  368. -->
  369. update tb_user
  370. set id = #{record.id,jdbcType=INTEGER},
  371. account = #{record.account,jdbcType=VARCHAR},
  372. username = #{record.username,jdbcType=VARCHAR},
  373. password = #{record.password,jdbcType=VARCHAR},
  374. mobile = #{record.mobile,jdbcType=VARCHAR},
  375. role_type = #{record.roleType,jdbcType=INTEGER},
  376. company_id = #{record.companyId,jdbcType=INTEGER},
  377. parent_id = #{record.parentId,jdbcType=INTEGER},
  378. sex = #{record.sex,jdbcType=INTEGER},
  379. role_name = #{record.roleName,jdbcType=VARCHAR},
  380. work_state = #{record.workState,jdbcType=INTEGER},
  381. is_disable = #{record.isDisable,jdbcType=INTEGER},
  382. indate = #{record.indate,jdbcType=TIMESTAMP},
  383. head_imgurl = #{record.headImgurl,jdbcType=VARCHAR},
  384. team_name = #{record.teamName,jdbcType=VARCHAR},
  385. subordinate_type = #{record.subordinateType,jdbcType=INTEGER},
  386. openid = #{record.openid,jdbcType=VARCHAR}
  387. <if test="_parameter != null">
  388. <include refid="Update_By_Example_Where_Clause" />
  389. </if>
  390. </update>
  391. <update id="updateByPrimaryKeySelective" parameterType="com.js.kbt.model.TbUser">
  392. <!--
  393. WARNING - @mbg.generated
  394. This element is automatically generated by MyBatis Generator, do not modify.
  395. This element was generated on Thu Aug 08 16:22:07 CST 2019.
  396. -->
  397. update tb_user
  398. <set>
  399. <if test="account != null">
  400. account = #{account,jdbcType=VARCHAR},
  401. </if>
  402. <if test="username != null">
  403. username = #{username,jdbcType=VARCHAR},
  404. </if>
  405. <if test="password != null">
  406. password = #{password,jdbcType=VARCHAR},
  407. </if>
  408. <if test="mobile != null">
  409. mobile = #{mobile,jdbcType=VARCHAR},
  410. </if>
  411. <if test="roleType != null">
  412. role_type = #{roleType,jdbcType=INTEGER},
  413. </if>
  414. <if test="companyId != null">
  415. company_id = #{companyId,jdbcType=INTEGER},
  416. </if>
  417. <if test="parentId != null">
  418. parent_id = #{parentId,jdbcType=INTEGER},
  419. </if>
  420. <if test="sex != null">
  421. sex = #{sex,jdbcType=INTEGER},
  422. </if>
  423. <if test="roleName != null">
  424. role_name = #{roleName,jdbcType=VARCHAR},
  425. </if>
  426. <if test="workState != null">
  427. work_state = #{workState,jdbcType=INTEGER},
  428. </if>
  429. <if test="isDisable != null">
  430. is_disable = #{isDisable,jdbcType=INTEGER},
  431. </if>
  432. <if test="indate != null">
  433. indate = #{indate,jdbcType=TIMESTAMP},
  434. </if>
  435. <if test="headImgurl != null">
  436. head_imgurl = #{headImgurl,jdbcType=VARCHAR},
  437. </if>
  438. <if test="teamName != null">
  439. team_name = #{teamName,jdbcType=VARCHAR},
  440. </if>
  441. <if test="subordinateType != null">
  442. subordinate_type = #{subordinateType,jdbcType=INTEGER},
  443. </if>
  444. <if test="openid != null">
  445. openid = #{openid,jdbcType=VARCHAR},
  446. </if>
  447. </set>
  448. where id = #{id,jdbcType=INTEGER}
  449. </update>
  450. <update id="updateByPrimaryKey" parameterType="com.js.kbt.model.TbUser">
  451. <!--
  452. WARNING - @mbg.generated
  453. This element is automatically generated by MyBatis Generator, do not modify.
  454. This element was generated on Thu Aug 08 16:22:07 CST 2019.
  455. -->
  456. update tb_user
  457. set account = #{account,jdbcType=VARCHAR},
  458. username = #{username,jdbcType=VARCHAR},
  459. password = #{password,jdbcType=VARCHAR},
  460. mobile = #{mobile,jdbcType=VARCHAR},
  461. role_type = #{roleType,jdbcType=INTEGER},
  462. company_id = #{companyId,jdbcType=INTEGER},
  463. parent_id = #{parentId,jdbcType=INTEGER},
  464. sex = #{sex,jdbcType=INTEGER},
  465. role_name = #{roleName,jdbcType=VARCHAR},
  466. work_state = #{workState,jdbcType=INTEGER},
  467. is_disable = #{isDisable,jdbcType=INTEGER},
  468. indate = #{indate,jdbcType=TIMESTAMP},
  469. head_imgurl = #{headImgurl,jdbcType=VARCHAR},
  470. team_name = #{teamName,jdbcType=VARCHAR},
  471. subordinate_type = #{subordinateType,jdbcType=INTEGER},
  472. openid = #{openid,jdbcType=VARCHAR}
  473. where id = #{id,jdbcType=INTEGER}
  474. </update>
  475. </mapper>