洪城义警-正式版后台
zengh
2022-05-26 4310c19a73f960dfd79c90cfe960cf564b068f72
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
<?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="org.springblade.modules.energy.mapper.EnergyMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="EnergyResultMap" type="org.springblade.modules.energy.entity.Energy">
        <id column="id" property="id"/>
        <result column="identification" property="identification"/>
        <result column="time" property="time"/>
        <result column="type" property="type"/>
    </resultMap>
 
 
    <select id="selectTreeNum" resultType="java.util.HashMap">
        SELECT *  FROM `sys_energy` WHERE time=#{time} and type=1
    </select>
 
    <update id="updateEnergyId">
        UPDATE sys_energy SET
            type = 0 WHERE id = #{id} and identification=#{identification}
    </update>
    <update id="updateEnergyIds">
        UPDATE sys_energy SET
            type = 0 WHERE id = #{id} and identification=#{identification}
    </update>
 
    <select id="selectType" resultType="java.lang.String">
        select GROUP_CONCAT(id) as ids from sys_energy WHERE type=1 and time=#{time};
    </select>
 
    <update id="updateEnergyType">
        UPDATE sys_energy SET
            type = 0 WHERE id in(${code}) and time=#{time}
    </update>
 
    <select id="selectEnergyTree" resultType="java.util.HashMap">
        SELECT *  FROM `sys_energytree` where identification=#{identification}
    </select>
 
 
</mapper>