ThirdPartWeComStaffConfigMapper.xml 12 KB

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