<?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>
|