ThirdPartWeComStaffMapper.xml 12 KB

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