|
|
@@ -5,199 +5,236 @@
|
|
|
<mapper namespace="com.jjt.risk.mapper.RiskAnalysisMapper">
|
|
|
|
|
|
<resultMap type="RiskAnalysis" id="RiskAnalysisResult">
|
|
|
- <result property="resultId" column="RESULT_ID"/>
|
|
|
- <result property="riskId" column="RISK_ID"/>
|
|
|
- <result property="result" column="RESULT"/>
|
|
|
- <result property="avgValue" column="AVG_VALUE"/>
|
|
|
- <result property="normalValid" column="NORMAL_VALID"/>
|
|
|
- <result property="varianceValid" column="VARIANCE_VALID"/>
|
|
|
- <result property="confidenceLevel" column="CONFIDENCE_LEVEL"/>
|
|
|
- <result property="pValue" column="P_VALUE"/>
|
|
|
- <result property="analyseTime" column="ANALYSE_TIME"/>
|
|
|
- <result property="imgPath" column="IMG_PATH"/>
|
|
|
- <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"/>
|
|
|
+ <result property="resultId" column="RESULT_ID"/>
|
|
|
+ <result property="riskId" column="RISK_ID"/>
|
|
|
+ <result property="riskType" column="RISK_TYPE"/>
|
|
|
+ <result property="result" column="RESULT"/>
|
|
|
+ <result property="avgValue" column="AVG_VALUE"/>
|
|
|
+ <result property="normalValid" column="NORMAL_VALID"/>
|
|
|
+ <result property="varianceValid" column="VARIANCE_VALID"/>
|
|
|
+ <result property="confidenceLevel" column="CONFIDENCE_LEVEL"/>
|
|
|
+ <result property="pValue" column="P_VALUE"/>
|
|
|
+ <result property="analyseTime" column="ANALYSE_TIME"/>
|
|
|
+ <result property="imgPath" column="IMG_PATH"/>
|
|
|
+ <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="selectRiskAnalysisVo">
|
|
|
- select RESULT_ID, RISK_ID, RESULT, AVG_VALUE, NORMAL_VALID, VARIANCE_VALID, CONFIDENCE_LEVEL, P_VALUE, ANALYSE_TIME, IMG_PATH, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, REMARK
|
|
|
- from risk_analysis
|
|
|
+ select *
|
|
|
+ from (select A.RESULT_ID,
|
|
|
+ A.RISK_ID,
|
|
|
+ A.OBJ_ID,
|
|
|
+ C.OBJ_NAME,
|
|
|
+ B.RISK_TYPE,
|
|
|
+ B.METRICS_NAME,
|
|
|
+ A.RESULT,
|
|
|
+ A.AVG_VALUE,
|
|
|
+ A.NORMAL_VALID,
|
|
|
+ A.VARIANCE_VALID,
|
|
|
+ A.CONFIDENCE_LEVEL,
|
|
|
+ A.P_VALUE,
|
|
|
+ A.ANALYSE_TIME,
|
|
|
+ A.IMG_PATH,
|
|
|
+ A.CREATE_BY,
|
|
|
+ A.CREATE_TIME,
|
|
|
+ A.UPDATE_BY,
|
|
|
+ A.UPDATE_TIME,
|
|
|
+ A.REMARK
|
|
|
+ from risk_analysis a LEFT JOIN biz_obj c ON a.OBJ_ID=c.OBJ_ID,risk_model b
|
|
|
+ where a.risk_id = b.risk_id ) t
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectRiskAnalysisList" parameterType="RiskAnalysis" resultMap="RiskAnalysisResult">
|
|
|
<include refid="selectRiskAnalysisVo"/>
|
|
|
<where>
|
|
|
- <if test="riskId != null ">
|
|
|
- and RISK_ID = #{riskId}
|
|
|
- </if>
|
|
|
- <if test="result != null and result != ''">
|
|
|
- and RESULT = #{result}
|
|
|
- </if>
|
|
|
- <if test="avgValue != null and avgValue != ''">
|
|
|
- and AVG_VALUE = #{avgValue}
|
|
|
- </if>
|
|
|
- <if test="normalValid != null and normalValid != ''">
|
|
|
- and NORMAL_VALID = #{normalValid}
|
|
|
- </if>
|
|
|
- <if test="varianceValid != null and varianceValid != ''">
|
|
|
- and VARIANCE_VALID = #{varianceValid}
|
|
|
- </if>
|
|
|
- <if test="confidenceLevel != null and confidenceLevel != ''">
|
|
|
- and CONFIDENCE_LEVEL = #{confidenceLevel}
|
|
|
- </if>
|
|
|
- <if test="pValue != null and pValue != ''">
|
|
|
- and P_VALUE = #{pValue}
|
|
|
- </if>
|
|
|
- <if test="analyseTime != null ">
|
|
|
- and ANALYSE_TIME = #{analyseTime}
|
|
|
- </if>
|
|
|
- <if test="imgPath != null and imgPath != ''">
|
|
|
- and IMG_PATH = #{imgPath}
|
|
|
- </if>
|
|
|
- <if test="createBy != null and createBy != ''">
|
|
|
- and CREATE_BY = #{createBy}
|
|
|
- </if>
|
|
|
- <if test="createTime != null ">
|
|
|
- and CREATE_TIME = #{createTime}
|
|
|
- </if>
|
|
|
- <if test="updateBy != null and updateBy != ''">
|
|
|
- and UPDATE_BY = #{updateBy}
|
|
|
- </if>
|
|
|
- <if test="updateTime != null ">
|
|
|
- and UPDATE_TIME = #{updateTime}
|
|
|
- </if>
|
|
|
- <if test="remark != null and remark != ''">
|
|
|
- and REMARK = #{remark}
|
|
|
- </if>
|
|
|
+ <if test="riskId != null ">
|
|
|
+ and RISK_ID = #{riskId}
|
|
|
+ </if>
|
|
|
+ <if test="riskType != null ">
|
|
|
+ and RISK_TYPE = #{riskType}
|
|
|
+ </if>
|
|
|
+ <if test="metricsId != null ">
|
|
|
+ and METRICS_ID = #{metricsId}
|
|
|
+ </if>
|
|
|
+ <if test="metricsName != null and metricsName != ''">
|
|
|
+ and METRICS_NAME like concat('%', #{metricsName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="objId != null ">
|
|
|
+ and OBJ_ID = #{objId}
|
|
|
+ </if>
|
|
|
+ <if test="objName != null ">
|
|
|
+ and OBJ_NAME like concat('%', #{objName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="result != null and result != ''">
|
|
|
+ and RESULT = #{result}
|
|
|
+ </if>
|
|
|
+ <if test="avgValue != null and avgValue != ''">
|
|
|
+ and AVG_VALUE = #{avgValue}
|
|
|
+ </if>
|
|
|
+ <if test="normalValid != null and normalValid != ''">
|
|
|
+ and NORMAL_VALID = #{normalValid}
|
|
|
+ </if>
|
|
|
+ <if test="varianceValid != null and varianceValid != ''">
|
|
|
+ and VARIANCE_VALID = #{varianceValid}
|
|
|
+ </if>
|
|
|
+ <if test="confidenceLevel != null and confidenceLevel != ''">
|
|
|
+ and CONFIDENCE_LEVEL = #{confidenceLevel}
|
|
|
+ </if>
|
|
|
+ <if test="pValue != null and pValue != ''">
|
|
|
+ and P_VALUE = #{pValue}
|
|
|
+ </if>
|
|
|
+ <if test="analyseTime != null ">
|
|
|
+ and ANALYSE_TIME = #{analyseTime}
|
|
|
+ </if>
|
|
|
+ <if test="imgPath != null and imgPath != ''">
|
|
|
+ and IMG_PATH = #{imgPath}
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null and createBy != ''">
|
|
|
+ and CREATE_BY = #{createBy}
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null ">
|
|
|
+ and CREATE_TIME = #{createTime}
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">
|
|
|
+ and UPDATE_BY = #{updateBy}
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null ">
|
|
|
+ and UPDATE_TIME = #{updateTime}
|
|
|
+ </if>
|
|
|
+ <if test="remark != null and remark != ''">
|
|
|
+ and REMARK = #{remark}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectRiskAnalysisByResultId" parameterType="Long"
|
|
|
resultMap="RiskAnalysisResult">
|
|
|
- <include refid="selectRiskAnalysisVo"/>
|
|
|
- where RESULT_ID = #{resultId}
|
|
|
+ <include refid="selectRiskAnalysisVo"/>
|
|
|
+ where RESULT_ID = #{resultId}
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertRiskAnalysis" parameterType="RiskAnalysis" useGeneratedKeys="true"
|
|
|
keyProperty="resultId">
|
|
|
insert into risk_analysis
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="riskId != null">RISK_ID,
|
|
|
- </if>
|
|
|
- <if test="result != null">RESULT,
|
|
|
- </if>
|
|
|
- <if test="avgValue != null">AVG_VALUE,
|
|
|
- </if>
|
|
|
- <if test="normalValid != null">NORMAL_VALID,
|
|
|
- </if>
|
|
|
- <if test="varianceValid != null">VARIANCE_VALID,
|
|
|
- </if>
|
|
|
- <if test="confidenceLevel != null">CONFIDENCE_LEVEL,
|
|
|
- </if>
|
|
|
- <if test="pValue != null">P_VALUE,
|
|
|
- </if>
|
|
|
- <if test="analyseTime != null">ANALYSE_TIME,
|
|
|
- </if>
|
|
|
- <if test="imgPath != null">IMG_PATH,
|
|
|
- </if>
|
|
|
- <if test="createBy != null">CREATE_BY,
|
|
|
- </if>
|
|
|
- <if test="createTime != null">CREATE_TIME,
|
|
|
- </if>
|
|
|
- <if test="updateBy != null">UPDATE_BY,
|
|
|
- </if>
|
|
|
- <if test="updateTime != null">UPDATE_TIME,
|
|
|
- </if>
|
|
|
- <if test="remark != null">REMARK,
|
|
|
- </if>
|
|
|
+ <if test="riskId != null">RISK_ID,
|
|
|
+ </if>
|
|
|
+ <if test="result != null">RESULT,
|
|
|
+ </if>
|
|
|
+ <if test="avgValue != null">AVG_VALUE,
|
|
|
+ </if>
|
|
|
+ <if test="normalValid != null">NORMAL_VALID,
|
|
|
+ </if>
|
|
|
+ <if test="varianceValid != null">VARIANCE_VALID,
|
|
|
+ </if>
|
|
|
+ <if test="confidenceLevel != null">CONFIDENCE_LEVEL,
|
|
|
+ </if>
|
|
|
+ <if test="pValue != null">P_VALUE,
|
|
|
+ </if>
|
|
|
+ <if test="analyseTime != null">ANALYSE_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="imgPath != null">IMG_PATH,
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">CREATE_BY,
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">CREATE_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">UPDATE_BY,
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">UPDATE_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="remark != null">REMARK,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="riskId != null">#{riskId},
|
|
|
- </if>
|
|
|
- <if test="result != null">#{result},
|
|
|
- </if>
|
|
|
- <if test="avgValue != null">#{avgValue},
|
|
|
- </if>
|
|
|
- <if test="normalValid != null">#{normalValid},
|
|
|
- </if>
|
|
|
- <if test="varianceValid != null">#{varianceValid},
|
|
|
- </if>
|
|
|
- <if test="confidenceLevel != null">#{confidenceLevel},
|
|
|
- </if>
|
|
|
- <if test="pValue != null">#{pValue},
|
|
|
- </if>
|
|
|
- <if test="analyseTime != null">#{analyseTime},
|
|
|
- </if>
|
|
|
- <if test="imgPath != null">#{imgPath},
|
|
|
- </if>
|
|
|
- <if test="createBy != null">#{createBy},
|
|
|
- </if>
|
|
|
- <if test="createTime != null">#{createTime},
|
|
|
- </if>
|
|
|
- <if test="updateBy != null">#{updateBy},
|
|
|
- </if>
|
|
|
- <if test="updateTime != null">#{updateTime},
|
|
|
- </if>
|
|
|
- <if test="remark != null">#{remark},
|
|
|
- </if>
|
|
|
+ <if test="riskId != null">#{riskId},
|
|
|
+ </if>
|
|
|
+ <if test="result != null">#{result},
|
|
|
+ </if>
|
|
|
+ <if test="avgValue != null">#{avgValue},
|
|
|
+ </if>
|
|
|
+ <if test="normalValid != null">#{normalValid},
|
|
|
+ </if>
|
|
|
+ <if test="varianceValid != null">#{varianceValid},
|
|
|
+ </if>
|
|
|
+ <if test="confidenceLevel != null">#{confidenceLevel},
|
|
|
+ </if>
|
|
|
+ <if test="pValue != null">#{pValue},
|
|
|
+ </if>
|
|
|
+ <if test="analyseTime != null">#{analyseTime},
|
|
|
+ </if>
|
|
|
+ <if test="imgPath != null">#{imgPath},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">#{createBy},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">#{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">#{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">#{updateTime},
|
|
|
+ </if>
|
|
|
+ <if test="remark != null">#{remark},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateRiskAnalysis" parameterType="RiskAnalysis">
|
|
|
update risk_analysis
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="riskId != null">RISK_ID =
|
|
|
- #{riskId},
|
|
|
- </if>
|
|
|
- <if test="result != null">RESULT =
|
|
|
- #{result},
|
|
|
- </if>
|
|
|
- <if test="avgValue != null">AVG_VALUE =
|
|
|
- #{avgValue},
|
|
|
- </if>
|
|
|
- <if test="normalValid != null">NORMAL_VALID =
|
|
|
- #{normalValid},
|
|
|
- </if>
|
|
|
- <if test="varianceValid != null">VARIANCE_VALID =
|
|
|
- #{varianceValid},
|
|
|
- </if>
|
|
|
- <if test="confidenceLevel != null">CONFIDENCE_LEVEL =
|
|
|
- #{confidenceLevel},
|
|
|
- </if>
|
|
|
- <if test="pValue != null">P_VALUE =
|
|
|
- #{pValue},
|
|
|
- </if>
|
|
|
- <if test="analyseTime != null">ANALYSE_TIME =
|
|
|
- #{analyseTime},
|
|
|
- </if>
|
|
|
- <if test="imgPath != null">IMG_PATH =
|
|
|
- #{imgPath},
|
|
|
- </if>
|
|
|
- <if test="createBy != null">CREATE_BY =
|
|
|
- #{createBy},
|
|
|
- </if>
|
|
|
- <if test="createTime != null">CREATE_TIME =
|
|
|
- #{createTime},
|
|
|
- </if>
|
|
|
- <if test="updateBy != null">UPDATE_BY =
|
|
|
- #{updateBy},
|
|
|
- </if>
|
|
|
- <if test="updateTime != null">UPDATE_TIME =
|
|
|
- #{updateTime},
|
|
|
- </if>
|
|
|
- <if test="remark != null">REMARK =
|
|
|
- #{remark},
|
|
|
- </if>
|
|
|
+ <if test="riskId != null">RISK_ID =
|
|
|
+ #{riskId},
|
|
|
+ </if>
|
|
|
+ <if test="result != null">RESULT =
|
|
|
+ #{result},
|
|
|
+ </if>
|
|
|
+ <if test="avgValue != null">AVG_VALUE =
|
|
|
+ #{avgValue},
|
|
|
+ </if>
|
|
|
+ <if test="normalValid != null">NORMAL_VALID =
|
|
|
+ #{normalValid},
|
|
|
+ </if>
|
|
|
+ <if test="varianceValid != null">VARIANCE_VALID =
|
|
|
+ #{varianceValid},
|
|
|
+ </if>
|
|
|
+ <if test="confidenceLevel != null">CONFIDENCE_LEVEL =
|
|
|
+ #{confidenceLevel},
|
|
|
+ </if>
|
|
|
+ <if test="pValue != null">P_VALUE =
|
|
|
+ #{pValue},
|
|
|
+ </if>
|
|
|
+ <if test="analyseTime != null">ANALYSE_TIME =
|
|
|
+ #{analyseTime},
|
|
|
+ </if>
|
|
|
+ <if test="imgPath != null">IMG_PATH =
|
|
|
+ #{imgPath},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">CREATE_BY =
|
|
|
+ #{createBy},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">CREATE_TIME =
|
|
|
+ #{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">UPDATE_BY =
|
|
|
+ #{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">UPDATE_TIME =
|
|
|
+ #{updateTime},
|
|
|
+ </if>
|
|
|
+ <if test="remark != null">REMARK =
|
|
|
+ #{remark},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
where RESULT_ID = #{resultId}
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteRiskAnalysisByResultId" parameterType="Long">
|
|
|
delete
|
|
|
- from risk_analysis where RESULT_ID = #{resultId}
|
|
|
+ from risk_analysis
|
|
|
+ where RESULT_ID = #{resultId}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteRiskAnalysisByResultIds" parameterType="String">
|