Pu Zhibing
2024-12-13 73b750200f25df08aa64124da49e7461f9de6653
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?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.stylefeng.guns.modular.system.dao.LineShiftMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.LineShift">
        <id column="id" property="id"/>
        <result column="lineId" property="lineId"/>
        <result column="startTime" property="startTime"/>
        <result column="endTime" property="endTime"/>
        <result column="carNum" property="carNum"/>
        <result column="state" property="state"/>
        <result column="insertTime" property="insertTime"/>
    </resultMap>
 
 
    <select id="queryByLineId" resultType="map">
        select
        id as id,
        CONCAT(startTime, '-', endTime) as content
        from t_line_shift where state = 1 and lineId = #{lineId} order by startTime
    </select>
 
 
    <select id="queryInfo" resultType="map">
        select
        a.id as id,
        b.id as driverId,
        CONCAT(b.`name`, '-', b.phone) as driver
        from t_line_shift_driver a
        left join t_driver b on (a.driverId = b.id)
        where b.flag != 3 and b.authState = 2 and DATE_FORMAT(a.`day`,'%Y-%m-%d') = DATE_FORMAT(#{time},'%Y-%m-%d') and a.lineShiftId = #{id}
    </select>
</mapper>