| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.daju.mix.dao.mapper.TBWorkPlanMapper">
- <resultMap type="com.daju.mix.dto.TSTypeDto" id="TSTypeMap">
- <result property="id" column="id" />
- <result property="code" column="typecode" />
- <result property="name" column="typename" />
- </resultMap>
- <!-- 查询已完成作业计划数量-->
- <select id="selectcarryutCount" resultType="int">
- SELECT
- count( 1 )
- FROM
- t_b_work_plan a
- WHERE
- a.state = '1'
- AND EXISTS ( SELECT * FROM t_b_work_list b WHERE a.id = b.plan_id AND b.complete_state = '2' )
- </select>
- <!-- 当日清扫次数-->
- <select id="selectSweepPlanCount" resultType="int">
- select count(a.id)
- from t_b_car_schedule_common_section a
- left join t_b_car_schedule b on a.schedule_id = b.id and b.assignmentStyle = 4
- where DATEDIFF(now(),a.date) = 0
- and a.status = '2' or a.status = '1'
- </select>
- <!-- 待清扫数量-->
- <select id="selectSweepPlansCount" resultType="int">
- select count(a.id)
- from t_b_car_schedule_common_section a
- left join t_b_car_schedule b on a.schedule_id = b.id
- where a.status = '0'
- and assignmentStyle = 4
- and DATEDIFF(now(),a.date) = 0;
- </select>
- <select id="selectTSTypeList" resultType="com.daju.mix.dto.TSTypeDto">
- SELECT
- tp.typecode id, tp.typename name
- FROM
- t_s_type tp
- left join t_s_typegroup ts on tp.typegroupid = ts.id
- where
- ts.id = #{groupId}
- <if test="tId != null and tId != ''">
- and tp.typecode = #{tId}
- </if>
- </select>
- <select id="getWorkLinesByCarId" resultType="com.daju.mix.dao.entity.TBArchivesArea">
- SELECT
- tbaa.*
- FROM
- t_b_archives_area tbaa
- LEFT JOIN t_b_work_route_list tbwrl ON tbwrl.place_code = tbaa.`code`
- LEFT JOIN t_b_car_schedule_task tbcst ON tbcst.work_route = tbwrl.route_id
- LEFT JOIN t_b_car_schedule_task_detail tbcstd ON tbcstd.pid = tbcst.id
- WHERE
- tbcstd.carid = #{carId}
- AND CONCAT(tbcstd.yearmonth, "-", tbcstd.code_day) = #{workTime};
- </select>
- </mapper>
|