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
35
36
37
38
<?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.LineMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.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
        from t_line a
        left join t_line_site b on (a.id = b.lineId)
        left join t_line_company c on (b.lineId = c.lineId)
        where a.state = 1 and b.siteId = #{siteId} and b.type = #{type} and c.companyId = #{companyId}
    </select>
 
 
    <select id="queryLine" resultType="map">
        select
        a.id as id,
        a.`name` as `name`
        from t_line a
        left join t_line_company b on (a.id = b.lineId)
        where a.state = 1
        <if test="null != companyId">
            and b.companyId = #{companyId}
        </if>
    </select>
</mapper>