ScheduleClassesV1ServiceDaoImplMapper.xml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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="scheduleClassesV1ServiceDaoImpl">
  6. <!-- 保存排班信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveScheduleClassesInfo" parameterType="Map">
  8. insert into schedule_classes(
  9. schedule_type,schedule_cycle,compute_time,name,remark,state,store_id,schedule_id
  10. ) values (
  11. #{scheduleType},#{scheduleCycle},#{computeTime},#{name},#{remark},#{state},#{storeId},#{scheduleId}
  12. )
  13. </insert>
  14. <!-- 查询排班信息 add by wuxw 2018-07-03 -->
  15. <select id="getScheduleClassesInfo" parameterType="Map" resultType="Map">
  16. select t.schedule_type,t.schedule_type scheduleType,t.schedule_cycle,t.schedule_cycle
  17. scheduleCycle,t.compute_time,t.compute_time computeTime,t.name,t.remark,t.status_cd,t.status_cd
  18. statusCd,t.state,t.store_id,t.store_id storeId,t.schedule_id,t.schedule_id scheduleId,
  19. td.name scheduleTypeName,td1.name stateName
  20. from schedule_classes t
  21. left join t_dict td on t.schedule_type = td.status_cd and td.table_name = 'schedule_classes' and td.table_columns = 'schedule_type'
  22. left join t_dict td1 on t.state = td1.status_cd and td1.table_name = 'schedule_classes' and td1.table_columns = 'state'
  23. where 1 =1
  24. <if test="scheduleType !=null and scheduleType != ''">
  25. and t.schedule_type= #{scheduleType}
  26. </if>
  27. <if test="scheduleCycle !=null and scheduleCycle != ''">
  28. and t.schedule_cycle= #{scheduleCycle}
  29. </if>
  30. <if test="computeTime !=null and computeTime != ''">
  31. and t.compute_time= #{computeTime}
  32. </if>
  33. <if test="name !=null and name != ''">
  34. and t.name= #{name}
  35. </if>
  36. <if test="nameLike !=null and nameLike != ''">
  37. and t.name like concat('%',#{name},'%')
  38. </if>
  39. <if test="remark !=null and remark != ''">
  40. and t.remark= #{remark}
  41. </if>
  42. <if test="statusCd !=null and statusCd != ''">
  43. and t.status_cd= #{statusCd}
  44. </if>
  45. <if test="state !=null and state != ''">
  46. and t.state= #{state}
  47. </if>
  48. <if test="storeId !=null and storeId != ''">
  49. and t.store_id= #{storeId}
  50. </if>
  51. <if test="scheduleId !=null and scheduleId != ''">
  52. and t.schedule_id= #{scheduleId}
  53. </if>
  54. order by t.create_time desc
  55. <if test="page != -1 and page != null ">
  56. limit #{page}, #{row}
  57. </if>
  58. </select>
  59. <!-- 修改排班信息 add by wuxw 2018-07-03 -->
  60. <update id="updateScheduleClassesInfo" parameterType="Map">
  61. update schedule_classes t set t.status_cd = #{statusCd}
  62. <if test="newBId != null and newBId != ''">
  63. ,t.b_id = #{newBId}
  64. </if>
  65. <if test="scheduleType !=null and scheduleType != ''">
  66. , t.schedule_type= #{scheduleType}
  67. </if>
  68. <if test="scheduleCycle !=null and scheduleCycle != ''">
  69. , t.schedule_cycle= #{scheduleCycle}
  70. </if>
  71. <if test="computeTime !=null and computeTime != ''">
  72. , t.compute_time= #{computeTime}
  73. </if>
  74. <if test="name !=null and name != ''">
  75. , t.name= #{name}
  76. </if>
  77. <if test="remark !=null and remark != ''">
  78. , t.remark= #{remark}
  79. </if>
  80. <if test="state !=null and state != ''">
  81. , t.state= #{state}
  82. </if>
  83. <if test="storeId !=null and storeId != ''">
  84. , t.store_id= #{storeId}
  85. </if>
  86. where 1=1
  87. <if test="scheduleId !=null and scheduleId != ''">
  88. and t.schedule_id= #{scheduleId}
  89. </if>
  90. </update>
  91. <!-- 查询排班数量 add by wuxw 2018-07-03 -->
  92. <select id="queryScheduleClassessCount" parameterType="Map" resultType="Map">
  93. select count(1) count
  94. from schedule_classes t
  95. where 1 =1
  96. <if test="scheduleType !=null and scheduleType != ''">
  97. and t.schedule_type= #{scheduleType}
  98. </if>
  99. <if test="scheduleCycle !=null and scheduleCycle != ''">
  100. and t.schedule_cycle= #{scheduleCycle}
  101. </if>
  102. <if test="computeTime !=null and computeTime != ''">
  103. and t.compute_time= #{computeTime}
  104. </if>
  105. <if test="name !=null and name != ''">
  106. and t.name= #{name}
  107. </if>
  108. <if test="nameLike !=null and nameLike != ''">
  109. and t.name like concat('%',#{name},'%')
  110. </if>
  111. <if test="remark !=null and remark != ''">
  112. and t.remark= #{remark}
  113. </if>
  114. <if test="statusCd !=null and statusCd != ''">
  115. and t.status_cd= #{statusCd}
  116. </if>
  117. <if test="state !=null and state != ''">
  118. and t.state= #{state}
  119. </if>
  120. <if test="storeId !=null and storeId != ''">
  121. and t.store_id= #{storeId}
  122. </if>
  123. <if test="scheduleId !=null and scheduleId != ''">
  124. and t.schedule_id= #{scheduleId}
  125. </if>
  126. </select>
  127. </mapper>