SysWorkTimeSetMapper.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  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.SysWorkTimeSetMapper">
  6. <resultMap type="com.xunmei.system.domain.SysWorkTimeSet" id="SysWorkTimeSetResult">
  7. <result property="id" column="id"/>
  8. <result property="orgId" column="org_id"/>
  9. <result property="orgName" column="org_name"/>
  10. <result property="monthEnable" column="month_enable"/>
  11. <result property="monday" column="monday"/>
  12. <result property="tuesday" column="tuesday"/>
  13. <result property="wednesday" column="wednesday"/>
  14. <result property="thursday" column="thursday"/>
  15. <result property="friday" column="friday"/>
  16. <result property="saturday" column="saturday"/>
  17. <result property="sunday" column="sunday"/>
  18. <result property="workTime" column="work_time"/>
  19. <result property="openTime" column="open_time"/>
  20. <result property="noonbreakStart" column="noonbreak_start"/>
  21. <result property="noonbreakEnd" column="noonbreak_end"/>
  22. <result property="closeTime" column="close_time"/>
  23. <result property="workOffTime" column="work_off_time"/>
  24. <result property="createTime" column="create_time"/>
  25. <result property="modifiedId" column="modified_id"/>
  26. <result property="modifiedName" column="modified_name"/>
  27. <result property="updateTime" column="update_time"/>
  28. <result property="year" column="year"/>
  29. <result property="deleted" column="deleted"/>
  30. <result property="effectiveDate" column="effective_date"/>
  31. </resultMap>
  32. <sql id="selectSysWorkTimeSetVo">
  33. select id, org_id, org_name, month_enable, monday, tuesday, wednesday, thursday, friday, saturday, sunday, work_time, open_time, noonbreak_start, noonbreak_end, close_time, work_off_time, create_time, modified_id, modified_name, update_time, year, deleted, effective_date
  34. from sys_work_time_set
  35. </sql>
  36. <select id="selectSysWorkTimeSetList" parameterType="com.xunmei.system.domain.SysWorkTimeSet"
  37. resultMap="SysWorkTimeSetResult">
  38. <include refid="selectSysWorkTimeSetVo"/>
  39. <where>
  40. <if test="orgId != null ">
  41. and org_id = #{orgId}
  42. </if>
  43. <if test="orgName != null and orgName != ''">
  44. and org_name like concat('%', #{orgName}, '%')
  45. </if>
  46. <if test="monthEnable != null ">
  47. and month_enable = #{monthEnable}
  48. </if>
  49. <if test="monday != null ">
  50. and monday = #{monday}
  51. </if>
  52. <if test="tuesday != null ">
  53. and tuesday = #{tuesday}
  54. </if>
  55. <if test="wednesday != null ">
  56. and wednesday = #{wednesday}
  57. </if>
  58. <if test="thursday != null ">
  59. and thursday = #{thursday}
  60. </if>
  61. <if test="friday != null ">
  62. and friday = #{friday}
  63. </if>
  64. <if test="saturday != null ">
  65. and saturday = #{saturday}
  66. </if>
  67. <if test="sunday != null ">
  68. and sunday = #{sunday}
  69. </if>
  70. <if test="workTime != null and workTime != ''">
  71. and work_time = #{workTime}
  72. </if>
  73. <if test="openTime != null and openTime != ''">
  74. and open_time = #{openTime}
  75. </if>
  76. <if test="noonbreakStart != null and noonbreakStart != ''">
  77. and noonbreak_start = #{noonbreakStart}
  78. </if>
  79. <if test="noonbreakEnd != null and noonbreakEnd != ''">
  80. and noonbreak_end = #{noonbreakEnd}
  81. </if>
  82. <if test="closeTime != null and closeTime != ''">
  83. and close_time = #{closeTime}
  84. </if>
  85. <if test="workOffTime != null and workOffTime != ''">
  86. and work_off_time = #{workOffTime}
  87. </if>
  88. <if test="modifiedId != null ">
  89. and modified_id = #{modifiedId}
  90. </if>
  91. <if test="modifiedName != null and modifiedName != ''">
  92. and modified_name like concat('%', #{modifiedName}, '%')
  93. </if>
  94. <if test="year != null ">
  95. and year = #{year}
  96. </if>
  97. <if test="deleted != null ">
  98. and deleted = #{deleted}
  99. </if>
  100. <if test="effectiveDate != null ">
  101. and effective_date = #{effectiveDate}
  102. </if>
  103. </where>
  104. </select>
  105. <select id="selectSysWorkTimeSetById" parameterType="Long"
  106. resultMap="SysWorkTimeSetResult">
  107. <include refid="selectSysWorkTimeSetVo"/>
  108. where id = #{id}
  109. </select>
  110. <select id="selectSysWorkTimeSetByOrgId" parameterType="Long"
  111. resultMap="SysWorkTimeSetResult">
  112. <include refid="selectSysWorkTimeSetVo"/>
  113. where org_id = #{orgId}
  114. </select>
  115. <select id="selectByPage" resultType="com.xunmei.system.domain.SysWorkTimeSet">
  116. select * from sys_work_time_set
  117. </select>
  118. <select id="findWorkTimeForOrgIdsAndErrectiveDate" resultType="com.xunmei.system.domain.SysWorkTimeSet">
  119. select s.* from sys_work_time_set s where s.org_id in
  120. <foreach item="orgId" collection="orgIds" open="(" separator="," close=")">
  121. #{orgId}
  122. </foreach>
  123. and s.effective_date = #{effectiveDate} and s.deleted = false
  124. </select>
  125. <select id="checkData" resultType="java.lang.Integer">
  126. select count(*) from sys_work_time a
  127. where a.is_manual=1
  128. <if test="request.orgIds!=null and request.orgIds.size()>0">
  129. and a.org_id in
  130. <foreach collection="request.orgIds" item="orgId" open="(" close=")" separator=",">
  131. #{orgId}
  132. </foreach>
  133. </if>
  134. <if test="request.effectiveDate!=null">
  135. and ymd_date &gt;= #{request.effectiveDate}
  136. </if>
  137. </select>
  138. <select id="selectWorkTimeSetList" resultType="com.xunmei.system.domain.SysWorkTimeSet">
  139. select a.*,b.name as orgName from sys_work_time_set a left join sys_org b on a.org_id=b.id where a.deleted=0 and
  140. a.org_id in
  141. <foreach collection="request.orgIds" item="orgId" open="(" close=")" separator=",">
  142. #{orgId}
  143. </foreach>
  144. </select>
  145. <select id="selectWorkTimeSetPage" resultType="com.xunmei.system.domain.SysWorkTimeSet">
  146. SELECT
  147. t.*
  148. FROM
  149. sys_work_time_set t
  150. LEFT JOIN sys_org o ON t.org_id = o.id
  151. ${ew.customSqlSegment}
  152. </select>
  153. <insert id="insertSysWorkTimeSet" parameterType="com.xunmei.system.domain.SysWorkTimeSet" useGeneratedKeys="true" keyProperty="id">
  154. insert into sys_work_time_set
  155. <trim prefix="(" suffix=")" suffixOverrides=",">
  156. <if test="orgId != null">org_id,
  157. </if>
  158. <if test="orgName != null">org_name,
  159. </if>
  160. <if test="monthEnable != null">month_enable,
  161. </if>
  162. <if test="monday != null">monday,
  163. </if>
  164. <if test="tuesday != null">tuesday,
  165. </if>
  166. <if test="wednesday != null">wednesday,
  167. </if>
  168. <if test="thursday != null">thursday,
  169. </if>
  170. <if test="friday != null">friday,
  171. </if>
  172. <if test="saturday != null">saturday,
  173. </if>
  174. <if test="sunday != null">sunday,
  175. </if>
  176. <if test="workTime != null">work_time,
  177. </if>
  178. <if test="openTime != null">open_time,
  179. </if>
  180. <if test="noonbreakStart != null">noonbreak_start,
  181. </if>
  182. <if test="noonbreakEnd != null">noonbreak_end,
  183. </if>
  184. <if test="closeTime != null">close_time,
  185. </if>
  186. <if test="workOffTime != null">work_off_time,
  187. </if>
  188. <if test="createTime != null">create_time,
  189. </if>
  190. <if test="modifiedId != null">modified_id,
  191. </if>
  192. <if test="modifiedName != null">modified_name,
  193. </if>
  194. <if test="updateTime != null">update_time,
  195. </if>
  196. <if test="year != null">year,
  197. </if>
  198. <if test="deleted != null">deleted,
  199. </if>
  200. <if test="effectiveDate != null">effective_date,
  201. </if>
  202. </trim>
  203. <trim prefix="values (" suffix=")" suffixOverrides=",">
  204. <if test="orgId != null">#{orgId},
  205. </if>
  206. <if test="orgName != null">#{orgName},
  207. </if>
  208. <if test="monthEnable != null">#{monthEnable},
  209. </if>
  210. <if test="monday != null">#{monday},
  211. </if>
  212. <if test="tuesday != null">#{tuesday},
  213. </if>
  214. <if test="wednesday != null">#{wednesday},
  215. </if>
  216. <if test="thursday != null">#{thursday},
  217. </if>
  218. <if test="friday != null">#{friday},
  219. </if>
  220. <if test="saturday != null">#{saturday},
  221. </if>
  222. <if test="sunday != null">#{sunday},
  223. </if>
  224. <if test="workTime != null">#{workTime},
  225. </if>
  226. <if test="openTime != null">#{openTime},
  227. </if>
  228. <if test="noonbreakStart != null">#{noonbreakStart},
  229. </if>
  230. <if test="noonbreakEnd != null">#{noonbreakEnd},
  231. </if>
  232. <if test="closeTime != null">#{closeTime},
  233. </if>
  234. <if test="workOffTime != null">#{workOffTime},
  235. </if>
  236. <if test="createTime != null">#{createTime},
  237. </if>
  238. <if test="modifiedId != null">#{modifiedId},
  239. </if>
  240. <if test="modifiedName != null">#{modifiedName},
  241. </if>
  242. <if test="updateTime != null">#{updateTime},
  243. </if>
  244. <if test="year != null">#{year},
  245. </if>
  246. <if test="deleted != null">#{deleted},
  247. </if>
  248. <if test="effectiveDate != null">#{effectiveDate},
  249. </if>
  250. </trim>
  251. </insert>
  252. <update id="updateSysWorkTimeSet" parameterType="com.xunmei.system.domain.SysWorkTimeSet">
  253. update sys_work_time_set
  254. <trim prefix="SET" suffixOverrides=",">
  255. <if test="orgId != null">org_id =
  256. #{orgId},
  257. </if>
  258. <if test="orgName != null">org_name =
  259. #{orgName},
  260. </if>
  261. <if test="monthEnable != null">month_enable =
  262. #{monthEnable},
  263. </if>
  264. <if test="monday != null">monday =
  265. #{monday},
  266. </if>
  267. <if test="tuesday != null">tuesday =
  268. #{tuesday},
  269. </if>
  270. <if test="wednesday != null">wednesday =
  271. #{wednesday},
  272. </if>
  273. <if test="thursday != null">thursday =
  274. #{thursday},
  275. </if>
  276. <if test="friday != null">friday =
  277. #{friday},
  278. </if>
  279. <if test="saturday != null">saturday =
  280. #{saturday},
  281. </if>
  282. <if test="sunday != null">sunday =
  283. #{sunday},
  284. </if>
  285. <if test="workTime != null">work_time =
  286. #{workTime},
  287. </if>
  288. <if test="openTime != null">open_time =
  289. #{openTime},
  290. </if>
  291. <if test="noonbreakStart != null">noonbreak_start =
  292. #{noonbreakStart},
  293. </if>
  294. <if test="noonbreakEnd != null">noonbreak_end =
  295. #{noonbreakEnd},
  296. </if>
  297. <if test="closeTime != null">close_time =
  298. #{closeTime},
  299. </if>
  300. <if test="workOffTime != null">work_off_time =
  301. #{workOffTime},
  302. </if>
  303. <if test="createTime != null">create_time =
  304. #{createTime},
  305. </if>
  306. <if test="modifiedId != null">modified_id =
  307. #{modifiedId},
  308. </if>
  309. <if test="modifiedName != null">modified_name =
  310. #{modifiedName},
  311. </if>
  312. <if test="updateTime != null">update_time =
  313. #{updateTime},
  314. </if>
  315. <if test="year != null">year =
  316. #{year},
  317. </if>
  318. <if test="deleted != null">deleted =
  319. #{deleted},
  320. </if>
  321. <if test="effectiveDate != null">effective_date =
  322. #{effectiveDate},
  323. </if>
  324. </trim>
  325. where id = #{id}
  326. </update>
  327. <delete id="deleteSysWorkTimeSetById" parameterType="Long">
  328. delete
  329. from sys_work_time_set where id = #{id}
  330. </delete>
  331. <delete id="deleteSysWorkTimeSetByIds" parameterType="String">
  332. delete from sys_work_time_set where id in
  333. <foreach item="id" collection="array" open="(" separator="," close=")">
  334. #{id}
  335. </foreach>
  336. </delete>
  337. </mapper>