kongzy
2024-01-29 983bdb5b89932b38d08a11ad1eed6ea89d1597e1
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
56
57
58
59
<?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.assess.system.mapper.AssRiskEstimateMapper">
    <resultMap type="com.gkhy.assess.system.domain.AssRiskEstimate" id="riskEstimateResult">
        <id     property="id"        column="id"         />
        <result property="projectId"     column="project_id"      />
        <result property="riskCharacter"     column="risk_character"      />
        <result property="surroundings"     column="surroundings"      />
        <result property="equipment"     column="equipment"      />
        <result property="technology"     column="technology"      />
        <result property="isAcceptChargess"     column="is_accept_chargess"      />
        <result property="isFeasibility"     column="is_feasibility"      />
        <result property="isFinishReport"     column="is_finish_report"      />
        <result property="isInBusiness"     column="is_in_business"      />
        <result property="isNeedExpert"     column="is_need_expert"      />
        <result property="isSatisfyNeed"     column="is_satisfy_need"      />
        <result property="estimateDate"     column="estimate_date"      />
        <result property="techOpinion"     column="tech_opinion"      />
        <result property="riskOpinion"     column="risk_opinion"      />
        <result property="agencyOpinon"     column="agency_opinon"      />
        <result property="state"     column="state"      />
        <result property="delFlag"     column="del_flag"      />
        <result property="version"     column="version"      />
        <result property="createBy"     column="create_by"      />
        <result property="createTime"     column="create_time"      />
        <result property="updateBy"     column="update_by"      />
        <result property="updateTime"     column="update_time"      />
        <result property="remark"     column="remark"      />
    </resultMap>
 
    <sql id="selectRiskEstimateVo">
        select r.id,r.project_id,r.risk_character,r.surroundings,r.equipment,r.technology,r.is_accept_chargess,r.is_feasibility,
               r.is_finish_report,r.is_in_business,r.is_need_expert,r.is_satisfy_need,r.estimate_date,r.tech_opinion,r.risk_opinion,
               r.agency_opinon,r.state,r.del_flag,r.version,r.del_flag,r.create_by,r.create_time,r.update_by,r.update_time,r.remark
        from ass_risk_estimate r
    </sql>
 
    <select id="getRiskEstimateByProjectId" resultType="com.gkhy.assess.system.domain.AssRiskEstimate">
        <include refid="selectRiskEstimateVo"/>
        where project_id=#{projectId} and del_flag=0
    </select>
 
    <select id="getRiskEstimateById" resultType="com.gkhy.assess.system.domain.AssRiskEstimate">
        <include refid="selectRiskEstimateVo"/>
        where r.id=#{riskId}
    </select>
 
    <select id="getProjectByRiskId" resultType="com.gkhy.assess.system.domain.AssProject">
        select p.id,p.name,p.report_progress from ass_project p
        left join ass_risk_estimate r on r.project_id=p.id
        where r.id=${riskId}
    </select>
 
 
    <select id="getCountByProjectId" resultType="java.lang.Integer">
        select count(1) from ass_risk_estimate where project_id=#{projectId} and del_flag=0
    </select>
 
</mapper>