puzhibing
2023-03-15 79962435853baf5a28e08461f46a831fffa1a4b0
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
35
36
<?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.crossCity.dao.LineMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.crossCity.model.Line">
        <id column="id" property="id"/>
        <result column="name" property="name"/>
        <result column="shiftInterval" property="shiftInterval"/>
        <result column="rakeRate" property="rakeRate"/>
        <result column="state" property="state"/>
        <result column="insertTime" property="insertTime"/>
    </resultMap>
 
 
    <select id="queryLines" resultType="map">
        select
        a.id as id,
        a.name as name,
        c.name as siteName
        from t_line a
        left join t_line_site b on (a.id = b.lineId)
        left join t_site c on (b.siteId = c.id)
        where a.state = 1 and b.siteId = #{siteId} and b.type = #{type}
    </select>
 
 
    <select id="scanCodeQueryLines" resultType="map">
        select
        b.id as id,
        b.`name` as `name`
        from t_driver_line a
        left join t_line b on (a.lineId = b.id)
        where b.state = 1 and a.driverId = #{driverId}
    </select>
</mapper>