O
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
3.5 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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.xujie.sys.modules.scheduling.mapper.SchedulingMapper">
  4. <insert id="insertClassesData">
  5. insert into tpm_classes(code,description,site,bu_no)
  6. values (#{code}, #{description}, #{site}, #{buNo})
  7. </insert>
  8. <insert id="saveSchedulingHeader" parameterType="com.xujie.sys.modules.scheduling.entity.SchedulingData" useGeneratedKeys="true" keyProperty="id">
  9. insert into tpm_scheduling(site, bu_no,date,classes_code)
  10. values (#{site},#{buNo},#{date},#{classesCode})
  11. </insert>
  12. <insert id="saveSchedulingRecord">
  13. insert into tpm_scheduling_record(admin_id,admin_name,head_id,isHoliday)
  14. values (#{adminId}, #{adminName}, #{headId},#{isHoliday})
  15. </insert>
  16. <update id="updateClassesData">
  17. update tpm_classes set description = #{description}
  18. where code = #{code} and site = #{site} and bu_no = #{buNo}
  19. </update>
  20. <update id="editSaveSchedulingRecord">
  21. update tpm_scheduling_record set isHoliday = #{isHoliday}
  22. where id = #{id}
  23. </update>
  24. <delete id="delScheduling">
  25. delete from tpm_classes
  26. where code = #{code} and site = #{site} and bu_no = #{buNo}
  27. </delete>
  28. <delete id="deleteSchedulingRecord">
  29. delete from tpm_scheduling_record
  30. where id = #{id}
  31. </delete>
  32. <select id="getSchedulingDataList" resultType="com.xujie.sys.modules.scheduling.entity.ClassesData">
  33. select * from tpm_classes
  34. <where>
  35. <if test="code != null and code != ''">
  36. and code like concat('%', #{code}, '%')
  37. </if>
  38. <if test="description != null and description != ''">
  39. and description like concat('%', #{description}, '%')
  40. </if>
  41. <if test="site != null and site != ''">
  42. and site = #{site}
  43. </if>
  44. <if test="buNo != null and buNo != ''">
  45. and bu_no = #{buNo}
  46. </if>
  47. </where>
  48. </select>
  49. <select id="getSchedulingDataCount" resultType="java.lang.Integer">
  50. select count(*) from tpm_classes
  51. where code = #{code}
  52. </select>
  53. <select id="getClassesList" resultType="com.xujie.sys.modules.scheduling.entity.ClassesData">
  54. select * from tpm_classes
  55. </select>
  56. <select id="querySchedulingList" resultType="com.xujie.sys.modules.scheduling.entity.SchedulingData">
  57. select tpm_scheduling.*,
  58. tc.description as classesDescription
  59. from tpm_scheduling
  60. left join tpm_classes tc on tpm_scheduling.classes_code = tc.code
  61. <where>
  62. <if test="site != null and site != ''">
  63. and site = #{site}
  64. </if>
  65. <if test="buNo != null and buNo != ''">
  66. and bu_no = #{buNo}
  67. </if>
  68. <if test="classesCode != null and classesCode != ''">
  69. and classes_code = #{classesCode}
  70. </if>
  71. <if test="startDate != null">
  72. and date >= #{startDate}
  73. </if>
  74. <if test="endDate != null">
  75. and date <![CDATA[<=]]> #{endDate}
  76. </if>
  77. </where>
  78. </select>
  79. <select id="querySaveSchedulingRecord" resultType="com.xujie.sys.modules.scheduling.entity.SchedulingRecordData">
  80. select * from tpm_scheduling_record
  81. where head_id = #{id}
  82. </select>
  83. </mapper>