郑永安
2023-09-19 69185134fcfaf913ea45f1255677225a2cc311a4
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
53
54
55
<?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.gk.hotwork.Mapper.TaskGasInfoMapper">
    <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.TaskGasInfo">
        <!--          -->
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="taskcode" property="taskcode" jdbcType="VARCHAR"/>
        <result column="taskworker" property="taskworker" jdbcType="VARCHAR"/>
        <result column="gastype" property="gastype" jdbcType="VARCHAR"/>
        <result column="gasvalue" property="gasvalue" jdbcType="DECIMAL"/>
        <result column="gasunit" property="gasunit" jdbcType="VARCHAR"/>
        <result column="iswarn" property="iswarn" jdbcType="TINYINT"/>
        <result column="isyujing" property="isyujing" jdbcType="TINYINT"/>
        <result column="issms" property="issms" jdbcType="TINYINT"/>
        <result column="ismend" property="ismend" jdbcType="TINYINT"/>
        <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP"/>
    </resultMap>
    <sql id="Base_Column_List">
        <!--          -->
        id, taskcode, taskworker, gastype, gasvalue, gasunit, iswarn, isyujing, issms, ismend,
        updatetime
    </sql>
    <select id="selectDataGrid" resultType="com.gk.hotwork.Domain.TaskGasInfo">
        select *
        from taskgas
        <where>
            1=1
            <if test="condition.taskcode != null and condition.taskcode !=''">
                and taskcode = #{condition.taskcode}
            </if>
            <if test="condition.gastype != null and condition.gastype !=''">
                and gastype = #{condition.gastype}
            </if>
        </where>
    </select>
    <select id="selectLastGas" resultType="com.gk.hotwork.Domain.TaskGasInfo">
        SELECT
        *
        FROM
        (
        SELECT * FROM `taskgas`
        <where>
            taskcode = #{taskCode}
            AND taskworker = #{worker}
        </where>
        ORDER BY
        updatetime DESC
        LIMIT 100
        ) t
        GROUP BY
        t.gastype
    </select>
 
 
</mapper>