OrgMapper.xml 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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.OrgMapper" >
  4. <resultMap id="BaseResultMap" type="com.xmnk.springbootbase.entity.Org" >
  5. <!--
  6. WARNING - @mbg.generated
  7. -->
  8. <id column="id" property="id" jdbcType="INTEGER" />
  9. <result column="code" property="code" jdbcType="VARCHAR" />
  10. <result column="name" property="name" jdbcType="VARCHAR" />
  11. <result column="ent_name" property="entName" jdbcType="VARCHAR" />
  12. <result column="company_head" property="companyHead" jdbcType="VARCHAR" />
  13. <result column="open_bank" property="openBank" jdbcType="VARCHAR" />
  14. <result column="account_number" property="accountNumber" jdbcType="VARCHAR" />
  15. <result column="contact_man" property="contactMan" jdbcType="VARCHAR" />
  16. <result column="address" property="address" jdbcType="VARCHAR" />
  17. <result column="mobile_phone" property="mobilePhone" jdbcType="VARCHAR" />
  18. <result column="email" property="email" jdbcType="VARCHAR" />
  19. <result column="status" property="status" jdbcType="TINYINT" />
  20. <result column="sex" property="sex" jdbcType="TINYINT" />
  21. <result column="remark" property="remark" jdbcType="VARCHAR" />
  22. <result column="create_user" property="createUser" jdbcType="VARCHAR" />
  23. <result column="update_user" property="updateUser" jdbcType="VARCHAR" />
  24. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  25. <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
  26. <result column="flag" property="flag" jdbcType="INTEGER" />
  27. <result column="landline" property="landline" jdbcType="VARCHAR" />
  28. <result column="organization_code" property="organizationCode" jdbcType="VARCHAR" />
  29. </resultMap>
  30. <sql id="Example_Where_Clause" >
  31. <!--
  32. WARNING - @mbg.generated
  33. -->
  34. <where >
  35. <foreach collection="oredCriteria" item="criteria" separator="or" >
  36. <if test="criteria.valid" >
  37. <trim prefix="(" suffix=")" prefixOverrides="and" >
  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 collection="criterion.value" item="listItem" open="(" close=")" 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. -->
  66. <where >
  67. <foreach collection="example.oredCriteria" item="criteria" separator="or" >
  68. <if test="criteria.valid" >
  69. <trim prefix="(" suffix=")" prefixOverrides="and" >
  70. <foreach collection="criteria.criteria" item="criterion" >
  71. <choose >
  72. <when test="criterion.noValue" >
  73. and ${criterion.condition}
  74. </when>
  75. <when test="criterion.singleValue" >
  76. and ${criterion.condition} #{criterion.value}
  77. </when>
  78. <when test="criterion.betweenValue" >
  79. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  80. </when>
  81. <when test="criterion.listValue" >
  82. and ${criterion.condition}
  83. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  84. #{listItem}
  85. </foreach>
  86. </when>
  87. </choose>
  88. </foreach>
  89. </trim>
  90. </if>
  91. </foreach>
  92. </where>
  93. </sql>
  94. <sql id="Base_Column_List" >
  95. <!--
  96. WARNING - @mbg.generated
  97. -->
  98. id, code, name, ent_name, company_head, open_bank, account_number, contact_man, address,
  99. mobile_phone, email, status, sex, remark, create_user, update_user, create_time,
  100. update_time, flag, landline, organization_code
  101. </sql>
  102. <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.xmnk.springbootbase.entity.OrgExample" >
  103. <!--
  104. WARNING - @mbg.generated
  105. -->
  106. select
  107. <if test="distinct" >
  108. distinct
  109. </if>
  110. 'true' as QUERYID,
  111. <include refid="Base_Column_List" />
  112. from sys_org
  113. <if test="_parameter != null" >
  114. <include refid="Example_Where_Clause" />
  115. </if>
  116. <if test="orderByClause != null" >
  117. order by ${orderByClause}
  118. </if>
  119. </select>
  120. <delete id="deleteByExample" parameterType="com.xmnk.springbootbase.entity.OrgExample" >
  121. <!--
  122. WARNING - @mbg.generated
  123. -->
  124. delete from sys_org
  125. <if test="_parameter != null" >
  126. <include refid="Example_Where_Clause" />
  127. </if>
  128. </delete>
  129. <select id="countByExample" parameterType="com.xmnk.springbootbase.entity.OrgExample" resultType="java.lang.Integer" >
  130. <!--
  131. WARNING - @mbg.generated
  132. -->
  133. select count(*) from sys_org
  134. <if test="_parameter != null" >
  135. <include refid="Example_Where_Clause" />
  136. </if>
  137. </select>
  138. <update id="updateByExampleSelective" parameterType="map" >
  139. <!--
  140. WARNING - @mbg.generated
  141. -->
  142. update sys_org
  143. <set >
  144. <if test="record.id != null" >
  145. id = #{record.id,jdbcType=INTEGER},
  146. </if>
  147. <if test="record.code != null" >
  148. code = #{record.code,jdbcType=VARCHAR},
  149. </if>
  150. <if test="record.name != null" >
  151. name = #{record.name,jdbcType=VARCHAR},
  152. </if>
  153. <if test="record.entName != null" >
  154. ent_name = #{record.entName,jdbcType=VARCHAR},
  155. </if>
  156. <if test="record.companyHead != null" >
  157. company_head = #{record.companyHead,jdbcType=VARCHAR},
  158. </if>
  159. <if test="record.openBank != null" >
  160. open_bank = #{record.openBank,jdbcType=VARCHAR},
  161. </if>
  162. <if test="record.accountNumber != null" >
  163. account_number = #{record.accountNumber,jdbcType=VARCHAR},
  164. </if>
  165. <if test="record.contactMan != null" >
  166. contact_man = #{record.contactMan,jdbcType=VARCHAR},
  167. </if>
  168. <if test="record.address != null" >
  169. address = #{record.address,jdbcType=VARCHAR},
  170. </if>
  171. <if test="record.mobilePhone != null" >
  172. mobile_phone = #{record.mobilePhone,jdbcType=VARCHAR},
  173. </if>
  174. <if test="record.email != null" >
  175. email = #{record.email,jdbcType=VARCHAR},
  176. </if>
  177. <if test="record.status != null" >
  178. status = #{record.status,jdbcType=TINYINT},
  179. </if>
  180. <if test="record.sex != null" >
  181. sex = #{record.sex,jdbcType=TINYINT},
  182. </if>
  183. <if test="record.remark != null" >
  184. remark = #{record.remark,jdbcType=VARCHAR},
  185. </if>
  186. <if test="record.createUser != null" >
  187. create_user = #{record.createUser,jdbcType=VARCHAR},
  188. </if>
  189. <if test="record.updateUser != null" >
  190. update_user = #{record.updateUser,jdbcType=VARCHAR},
  191. </if>
  192. <if test="record.createTime != null" >
  193. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  194. </if>
  195. <if test="record.updateTime != null" >
  196. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  197. </if>
  198. <if test="record.flag != null" >
  199. flag = #{record.flag,jdbcType=INTEGER},
  200. </if>
  201. <if test="record.landline != null" >
  202. landline = #{record.landline,jdbcType=VARCHAR},
  203. </if>
  204. <if test="record.organizationCode != null" >
  205. organization_code = #{record.organizationCode,jdbcType=VARCHAR},
  206. </if>
  207. </set>
  208. <if test="_parameter != null" >
  209. <include refid="Update_By_Example_Where_Clause" />
  210. </if>
  211. </update>
  212. <update id="updateByExample" parameterType="map" >
  213. <!--
  214. WARNING - @mbg.generated
  215. -->
  216. update sys_org
  217. set id = #{record.id,jdbcType=INTEGER},
  218. code = #{record.code,jdbcType=VARCHAR},
  219. name = #{record.name,jdbcType=VARCHAR},
  220. ent_name = #{record.entName,jdbcType=VARCHAR},
  221. company_head = #{record.companyHead,jdbcType=VARCHAR},
  222. open_bank = #{record.openBank,jdbcType=VARCHAR},
  223. account_number = #{record.accountNumber,jdbcType=VARCHAR},
  224. contact_man = #{record.contactMan,jdbcType=VARCHAR},
  225. address = #{record.address,jdbcType=VARCHAR},
  226. mobile_phone = #{record.mobilePhone,jdbcType=VARCHAR},
  227. email = #{record.email,jdbcType=VARCHAR},
  228. status = #{record.status,jdbcType=TINYINT},
  229. sex = #{record.sex,jdbcType=TINYINT},
  230. remark = #{record.remark,jdbcType=VARCHAR},
  231. create_user = #{record.createUser,jdbcType=VARCHAR},
  232. update_user = #{record.updateUser,jdbcType=VARCHAR},
  233. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  234. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  235. flag = #{record.flag,jdbcType=INTEGER},
  236. landline = #{record.landline,jdbcType=VARCHAR},
  237. organization_code = #{record.organizationCode,jdbcType=VARCHAR}
  238. <if test="_parameter != null" >
  239. <include refid="Update_By_Example_Where_Clause" />
  240. </if>
  241. </update>
  242. </mapper>