DeptMapper.xml 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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.xmnk.dao.DeptMapper" >
  4. <resultMap id="BaseResultMap" type="com.xmnk.springbootbase.entity.Dept" >
  5. <!--
  6. WARNING - @mbg.generated
  7. -->
  8. <id column="id" property="id" jdbcType="VARCHAR" />
  9. <result column="org_id" property="orgId" jdbcType="INTEGER" />
  10. <result column="dept_no" property="deptNo" jdbcType="VARCHAR" />
  11. <result column="name" property="name" jdbcType="VARCHAR" />
  12. <result column="pid" property="pid" jdbcType="VARCHAR" />
  13. <result column="status" property="status" jdbcType="TINYINT" />
  14. <result column="relation_code" property="relationCode" jdbcType="VARCHAR" />
  15. <result column="dept_manager_id" property="deptManagerId" jdbcType="VARCHAR" />
  16. <result column="manager_name" property="managerName" jdbcType="VARCHAR" />
  17. <result column="phone" property="phone" jdbcType="VARCHAR" />
  18. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  19. <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
  20. <result column="deleted" property="deleted" jdbcType="TINYINT" />
  21. <result column="email" property="email" jdbcType="VARCHAR" />
  22. </resultMap>
  23. <sql id="Example_Where_Clause" >
  24. <!--
  25. WARNING - @mbg.generated
  26. -->
  27. <where >
  28. <foreach collection="oredCriteria" item="criteria" separator="or" >
  29. <if test="criteria.valid" >
  30. <trim prefix="(" suffix=")" prefixOverrides="and" >
  31. <foreach collection="criteria.criteria" item="criterion" >
  32. <choose >
  33. <when test="criterion.noValue" >
  34. and ${criterion.condition}
  35. </when>
  36. <when test="criterion.singleValue" >
  37. and ${criterion.condition} #{criterion.value}
  38. </when>
  39. <when test="criterion.betweenValue" >
  40. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  41. </when>
  42. <when test="criterion.listValue" >
  43. and ${criterion.condition}
  44. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  45. #{listItem}
  46. </foreach>
  47. </when>
  48. </choose>
  49. </foreach>
  50. </trim>
  51. </if>
  52. </foreach>
  53. </where>
  54. </sql>
  55. <sql id="Update_By_Example_Where_Clause" >
  56. <!--
  57. WARNING - @mbg.generated
  58. -->
  59. <where >
  60. <foreach collection="example.oredCriteria" item="criteria" separator="or" >
  61. <if test="criteria.valid" >
  62. <trim prefix="(" suffix=")" prefixOverrides="and" >
  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 collection="criterion.value" item="listItem" open="(" close=")" 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 - @mbg.generated
  90. -->
  91. id, org_id, dept_no, name, pid, status, relation_code, dept_manager_id, manager_name,
  92. phone, create_time, update_time, deleted, email
  93. </sql>
  94. <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.xmnk.springbootbase.entity.DeptExample" >
  95. <!--
  96. WARNING - @mbg.generated
  97. -->
  98. select
  99. <if test="distinct" >
  100. distinct
  101. </if>
  102. 'true' as QUERYID,
  103. <include refid="Base_Column_List" />
  104. from sys_dept
  105. <if test="_parameter != null" >
  106. <include refid="Example_Where_Clause" />
  107. </if>
  108. <if test="orderByClause != null" >
  109. order by ${orderByClause}
  110. </if>
  111. </select>
  112. <delete id="deleteByExample" parameterType="com.xmnk.springbootbase.entity.DeptExample" >
  113. <!--
  114. WARNING - @mbg.generated
  115. -->
  116. delete from sys_dept
  117. <if test="_parameter != null" >
  118. <include refid="Example_Where_Clause" />
  119. </if>
  120. </delete>
  121. <select id="countByExample" parameterType="com.xmnk.springbootbase.entity.DeptExample" resultType="java.lang.Integer" >
  122. <!--
  123. WARNING - @mbg.generated
  124. -->
  125. select count(*) from sys_dept
  126. <if test="_parameter != null" >
  127. <include refid="Example_Where_Clause" />
  128. </if>
  129. </select>
  130. <update id="updateByExampleSelective" parameterType="map" >
  131. <!--
  132. WARNING - @mbg.generated
  133. -->
  134. update sys_dept
  135. <set >
  136. <if test="record.id != null" >
  137. id = #{record.id,jdbcType=VARCHAR},
  138. </if>
  139. <if test="record.orgId != null" >
  140. org_id = #{record.orgId,jdbcType=INTEGER},
  141. </if>
  142. <if test="record.deptNo != null" >
  143. dept_no = #{record.deptNo,jdbcType=VARCHAR},
  144. </if>
  145. <if test="record.name != null" >
  146. name = #{record.name,jdbcType=VARCHAR},
  147. </if>
  148. <if test="record.pid != null" >
  149. pid = #{record.pid,jdbcType=VARCHAR},
  150. </if>
  151. <if test="record.status != null" >
  152. status = #{record.status,jdbcType=TINYINT},
  153. </if>
  154. <if test="record.relationCode != null" >
  155. relation_code = #{record.relationCode,jdbcType=VARCHAR},
  156. </if>
  157. <if test="record.deptManagerId != null" >
  158. dept_manager_id = #{record.deptManagerId,jdbcType=VARCHAR},
  159. </if>
  160. <if test="record.managerName != null" >
  161. manager_name = #{record.managerName,jdbcType=VARCHAR},
  162. </if>
  163. <if test="record.phone != null" >
  164. phone = #{record.phone,jdbcType=VARCHAR},
  165. </if>
  166. <if test="record.createTime != null" >
  167. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  168. </if>
  169. <if test="record.updateTime != null" >
  170. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  171. </if>
  172. <if test="record.deleted != null" >
  173. deleted = #{record.deleted,jdbcType=TINYINT},
  174. </if>
  175. <if test="record.email != null" >
  176. email = #{record.email,jdbcType=VARCHAR},
  177. </if>
  178. </set>
  179. <if test="_parameter != null" >
  180. <include refid="Update_By_Example_Where_Clause" />
  181. </if>
  182. </update>
  183. <update id="updateByExample" parameterType="map" >
  184. <!--
  185. WARNING - @mbg.generated
  186. -->
  187. update sys_dept
  188. set id = #{record.id,jdbcType=VARCHAR},
  189. org_id = #{record.orgId,jdbcType=INTEGER},
  190. dept_no = #{record.deptNo,jdbcType=VARCHAR},
  191. name = #{record.name,jdbcType=VARCHAR},
  192. pid = #{record.pid,jdbcType=VARCHAR},
  193. status = #{record.status,jdbcType=TINYINT},
  194. relation_code = #{record.relationCode,jdbcType=VARCHAR},
  195. dept_manager_id = #{record.deptManagerId,jdbcType=VARCHAR},
  196. manager_name = #{record.managerName,jdbcType=VARCHAR},
  197. phone = #{record.phone,jdbcType=VARCHAR},
  198. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  199. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  200. deleted = #{record.deleted,jdbcType=TINYINT},
  201. email = #{record.email,jdbcType=VARCHAR}
  202. <if test="_parameter != null" >
  203. <include refid="Update_By_Example_Where_Clause" />
  204. </if>
  205. </update>
  206. </mapper>