2021与蓝度共同重构项目,服务端
liuhaonan
2022-10-21 0a30812acaa26ebe654340f7e749a6801b63b194
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
<?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.LightEnergyDataMapper">
 
    <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.LightEnergyData">
            <id property="id" column="id" jdbcType="BIGINT"/>
            <result property="taskId" column="task_id" jdbcType="BIGINT"/>
            <result property="ytdTime" column="ytd_time" jdbcType="VARCHAR"/>
            <result property="energy" column="energy" jdbcType="DECIMAL"/>
            <result property="energySaving" column="energy_saving" jdbcType="DECIMAL"/>
            <result property="poleId" column="pole_id" jdbcType="BIGINT"/>
            <result property="lightAdderss" column="light_adderss" jdbcType="VARCHAR"/>
            <result property="userId" column="user_id" jdbcType="BIGINT"/>
            <result property="clientId" column="client_id" jdbcType="BIGINT"/>
    </resultMap>
 
    <sql id="Base_Column_List">
        id,task_id,ytd_time,
        energy,energy_saving,pole_id,
        light_adderss,user_id,client_id
    </sql>
    <select id="getEnergyList" resultType="com.sandu.ximon.dao.domain.LightEnergyData">
        SELECT
        *
        FROM
        light_energy_data
        WHERE
        <if test="userId != null">
            (user_id = #{userId}
            OR client_id = #{userId})
            AND
        </if>
        ytd_time = #{format}
    </select>
</mapper>