PersonnelWelfareMapper.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  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.goafanti.common.dao.PersonnelWelfareMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.PersonnelWelfare">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Thu May 07 10:06:28 CST 2020.
  9. -->
  10. <id column="id" jdbcType="INTEGER" property="id" />
  11. <result column="pd_id" jdbcType="INTEGER" property="pdId" />
  12. <result column="type" jdbcType="INTEGER" property="type" />
  13. <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
  14. <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
  15. <result column="welfare_remarks" jdbcType="VARCHAR" property="welfareRemarks" />
  16. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  17. <result column="status" jdbcType="INTEGER" property="status" />
  18. <result column="dep_id" jdbcType="VARCHAR" property="depId" />
  19. </resultMap>
  20. <sql id="Example_Where_Clause">
  21. <!--
  22. WARNING - @mbg.generated
  23. This element is automatically generated by MyBatis Generator, do not modify.
  24. This element was generated on Thu May 07 10:06:28 CST 2020.
  25. -->
  26. <where>
  27. <foreach collection="oredCriteria" item="criteria" separator="or">
  28. <if test="criteria.valid">
  29. <trim prefix="(" prefixOverrides="and" suffix=")">
  30. <foreach collection="criteria.criteria" item="criterion">
  31. <choose>
  32. <when test="criterion.noValue">
  33. and ${criterion.condition}
  34. </when>
  35. <when test="criterion.singleValue">
  36. and ${criterion.condition} #{criterion.value}
  37. </when>
  38. <when test="criterion.betweenValue">
  39. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  40. </when>
  41. <when test="criterion.listValue">
  42. and ${criterion.condition}
  43. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  44. #{listItem}
  45. </foreach>
  46. </when>
  47. </choose>
  48. </foreach>
  49. </trim>
  50. </if>
  51. </foreach>
  52. </where>
  53. </sql>
  54. <sql id="Update_By_Example_Where_Clause">
  55. <!--
  56. WARNING - @mbg.generated
  57. This element is automatically generated by MyBatis Generator, do not modify.
  58. This element was generated on Thu May 07 10:06:28 CST 2020.
  59. -->
  60. <where>
  61. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  62. <if test="criteria.valid">
  63. <trim prefix="(" prefixOverrides="and" suffix=")">
  64. <foreach collection="criteria.criteria" item="criterion">
  65. <choose>
  66. <when test="criterion.noValue">
  67. and ${criterion.condition}
  68. </when>
  69. <when test="criterion.singleValue">
  70. and ${criterion.condition} #{criterion.value}
  71. </when>
  72. <when test="criterion.betweenValue">
  73. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  74. </when>
  75. <when test="criterion.listValue">
  76. and ${criterion.condition}
  77. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  78. #{listItem}
  79. </foreach>
  80. </when>
  81. </choose>
  82. </foreach>
  83. </trim>
  84. </if>
  85. </foreach>
  86. </where>
  87. </sql>
  88. <sql id="Base_Column_List">
  89. <!--
  90. WARNING - @mbg.generated
  91. This element is automatically generated by MyBatis Generator, do not modify.
  92. This element was generated on Thu May 07 10:06:28 CST 2020.
  93. -->
  94. id, pd_id, type, start_time, end_time, welfare_remarks, create_time, status, dep_id
  95. </sql>
  96. <select id="selectByExample" parameterType="com.goafanti.common.model.PersonnelWelfareExample" resultMap="BaseResultMap">
  97. <!--
  98. WARNING - @mbg.generated
  99. This element is automatically generated by MyBatis Generator, do not modify.
  100. This element was generated on Thu May 07 10:06:28 CST 2020.
  101. -->
  102. select
  103. <if test="distinct">
  104. distinct
  105. </if>
  106. <include refid="Base_Column_List" />
  107. from personnel_welfare
  108. <if test="_parameter != null">
  109. <include refid="Example_Where_Clause" />
  110. </if>
  111. <if test="orderByClause != null">
  112. order by ${orderByClause}
  113. </if>
  114. </select>
  115. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  116. <!--
  117. WARNING - @mbg.generated
  118. This element is automatically generated by MyBatis Generator, do not modify.
  119. This element was generated on Thu May 07 10:06:28 CST 2020.
  120. -->
  121. select
  122. <include refid="Base_Column_List" />
  123. from personnel_welfare
  124. where id = #{id,jdbcType=INTEGER}
  125. </select>
  126. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  127. <!--
  128. WARNING - @mbg.generated
  129. This element is automatically generated by MyBatis Generator, do not modify.
  130. This element was generated on Thu May 07 10:06:28 CST 2020.
  131. -->
  132. delete from personnel_welfare
  133. where id = #{id,jdbcType=INTEGER}
  134. </delete>
  135. <delete id="deleteByExample" parameterType="com.goafanti.common.model.PersonnelWelfareExample">
  136. <!--
  137. WARNING - @mbg.generated
  138. This element is automatically generated by MyBatis Generator, do not modify.
  139. This element was generated on Thu May 07 10:06:28 CST 2020.
  140. -->
  141. delete from personnel_welfare
  142. <if test="_parameter != null">
  143. <include refid="Example_Where_Clause" />
  144. </if>
  145. </delete>
  146. <insert id="insert" parameterType="com.goafanti.common.model.PersonnelWelfare">
  147. <!--
  148. WARNING - @mbg.generated
  149. This element is automatically generated by MyBatis Generator, do not modify.
  150. This element was generated on Thu May 07 10:06:28 CST 2020.
  151. -->
  152. insert into personnel_welfare (id, pd_id, type,
  153. start_time, end_time, welfare_remarks,
  154. create_time, status, dep_id
  155. )
  156. values (#{id,jdbcType=INTEGER}, #{pdId,jdbcType=INTEGER}, #{type,jdbcType=INTEGER},
  157. #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{welfareRemarks,jdbcType=VARCHAR},
  158. #{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, #{depId,jdbcType=VARCHAR}
  159. )
  160. </insert>
  161. <insert id="insertSelective" parameterType="com.goafanti.common.model.PersonnelWelfare">
  162. <!--
  163. WARNING - @mbg.generated
  164. This element is automatically generated by MyBatis Generator, do not modify.
  165. This element was generated on Thu May 07 10:06:28 CST 2020.
  166. -->
  167. insert into personnel_welfare
  168. <trim prefix="(" suffix=")" suffixOverrides=",">
  169. <if test="id != null">
  170. id,
  171. </if>
  172. <if test="pdId != null">
  173. pd_id,
  174. </if>
  175. <if test="type != null">
  176. type,
  177. </if>
  178. <if test="startTime != null">
  179. start_time,
  180. </if>
  181. <if test="endTime != null">
  182. end_time,
  183. </if>
  184. <if test="welfareRemarks != null">
  185. welfare_remarks,
  186. </if>
  187. <if test="createTime != null">
  188. create_time,
  189. </if>
  190. <if test="status != null">
  191. status,
  192. </if>
  193. <if test="depId != null">
  194. dep_id,
  195. </if>
  196. </trim>
  197. <trim prefix="values (" suffix=")" suffixOverrides=",">
  198. <if test="id != null">
  199. #{id,jdbcType=INTEGER},
  200. </if>
  201. <if test="pdId != null">
  202. #{pdId,jdbcType=INTEGER},
  203. </if>
  204. <if test="type != null">
  205. #{type,jdbcType=INTEGER},
  206. </if>
  207. <if test="startTime != null">
  208. #{startTime,jdbcType=TIMESTAMP},
  209. </if>
  210. <if test="endTime != null">
  211. #{endTime,jdbcType=TIMESTAMP},
  212. </if>
  213. <if test="welfareRemarks != null">
  214. #{welfareRemarks,jdbcType=VARCHAR},
  215. </if>
  216. <if test="createTime != null">
  217. #{createTime,jdbcType=TIMESTAMP},
  218. </if>
  219. <if test="status != null">
  220. #{status,jdbcType=INTEGER},
  221. </if>
  222. <if test="depId != null">
  223. #{depId,jdbcType=VARCHAR},
  224. </if>
  225. </trim>
  226. </insert>
  227. <select id="countByExample" parameterType="com.goafanti.common.model.PersonnelWelfareExample" resultType="java.lang.Long">
  228. <!--
  229. WARNING - @mbg.generated
  230. This element is automatically generated by MyBatis Generator, do not modify.
  231. This element was generated on Thu May 07 10:06:28 CST 2020.
  232. -->
  233. select count(*) from personnel_welfare
  234. <if test="_parameter != null">
  235. <include refid="Example_Where_Clause" />
  236. </if>
  237. </select>
  238. <update id="updateByExampleSelective" parameterType="map">
  239. <!--
  240. WARNING - @mbg.generated
  241. This element is automatically generated by MyBatis Generator, do not modify.
  242. This element was generated on Thu May 07 10:06:28 CST 2020.
  243. -->
  244. update personnel_welfare
  245. <set>
  246. <if test="record.id != null">
  247. id = #{record.id,jdbcType=INTEGER},
  248. </if>
  249. <if test="record.pdId != null">
  250. pd_id = #{record.pdId,jdbcType=INTEGER},
  251. </if>
  252. <if test="record.type != null">
  253. type = #{record.type,jdbcType=INTEGER},
  254. </if>
  255. <if test="record.startTime != null">
  256. start_time = #{record.startTime,jdbcType=TIMESTAMP},
  257. </if>
  258. <if test="record.endTime != null">
  259. end_time = #{record.endTime,jdbcType=TIMESTAMP},
  260. </if>
  261. <if test="record.welfareRemarks != null">
  262. welfare_remarks = #{record.welfareRemarks,jdbcType=VARCHAR},
  263. </if>
  264. <if test="record.createTime != null">
  265. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  266. </if>
  267. <if test="record.status != null">
  268. status = #{record.status,jdbcType=INTEGER},
  269. </if>
  270. <if test="record.depId != null">
  271. dep_id = #{record.depId,jdbcType=VARCHAR},
  272. </if>
  273. </set>
  274. <if test="_parameter != null">
  275. <include refid="Update_By_Example_Where_Clause" />
  276. </if>
  277. </update>
  278. <update id="updateByExample" parameterType="map">
  279. <!--
  280. WARNING - @mbg.generated
  281. This element is automatically generated by MyBatis Generator, do not modify.
  282. This element was generated on Thu May 07 10:06:28 CST 2020.
  283. -->
  284. update personnel_welfare
  285. set id = #{record.id,jdbcType=INTEGER},
  286. pd_id = #{record.pdId,jdbcType=INTEGER},
  287. type = #{record.type,jdbcType=INTEGER},
  288. start_time = #{record.startTime,jdbcType=TIMESTAMP},
  289. end_time = #{record.endTime,jdbcType=TIMESTAMP},
  290. welfare_remarks = #{record.welfareRemarks,jdbcType=VARCHAR},
  291. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  292. status = #{record.status,jdbcType=INTEGER},
  293. dep_id = #{record.depId,jdbcType=VARCHAR}
  294. <if test="_parameter != null">
  295. <include refid="Update_By_Example_Where_Clause" />
  296. </if>
  297. </update>
  298. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PersonnelWelfare">
  299. <!--
  300. WARNING - @mbg.generated
  301. This element is automatically generated by MyBatis Generator, do not modify.
  302. This element was generated on Thu May 07 10:06:28 CST 2020.
  303. -->
  304. update personnel_welfare
  305. <set>
  306. <if test="pdId != null">
  307. pd_id = #{pdId,jdbcType=INTEGER},
  308. </if>
  309. <if test="type != null">
  310. type = #{type,jdbcType=INTEGER},
  311. </if>
  312. <if test="startTime != null">
  313. start_time = #{startTime,jdbcType=TIMESTAMP},
  314. </if>
  315. <if test="endTime != null">
  316. end_time = #{endTime,jdbcType=TIMESTAMP},
  317. </if>
  318. <if test="welfareRemarks != null">
  319. welfare_remarks = #{welfareRemarks,jdbcType=VARCHAR},
  320. </if>
  321. <if test="createTime != null">
  322. create_time = #{createTime,jdbcType=TIMESTAMP},
  323. </if>
  324. <if test="status != null">
  325. status = #{status,jdbcType=INTEGER},
  326. </if>
  327. <if test="depId != null">
  328. dep_id = #{depId,jdbcType=VARCHAR},
  329. </if>
  330. </set>
  331. where id = #{id,jdbcType=INTEGER}
  332. </update>
  333. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.PersonnelWelfare">
  334. <!--
  335. WARNING - @mbg.generated
  336. This element is automatically generated by MyBatis Generator, do not modify.
  337. This element was generated on Thu May 07 10:06:28 CST 2020.
  338. -->
  339. update personnel_welfare
  340. set pd_id = #{pdId,jdbcType=INTEGER},
  341. type = #{type,jdbcType=INTEGER},
  342. start_time = #{startTime,jdbcType=TIMESTAMP},
  343. end_time = #{endTime,jdbcType=TIMESTAMP},
  344. welfare_remarks = #{welfareRemarks,jdbcType=VARCHAR},
  345. create_time = #{createTime,jdbcType=TIMESTAMP},
  346. status = #{status,jdbcType=INTEGER},
  347. dep_id = #{depId,jdbcType=VARCHAR}
  348. where id = #{id,jdbcType=INTEGER}
  349. </update>
  350. <select id="selectBypdId" resultType="com.goafanti.personnel.bo.PersonnelWelfareBo">
  351. select a.id,a.pd_id pdId,a.`type`,date_format(a.start_time,'%Y-%m-%d')startTimes,
  352. date_format(a.end_time,'%Y-%m-%d')endTimes,a.welfare_remarks welfareRemarks,a.create_time createTime,
  353. a.status,a.dep_id depId,b.name depName
  354. from personnel_welfare a left join department b on a.dep_id=b.id where pd_id= #{id}
  355. </select>
  356. </mapper>