郑永安
2023-06-19 7a6abd05683528032687c75e80e0bd2030a3e46c
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.gkhy.safePlatform.specialWork.repository.WorkAnalysisRecordInfoRepository" >
    <resultMap id="WorkAnalysisData" type="com.gkhy.safePlatform.specialWork.entity.WorkAnalysisRecordInfo" >
        <result column="id" property="id" jdbcType="BIGINT" />
        <result column="work_apply_id" property="workApplyId" jdbcType="BIGINT"/>
        <result column="work_permit_no" property="workPermitNo" jdbcType="VARCHAR"/>
        <result column="work_id" property="workId" jdbcType="BIGINT"/>
        <result column="gmt_create" property="gmtCreate" jdbcType="TIMESTAMP"/>
        <result column="analyst_uid" property="analystUid" jdbcType="BIGINT"/>
        <result column="analyst_uname" property="analystUname" jdbcType="VARCHAR"/>
        <result column="analysis_result" property="analysisResult" jdbcType="TINYINT"/>
        <result column="expiration_time" property="expirationTime" jdbcType="TIMESTAMP"/>
        <result column="analysis_location" property="analysisLocation" jdbcType="VARCHAR"/>
 
    </resultMap>
    <select id="getLatestAnalysisDataByWorkId"
            resultMap="WorkAnalysisData">
        select
        analysis.id,
        analysis.work_apply_id,
        analysis.work_permit_no,
        analysis.work_id,
        analysis.analyst_uid,
        analysis.analyst_uname,
        analysis.analysis_result,
        analysis.expiration_time,
        analysis.gmt_create,
        analysis_location
        from work_analysis_record as analysis
        where id = (select max(id) from work_analysis_record where work_id = #{workId} )
 
    </select>
    <select id="listRecordInfoByPage"
            resultMap="WorkAnalysisData">
        select
        analysis.id,
        analysis.work_apply_id,
        analysis.work_permit_no,
        analysis.work_id,
        analysis.analyst_uid,
        analysis.analyst_uname,
        analysis.analysis_result,
        analysis.expiration_time,
        analysis.gmt_create,
        analysis_location
        from work_analysis_record as analysis
        where analysis.work_id = #{query.workId}
        order by analysis.gmt_create desc
 
 
    </select>
 
 
</mapper>