StaffMapper.xml 11 KB

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