2021与蓝度共同重构项目,服务端
liuhaonan
2022-08-12 b9e1aef87da450d99587b56dbb31323fc6e0f3ea
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?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.sandu.ximon.dao.mapper.LightTaskPoleRelationMapper">
 
    <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.LightTaskPoleRelation">
        <id property="id" column="id" jdbcType="BIGINT"/>
        <result property="taskId" column="task_id" jdbcType="BIGINT"/>
        <result property="poleId" column="pole_id" jdbcType="BIGINT"/>
        <result property="lightAddress" column="light_address" jdbcType="VARCHAR"/>
        <result property="issueStatus" column="issue_status" jdbcType="INTEGER"/>
        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
    </resultMap>
 
    <sql id="Base_Column_List">
        id
        ,task_id,pole_id,
        issue_status,create_time,update_time
    </sql>
    <select id="listPoleAndStatusIdByTaskId" resultType="com.sandu.ximon.dao.bo.LightTaskStatusAndPole">
        SELECT
        t1.issue_status,
        t2.*
        FROM
        light_task_pole_relation t1
        LEFT JOIN pole t2 ON t1.pole_id = t2.id
        <where>
            AND t1.task_id = #{taskId}
        </where>
    </select>
 
    <select id="test" resultType="com.sandu.ximon.dao.bo.LightTaskPoleRelationBo">
        SELECT
        t1.*,
        t2.user_id, t2.client_id,
        t3.task_name, t3.week, t3.open_order, t3.close_order, t3.control_order, t3.light_adress
        FROM
        light_task_pole_relation t1
        LEFT JOIN pole t2 ON t1.pole_id = t2.id
        LEFT JOIN light_task t3 ON t3.task_id = t1.task_id
        <where>
            t1.issue_status=0
            AND
            t1.task_id IN
            <foreach collection="taskIdList" open="(" close=")" separator="," item="task_id">
                #{task_id}
            </foreach>
        </where>
    </select>
</mapper>