SysWorkTimeMapper.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.xunmei.system.mapper.SysWorkTimeMapper">
  6. <resultMap type="com.xunmei.system.domain.SysWorkTime" id="SysWorkTimeResult">
  7. <result property="id" column="id"/>
  8. <result property="createTime" column="create_time"/>
  9. <result property="modifiedId" column="modified_id"/>
  10. <result property="modifiedName" column="modified_name"/>
  11. <result property="updateTime" column="update_time"/>
  12. <result property="closeTime" column="close_time"/>
  13. <result property="isEnable" column="is_enable"/>
  14. <result property="openTime" column="open_time"/>
  15. <result property="noonbreakStart" column="noonbreak_start"/>
  16. <result property="noonbreakEnd" column="noonbreak_end"/>
  17. <result property="orgId" column="org_id"/>
  18. <result property="workOffTime" column="work_off_time"/>
  19. <result property="workTime" column="work_time"/>
  20. <result property="workTimeMonthId" column="work_time_month_id"/>
  21. <result property="ymdDate" column="ymd_date"/>
  22. <result property="ymdDay" column="ymd_day"/>
  23. <result property="ymdMonth" column="ymd_month"/>
  24. <result property="ymdQuarter" column="ymd_quarter"/>
  25. <result property="ymdWeek" column="ymd_week"/>
  26. <result property="ymdYear" column="ymd_year"/>
  27. <result property="ymdHalfyear" column="ymd_halfyear"/>
  28. <result property="isError" column="is_error"/>
  29. <result property="offDutyTime" column="off_duty_time"/>
  30. <result property="onDutyTime" column="on_duty_time"/>
  31. <result property="ymdHour" column="ymd_hour"/>
  32. <result property="ymdMinute" column="ymd_minute"/>
  33. <result property="isManual" column="is_manual"/>
  34. </resultMap>
  35. <sql id="selectSysWorkTimeVo">
  36. select id, create_time, modified_id, modified_name, update_time, close_time, is_enable, open_time, noonbreak_start, noonbreak_end, org_id, work_off_time, work_time, work_time_month_id, ymd_date, ymd_day, ymd_month, ymd_quarter, ymd_week, ymd_year, ymd_halfyear, is_error, off_duty_time, on_duty_time, ymd_hour, ymd_minute, is_manual
  37. from sys_work_time
  38. </sql>
  39. <select id="selectSysWorkTimeList" parameterType="com.xunmei.system.domain.SysWorkTime"
  40. resultMap="SysWorkTimeResult">
  41. <include refid="selectSysWorkTimeVo"/>
  42. <where>
  43. <if test="modifiedId != null ">
  44. and modified_id = #{modifiedId}
  45. </if>
  46. <if test="modifiedName != null and modifiedName != ''">
  47. and modified_name like concat('%', #{modifiedName}, '%')
  48. </if>
  49. <if test="closeTime != null and closeTime != ''">
  50. and close_time = #{closeTime}
  51. </if>
  52. <if test="isEnable != null ">
  53. and is_enable = #{isEnable}
  54. </if>
  55. <if test="openTime != null and openTime != ''">
  56. and open_time = #{openTime}
  57. </if>
  58. <if test="noonbreakStart != null and noonbreakStart != ''">
  59. and noonbreak_start = #{noonbreakStart}
  60. </if>
  61. <if test="noonbreakEnd != null and noonbreakEnd != ''">
  62. and noonbreak_end = #{noonbreakEnd}
  63. </if>
  64. <if test="orgId != null ">
  65. and org_id = #{orgId}
  66. </if>
  67. <if test="workOffTime != null and workOffTime != ''">
  68. and work_off_time = #{workOffTime}
  69. </if>
  70. <if test="workTime != null and workTime != ''">
  71. and work_time = #{workTime}
  72. </if>
  73. <if test="workTimeMonthId != null and workTimeMonthId != ''">
  74. and work_time_month_id = #{workTimeMonthId}
  75. </if>
  76. <if test="ymdDate != null ">
  77. and ymd_date = #{ymdDate}
  78. </if>
  79. <if test="ymdDay != null ">
  80. and ymd_day = #{ymdDay}
  81. </if>
  82. <if test="ymdMonth != null ">
  83. and ymd_month = #{ymdMonth}
  84. </if>
  85. <if test="ymdQuarter != null ">
  86. and ymd_quarter = #{ymdQuarter}
  87. </if>
  88. <if test="ymdWeek != null ">
  89. and ymd_week = #{ymdWeek}
  90. </if>
  91. <if test="ymdYear != null ">
  92. and ymd_year = #{ymdYear}
  93. </if>
  94. <if test="ymdHalfyear != null ">
  95. and ymd_halfyear = #{ymdHalfyear}
  96. </if>
  97. <if test="isError != null ">
  98. and is_error = #{isError}
  99. </if>
  100. <if test="offDutyTime != null ">
  101. and off_duty_time = #{offDutyTime}
  102. </if>
  103. <if test="onDutyTime != null ">
  104. and on_duty_time = #{onDutyTime}
  105. </if>
  106. <if test="ymdHour != null ">
  107. and ymd_hour = #{ymdHour}
  108. </if>
  109. <if test="ymdMinute != null ">
  110. and ymd_minute = #{ymdMinute}
  111. </if>
  112. <if test="isManual != null ">
  113. and is_manual = #{isManual}
  114. </if>
  115. </where>
  116. </select>
  117. <select id="selectSysWorkTimeById" parameterType="String"
  118. resultMap="SysWorkTimeResult">
  119. <include refid="selectSysWorkTimeVo"/>
  120. where id = #{id}
  121. </select>
  122. <select id="selectByPage" resultType="com.xunmei.system.dto.SysWorkTimeDto">
  123. SELECT
  124. t.*,
  125. o.NAME as orgName
  126. FROM
  127. sys_work_time t
  128. LEFT JOIN sys_org o ON t.org_id = o.id
  129. ${ew.customSqlSegment}
  130. </select>
  131. <select id="findByOrgAndMonth" resultType="com.xunmei.system.domain.SysWorkTime">
  132. select *
  133. from sys_work_time
  134. where org_id = #{orgId}
  135. and ymd_date like concat(#{monthStr}, '%')
  136. </select>
  137. <select id="findByYmd" resultType="com.xunmei.system.domain.SysWorkTime">
  138. select * from sys_work_time where org_id in
  139. <foreach item="orgId" collection="list" open="(" separator="," close=")">
  140. #{orgId}
  141. </foreach>
  142. and ymd_date=#{date}
  143. </select>
  144. <insert id="insertSysWorkTime" parameterType="com.xunmei.system.domain.SysWorkTime">
  145. insert into sys_work_time
  146. <trim prefix="(" suffix=")" suffixOverrides=",">
  147. <if test="id != null">id,
  148. </if>
  149. <if test="createTime != null">create_time,
  150. </if>
  151. <if test="modifiedId != null">modified_id,
  152. </if>
  153. <if test="modifiedName != null">modified_name,
  154. </if>
  155. <if test="updateTime != null">update_time,
  156. </if>
  157. <if test="closeTime != null">close_time,
  158. </if>
  159. <if test="isEnable != null">is_enable,
  160. </if>
  161. <if test="openTime != null">open_time,
  162. </if>
  163. <if test="noonbreakStart != null">noonbreak_start,
  164. </if>
  165. <if test="noonbreakEnd != null">noonbreak_end,
  166. </if>
  167. <if test="orgId != null">org_id,
  168. </if>
  169. <if test="workOffTime != null">work_off_time,
  170. </if>
  171. <if test="workTime != null">work_time,
  172. </if>
  173. <if test="workTimeMonthId != null">work_time_month_id,
  174. </if>
  175. <if test="ymdDate != null">ymd_date,
  176. </if>
  177. <if test="ymdDay != null">ymd_day,
  178. </if>
  179. <if test="ymdMonth != null">ymd_month,
  180. </if>
  181. <if test="ymdQuarter != null">ymd_quarter,
  182. </if>
  183. <if test="ymdWeek != null">ymd_week,
  184. </if>
  185. <if test="ymdYear != null">ymd_year,
  186. </if>
  187. <if test="ymdHalfyear != null">ymd_halfyear,
  188. </if>
  189. <if test="isError != null">is_error,
  190. </if>
  191. <if test="offDutyTime != null">off_duty_time,
  192. </if>
  193. <if test="onDutyTime != null">on_duty_time,
  194. </if>
  195. <if test="ymdHour != null">ymd_hour,
  196. </if>
  197. <if test="ymdMinute != null">ymd_minute,
  198. </if>
  199. <if test="isManual != null">is_manual,
  200. </if>
  201. </trim>
  202. <trim prefix="values (" suffix=")" suffixOverrides=",">
  203. <if test="id != null">#{id},
  204. </if>
  205. <if test="createTime != null">#{createTime},
  206. </if>
  207. <if test="modifiedId != null">#{modifiedId},
  208. </if>
  209. <if test="modifiedName != null">#{modifiedName},
  210. </if>
  211. <if test="updateTime != null">#{updateTime},
  212. </if>
  213. <if test="closeTime != null">#{closeTime},
  214. </if>
  215. <if test="isEnable != null">#{isEnable},
  216. </if>
  217. <if test="openTime != null">#{openTime},
  218. </if>
  219. <if test="noonbreakStart != null">#{noonbreakStart},
  220. </if>
  221. <if test="noonbreakEnd != null">#{noonbreakEnd},
  222. </if>
  223. <if test="orgId != null">#{orgId},
  224. </if>
  225. <if test="workOffTime != null">#{workOffTime},
  226. </if>
  227. <if test="workTime != null">#{workTime},
  228. </if>
  229. <if test="workTimeMonthId != null">#{workTimeMonthId},
  230. </if>
  231. <if test="ymdDate != null">#{ymdDate},
  232. </if>
  233. <if test="ymdDay != null">#{ymdDay},
  234. </if>
  235. <if test="ymdMonth != null">#{ymdMonth},
  236. </if>
  237. <if test="ymdQuarter != null">#{ymdQuarter},
  238. </if>
  239. <if test="ymdWeek != null">#{ymdWeek},
  240. </if>
  241. <if test="ymdYear != null">#{ymdYear},
  242. </if>
  243. <if test="ymdHalfyear != null">#{ymdHalfyear},
  244. </if>
  245. <if test="isError != null">#{isError},
  246. </if>
  247. <if test="offDutyTime != null">#{offDutyTime},
  248. </if>
  249. <if test="onDutyTime != null">#{onDutyTime},
  250. </if>
  251. <if test="ymdHour != null">#{ymdHour},
  252. </if>
  253. <if test="ymdMinute != null">#{ymdMinute},
  254. </if>
  255. <if test="isManual != null">#{isManual},
  256. </if>
  257. </trim>
  258. </insert>
  259. <update id="updateSysWorkTime" parameterType="com.xunmei.system.domain.SysWorkTime">
  260. update sys_work_time
  261. <trim prefix="SET" suffixOverrides=",">
  262. <if test="createTime != null">create_time =
  263. #{createTime},
  264. </if>
  265. <if test="modifiedId != null">modified_id =
  266. #{modifiedId},
  267. </if>
  268. <if test="modifiedName != null">modified_name =
  269. #{modifiedName},
  270. </if>
  271. <if test="updateTime != null">update_time =
  272. #{updateTime},
  273. </if>
  274. <if test="closeTime != null">close_time =
  275. #{closeTime},
  276. </if>
  277. <if test="isEnable != null">is_enable =
  278. #{isEnable},
  279. </if>
  280. <if test="openTime != null">open_time =
  281. #{openTime},
  282. </if>
  283. <if test="noonbreakStart != null">noonbreak_start =
  284. #{noonbreakStart},
  285. </if>
  286. <if test="noonbreakEnd != null">noonbreak_end =
  287. #{noonbreakEnd},
  288. </if>
  289. <if test="orgId != null">org_id =
  290. #{orgId},
  291. </if>
  292. <if test="workOffTime != null">work_off_time =
  293. #{workOffTime},
  294. </if>
  295. <if test="workTime != null">work_time =
  296. #{workTime},
  297. </if>
  298. <if test="workTimeMonthId != null">work_time_month_id =
  299. #{workTimeMonthId},
  300. </if>
  301. <if test="ymdDate != null">ymd_date =
  302. #{ymdDate},
  303. </if>
  304. <if test="ymdDay != null">ymd_day =
  305. #{ymdDay},
  306. </if>
  307. <if test="ymdMonth != null">ymd_month =
  308. #{ymdMonth},
  309. </if>
  310. <if test="ymdQuarter != null">ymd_quarter =
  311. #{ymdQuarter},
  312. </if>
  313. <if test="ymdWeek != null">ymd_week =
  314. #{ymdWeek},
  315. </if>
  316. <if test="ymdYear != null">ymd_year =
  317. #{ymdYear},
  318. </if>
  319. <if test="ymdHalfyear != null">ymd_halfyear =
  320. #{ymdHalfyear},
  321. </if>
  322. <if test="isError != null">is_error =
  323. #{isError},
  324. </if>
  325. <if test="offDutyTime != null">off_duty_time =
  326. #{offDutyTime},
  327. </if>
  328. <if test="onDutyTime != null">on_duty_time =
  329. #{onDutyTime},
  330. </if>
  331. <if test="ymdHour != null">ymd_hour =
  332. #{ymdHour},
  333. </if>
  334. <if test="ymdMinute != null">ymd_minute =
  335. #{ymdMinute},
  336. </if>
  337. <if test="isManual != null">is_manual =
  338. #{isManual},
  339. </if>
  340. </trim>
  341. where id = #{id}
  342. </update>
  343. <delete id="deleteSysWorkTimeById" parameterType="String">
  344. delete
  345. from sys_work_time where id = #{id}
  346. </delete>
  347. <delete id="deleteSysWorkTimeByIds" parameterType="String">
  348. delete from sys_work_time where id in
  349. <foreach item="id" collection="array" open="(" separator="," close=")">
  350. #{id}
  351. </foreach>
  352. </delete>
  353. </mapper>