SysDeptMapper.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  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.platform.yijia.dao.SysDeptMapper">
  4. <resultMap id="BaseResultMap" type="com.platform.yijia.pojo.SysDept">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. -->
  9. <id column="dept_id" jdbcType="BIGINT" property="deptId" />
  10. <result column="parent_id" jdbcType="BIGINT" property="parentId" />
  11. <result column="ancestors" jdbcType="VARCHAR" property="ancestors" />
  12. <result column="dept_name" jdbcType="VARCHAR" property="deptName" />
  13. <result column="order_num" jdbcType="INTEGER" property="orderNum" />
  14. <result column="leader" jdbcType="VARCHAR" property="leader" />
  15. <result column="phone" jdbcType="VARCHAR" property="phone" />
  16. <result column="email" jdbcType="VARCHAR" property="email" />
  17. <result column="status" jdbcType="CHAR" property="status" />
  18. <result column="del_flag" jdbcType="CHAR" property="delFlag" />
  19. <result column="create_by" jdbcType="VARCHAR" property="createBy" />
  20. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  21. <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
  22. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  23. </resultMap>
  24. <sql id="Example_Where_Clause">
  25. <!--
  26. WARNING - @mbg.generated
  27. This element is automatically generated by MyBatis Generator, do not modify.
  28. -->
  29. <where>
  30. <foreach collection="oredCriteria" item="criteria" separator="or">
  31. <if test="criteria.valid">
  32. <trim prefix="(" prefixOverrides="and" suffix=")">
  33. <foreach collection="criteria.criteria" item="criterion">
  34. <choose>
  35. <when test="criterion.noValue">
  36. and ${criterion.condition}
  37. </when>
  38. <when test="criterion.singleValue">
  39. and ${criterion.condition} #{criterion.value}
  40. </when>
  41. <when test="criterion.betweenValue">
  42. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  43. </when>
  44. <when test="criterion.listValue">
  45. and ${criterion.condition}
  46. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  47. #{listItem}
  48. </foreach>
  49. </when>
  50. </choose>
  51. </foreach>
  52. </trim>
  53. </if>
  54. </foreach>
  55. </where>
  56. </sql>
  57. <sql id="Update_By_Example_Where_Clause">
  58. <!--
  59. WARNING - @mbg.generated
  60. This element is automatically generated by MyBatis Generator, do not modify.
  61. -->
  62. <where>
  63. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  64. <if test="criteria.valid">
  65. <trim prefix="(" prefixOverrides="and" suffix=")">
  66. <foreach collection="criteria.criteria" item="criterion">
  67. <choose>
  68. <when test="criterion.noValue">
  69. and ${criterion.condition}
  70. </when>
  71. <when test="criterion.singleValue">
  72. and ${criterion.condition} #{criterion.value}
  73. </when>
  74. <when test="criterion.betweenValue">
  75. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  76. </when>
  77. <when test="criterion.listValue">
  78. and ${criterion.condition}
  79. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  80. #{listItem}
  81. </foreach>
  82. </when>
  83. </choose>
  84. </foreach>
  85. </trim>
  86. </if>
  87. </foreach>
  88. </where>
  89. </sql>
  90. <sql id="Base_Column_List">
  91. <!--
  92. WARNING - @mbg.generated
  93. This element is automatically generated by MyBatis Generator, do not modify.
  94. -->
  95. dept_id, parent_id, ancestors, dept_name, order_num, leader, phone, email, status,
  96. del_flag, create_by, create_time, update_by, update_time
  97. </sql>
  98. <select id="selectByExample" parameterType="com.platform.yijia.pojo.SysDeptExample" resultMap="BaseResultMap">
  99. <!--
  100. WARNING - @mbg.generated
  101. This element is automatically generated by MyBatis Generator, do not modify.
  102. -->
  103. select
  104. <if test="distinct">
  105. distinct
  106. </if>
  107. <include refid="Base_Column_List" />
  108. from sys_dept
  109. <if test="_parameter != null">
  110. <include refid="Example_Where_Clause" />
  111. </if>
  112. <if test="orderByClause != null">
  113. order by ${orderByClause}
  114. </if>
  115. </select>
  116. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  117. <!--
  118. WARNING - @mbg.generated
  119. This element is automatically generated by MyBatis Generator, do not modify.
  120. -->
  121. select
  122. <include refid="Base_Column_List" />
  123. from sys_dept
  124. where dept_id = #{deptId,jdbcType=BIGINT}
  125. </select>
  126. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  127. <!--
  128. WARNING - @mbg.generated
  129. This element is automatically generated by MyBatis Generator, do not modify.
  130. -->
  131. delete from sys_dept
  132. where dept_id = #{deptId,jdbcType=BIGINT}
  133. </delete>
  134. <delete id="deleteByExample" parameterType="com.platform.yijia.pojo.SysDeptExample">
  135. <!--
  136. WARNING - @mbg.generated
  137. This element is automatically generated by MyBatis Generator, do not modify.
  138. -->
  139. delete from sys_dept
  140. <if test="_parameter != null">
  141. <include refid="Example_Where_Clause" />
  142. </if>
  143. </delete>
  144. <insert id="insert" parameterType="com.platform.yijia.pojo.SysDept">
  145. <!--
  146. WARNING - @mbg.generated
  147. This element is automatically generated by MyBatis Generator, do not modify.
  148. -->
  149. insert into sys_dept (dept_id, parent_id, ancestors,
  150. dept_name, order_num, leader,
  151. phone, email, status,
  152. del_flag, create_by, create_time,
  153. update_by, update_time)
  154. values (#{deptId,jdbcType=BIGINT}, #{parentId,jdbcType=BIGINT}, #{ancestors,jdbcType=VARCHAR},
  155. #{deptName,jdbcType=VARCHAR}, #{orderNum,jdbcType=INTEGER}, #{leader,jdbcType=VARCHAR},
  156. #{phone,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{status,jdbcType=CHAR},
  157. #{delFlag,jdbcType=CHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
  158. #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP})
  159. </insert>
  160. <insert id="insertSelective" parameterType="com.platform.yijia.pojo.SysDept">
  161. <!--
  162. WARNING - @mbg.generated
  163. This element is automatically generated by MyBatis Generator, do not modify.
  164. -->
  165. insert into sys_dept
  166. <trim prefix="(" suffix=")" suffixOverrides=",">
  167. <if test="deptId != null">
  168. dept_id,
  169. </if>
  170. <if test="parentId != null">
  171. parent_id,
  172. </if>
  173. <if test="ancestors != null">
  174. ancestors,
  175. </if>
  176. <if test="deptName != null">
  177. dept_name,
  178. </if>
  179. <if test="orderNum != null">
  180. order_num,
  181. </if>
  182. <if test="leader != null">
  183. leader,
  184. </if>
  185. <if test="phone != null">
  186. phone,
  187. </if>
  188. <if test="email != null">
  189. email,
  190. </if>
  191. <if test="status != null">
  192. status,
  193. </if>
  194. <if test="delFlag != null">
  195. del_flag,
  196. </if>
  197. <if test="createBy != null">
  198. create_by,
  199. </if>
  200. <if test="createTime != null">
  201. create_time,
  202. </if>
  203. <if test="updateBy != null">
  204. update_by,
  205. </if>
  206. <if test="updateTime != null">
  207. update_time,
  208. </if>
  209. </trim>
  210. <trim prefix="values (" suffix=")" suffixOverrides=",">
  211. <if test="deptId != null">
  212. #{deptId,jdbcType=BIGINT},
  213. </if>
  214. <if test="parentId != null">
  215. #{parentId,jdbcType=BIGINT},
  216. </if>
  217. <if test="ancestors != null">
  218. #{ancestors,jdbcType=VARCHAR},
  219. </if>
  220. <if test="deptName != null">
  221. #{deptName,jdbcType=VARCHAR},
  222. </if>
  223. <if test="orderNum != null">
  224. #{orderNum,jdbcType=INTEGER},
  225. </if>
  226. <if test="leader != null">
  227. #{leader,jdbcType=VARCHAR},
  228. </if>
  229. <if test="phone != null">
  230. #{phone,jdbcType=VARCHAR},
  231. </if>
  232. <if test="email != null">
  233. #{email,jdbcType=VARCHAR},
  234. </if>
  235. <if test="status != null">
  236. #{status,jdbcType=CHAR},
  237. </if>
  238. <if test="delFlag != null">
  239. #{delFlag,jdbcType=CHAR},
  240. </if>
  241. <if test="createBy != null">
  242. #{createBy,jdbcType=VARCHAR},
  243. </if>
  244. <if test="createTime != null">
  245. #{createTime,jdbcType=TIMESTAMP},
  246. </if>
  247. <if test="updateBy != null">
  248. #{updateBy,jdbcType=VARCHAR},
  249. </if>
  250. <if test="updateTime != null">
  251. #{updateTime,jdbcType=TIMESTAMP},
  252. </if>
  253. </trim>
  254. </insert>
  255. <select id="countByExample" parameterType="com.platform.yijia.pojo.SysDeptExample" resultType="java.lang.Long">
  256. <!--
  257. WARNING - @mbg.generated
  258. This element is automatically generated by MyBatis Generator, do not modify.
  259. -->
  260. select count(*) from sys_dept
  261. <if test="_parameter != null">
  262. <include refid="Example_Where_Clause" />
  263. </if>
  264. </select>
  265. <update id="updateByExampleSelective" parameterType="map">
  266. <!--
  267. WARNING - @mbg.generated
  268. This element is automatically generated by MyBatis Generator, do not modify.
  269. -->
  270. update sys_dept
  271. <set>
  272. <if test="record.deptId != null">
  273. dept_id = #{record.deptId,jdbcType=BIGINT},
  274. </if>
  275. <if test="record.parentId != null">
  276. parent_id = #{record.parentId,jdbcType=BIGINT},
  277. </if>
  278. <if test="record.ancestors != null">
  279. ancestors = #{record.ancestors,jdbcType=VARCHAR},
  280. </if>
  281. <if test="record.deptName != null">
  282. dept_name = #{record.deptName,jdbcType=VARCHAR},
  283. </if>
  284. <if test="record.orderNum != null">
  285. order_num = #{record.orderNum,jdbcType=INTEGER},
  286. </if>
  287. <if test="record.leader != null">
  288. leader = #{record.leader,jdbcType=VARCHAR},
  289. </if>
  290. <if test="record.phone != null">
  291. phone = #{record.phone,jdbcType=VARCHAR},
  292. </if>
  293. <if test="record.email != null">
  294. email = #{record.email,jdbcType=VARCHAR},
  295. </if>
  296. <if test="record.status != null">
  297. status = #{record.status,jdbcType=CHAR},
  298. </if>
  299. <if test="record.delFlag != null">
  300. del_flag = #{record.delFlag,jdbcType=CHAR},
  301. </if>
  302. <if test="record.createBy != null">
  303. create_by = #{record.createBy,jdbcType=VARCHAR},
  304. </if>
  305. <if test="record.createTime != null">
  306. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  307. </if>
  308. <if test="record.updateBy != null">
  309. update_by = #{record.updateBy,jdbcType=VARCHAR},
  310. </if>
  311. <if test="record.updateTime != null">
  312. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  313. </if>
  314. </set>
  315. <if test="_parameter != null">
  316. <include refid="Update_By_Example_Where_Clause" />
  317. </if>
  318. </update>
  319. <update id="updateByExample" parameterType="map">
  320. <!--
  321. WARNING - @mbg.generated
  322. This element is automatically generated by MyBatis Generator, do not modify.
  323. -->
  324. update sys_dept
  325. set dept_id = #{record.deptId,jdbcType=BIGINT},
  326. parent_id = #{record.parentId,jdbcType=BIGINT},
  327. ancestors = #{record.ancestors,jdbcType=VARCHAR},
  328. dept_name = #{record.deptName,jdbcType=VARCHAR},
  329. order_num = #{record.orderNum,jdbcType=INTEGER},
  330. leader = #{record.leader,jdbcType=VARCHAR},
  331. phone = #{record.phone,jdbcType=VARCHAR},
  332. email = #{record.email,jdbcType=VARCHAR},
  333. status = #{record.status,jdbcType=CHAR},
  334. del_flag = #{record.delFlag,jdbcType=CHAR},
  335. create_by = #{record.createBy,jdbcType=VARCHAR},
  336. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  337. update_by = #{record.updateBy,jdbcType=VARCHAR},
  338. update_time = #{record.updateTime,jdbcType=TIMESTAMP}
  339. <if test="_parameter != null">
  340. <include refid="Update_By_Example_Where_Clause" />
  341. </if>
  342. </update>
  343. <update id="updateByPrimaryKeySelective" parameterType="com.platform.yijia.pojo.SysDept">
  344. <!--
  345. WARNING - @mbg.generated
  346. This element is automatically generated by MyBatis Generator, do not modify.
  347. -->
  348. update sys_dept
  349. <set>
  350. <if test="parentId != null">
  351. parent_id = #{parentId,jdbcType=BIGINT},
  352. </if>
  353. <if test="ancestors != null">
  354. ancestors = #{ancestors,jdbcType=VARCHAR},
  355. </if>
  356. <if test="deptName != null">
  357. dept_name = #{deptName,jdbcType=VARCHAR},
  358. </if>
  359. <if test="orderNum != null">
  360. order_num = #{orderNum,jdbcType=INTEGER},
  361. </if>
  362. <if test="leader != null">
  363. leader = #{leader,jdbcType=VARCHAR},
  364. </if>
  365. <if test="phone != null">
  366. phone = #{phone,jdbcType=VARCHAR},
  367. </if>
  368. <if test="email != null">
  369. email = #{email,jdbcType=VARCHAR},
  370. </if>
  371. <if test="status != null">
  372. status = #{status,jdbcType=CHAR},
  373. </if>
  374. <if test="delFlag != null">
  375. del_flag = #{delFlag,jdbcType=CHAR},
  376. </if>
  377. <if test="createBy != null">
  378. create_by = #{createBy,jdbcType=VARCHAR},
  379. </if>
  380. <if test="createTime != null">
  381. create_time = #{createTime,jdbcType=TIMESTAMP},
  382. </if>
  383. <if test="updateBy != null">
  384. update_by = #{updateBy,jdbcType=VARCHAR},
  385. </if>
  386. <if test="updateTime != null">
  387. update_time = #{updateTime,jdbcType=TIMESTAMP},
  388. </if>
  389. </set>
  390. where dept_id = #{deptId,jdbcType=BIGINT}
  391. </update>
  392. <update id="updateByPrimaryKey" parameterType="com.platform.yijia.pojo.SysDept">
  393. <!--
  394. WARNING - @mbg.generated
  395. This element is automatically generated by MyBatis Generator, do not modify.
  396. -->
  397. update sys_dept
  398. set parent_id = #{parentId,jdbcType=BIGINT},
  399. ancestors = #{ancestors,jdbcType=VARCHAR},
  400. dept_name = #{deptName,jdbcType=VARCHAR},
  401. order_num = #{orderNum,jdbcType=INTEGER},
  402. leader = #{leader,jdbcType=VARCHAR},
  403. phone = #{phone,jdbcType=VARCHAR},
  404. email = #{email,jdbcType=VARCHAR},
  405. status = #{status,jdbcType=CHAR},
  406. del_flag = #{delFlag,jdbcType=CHAR},
  407. create_by = #{createBy,jdbcType=VARCHAR},
  408. create_time = #{createTime,jdbcType=TIMESTAMP},
  409. update_by = #{updateBy,jdbcType=VARCHAR},
  410. update_time = #{updateTime,jdbcType=TIMESTAMP}
  411. where dept_id = #{deptId,jdbcType=BIGINT}
  412. </update>
  413. </mapper>