TBWorkPlanMapper.xml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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.daju.mix.dao.mapper.TBWorkPlanMapper">
  4. <resultMap type="com.daju.mix.dto.TSTypeDto" id="TSTypeMap">
  5. <result property="id" column="id" />
  6. <result property="code" column="typecode" />
  7. <result property="name" column="typename" />
  8. </resultMap>
  9. <!-- 查询已完成作业计划数量-->
  10. <select id="selectcarryutCount" resultType="int">
  11. SELECT
  12. count( 1 )
  13. FROM
  14. t_b_work_plan a
  15. WHERE
  16. a.state = '1'
  17. AND EXISTS ( SELECT * FROM t_b_work_list b WHERE a.id = b.plan_id AND b.complete_state = '2' )
  18. </select>
  19. <!-- 当日清扫次数-->
  20. <select id="selectSweepPlanCount" resultType="int">
  21. select count(a.id)
  22. from t_b_car_schedule_common_section a
  23. left join t_b_car_schedule b on a.schedule_id = b.id and b.assignmentStyle = 4
  24. where DATEDIFF(now(),a.date) = 0
  25. and a.status = '2' or a.status = '1'
  26. </select>
  27. <!-- 待清扫数量-->
  28. <select id="selectSweepPlansCount" resultType="int">
  29. select count(a.id)
  30. from t_b_car_schedule_common_section a
  31. left join t_b_car_schedule b on a.schedule_id = b.id
  32. where a.status = '0'
  33. and assignmentStyle = 4
  34. and DATEDIFF(now(),a.date) = 0;
  35. </select>
  36. <select id="selectTSTypeList" resultType="com.daju.mix.dto.TSTypeDto">
  37. SELECT
  38. tp.typecode id, tp.typename name
  39. FROM
  40. t_s_type tp
  41. left join t_s_typegroup ts on tp.typegroupid = ts.id
  42. where
  43. ts.id = #{groupId}
  44. <if test="tId != null and tId != ''">
  45. and tp.typecode = #{tId}
  46. </if>
  47. </select>
  48. <select id="getWorkLinesByCarId" resultType="com.daju.mix.dao.entity.TBArchivesArea">
  49. SELECT
  50. tbaa.*
  51. FROM
  52. t_b_archives_area tbaa
  53. LEFT JOIN t_b_work_route_list tbwrl ON tbwrl.place_code = tbaa.`code`
  54. LEFT JOIN t_b_car_schedule_task tbcst ON tbcst.work_route = tbwrl.route_id
  55. LEFT JOIN t_b_car_schedule_task_detail tbcstd ON tbcstd.pid = tbcst.id
  56. WHERE
  57. tbcstd.carid = #{carId}
  58. AND CONCAT(tbcstd.yearmonth, "-", tbcstd.code_day) = #{workTime};
  59. </select>
  60. </mapper>