<?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">
|
<!--
|
* @title: 案件风险检查\重点案件判断表
|
* @description: 自定义sql,请自行实现业务逻辑
|
* @company: hugeinfo
|
* @author: huangh
|
* @time:${createTime}
|
* @version 1.0.0
|
-->
|
<mapper namespace="cn.huge.module.aidata.dao.mapper.AiCaseRiskMapper">
|
<resultMap id="dataResult" type="cn.huge.module.aidata.domain.po.AiCaseRisk">
|
<result property="aiCaseRiskId" column="ai_case_risk_id"/>
|
<result property="caseId" column="case_id"/>
|
<result property="source" column="source"/>
|
<result property="sourceName" column="source_name"/>
|
<result property="caseTextHash" column="case_text_hash"/>
|
<result property="isRisk" column="is_risk"/>
|
<result property="isRiskAi" column="is_risk_ai"/>
|
<result property="deleteStatus" column="delete_status"/>
|
<result property="createTime" column="create_time"/>
|
<result property="updateTime" column="update_time"/>
|
<result property="note" column="note"/>
|
</resultMap>
|
|
<sql id='table-name'>ai.ai_case_risk</sql>
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="cn.huge.module.aidata.domain.po.AiCaseRisk">
|
<id column="ai_case_risk_id" property="aiCaseRiskId"/>
|
<result column="case_id" property="caseId"/>
|
<result column="source" property="source"/>
|
<result column="source_name" property="sourceName"/>
|
<result column="case_text_hash" property="caseTextHash"/>
|
<result column="is_risk" property="isRisk"/>
|
<result column="is_risk_ai" property="isRiskAi"/>
|
<result column="delete_status" property="deleteStatus"/>
|
<result column="create_time" property="createTime"/>
|
<result column="update_time" property="updateTime"/>
|
<result column="note" property="note"/>
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
ai_case_risk_id, case_id, source, source_name, case_text_hash, is_risk, is_risk_ai,
|
delete_status, create_time, update_time, note
|
</sql>
|
|
<!-- 更新对象 -->
|
<update id="updateAiCaseRisk">
|
update <include refid="table-name"/>
|
<set>
|
<if test="entity.caseId != null">case_id = #{entity.caseId},</if>
|
<if test="entity.source != null">source = #{entity.source},</if>
|
<if test="entity.sourceName != null">source_name = #{entity.sourceName},</if>
|
<if test="entity.caseTextHash != null">case_text_hash = #{entity.caseTextHash},</if>
|
<if test="entity.isRisk != null">is_risk = #{entity.isRisk},</if>
|
<if test="entity.isRiskAi != null">is_risk_ai = #{entity.isRiskAi},</if>
|
<if test="entity.deleteStatus != null">delete_status = #{entity.deleteStatus},</if>
|
<if test="entity.updateTime != null">update_time = #{entity.updateTime},</if>
|
<if test="entity.note != null">note = #{entity.note}</if>
|
</set>
|
where ai_case_risk_id = #{entity.aiCaseRiskId}
|
</update>
|
|
<!-- 条件更新对象 -->
|
<update id="updateAiCaseRiskTerms">
|
update <include refid="table-name"/>
|
<set>
|
<if test="entity.caseId != null">case_id = #{entity.caseId},</if>
|
<if test="entity.source != null">source = #{entity.source},</if>
|
<if test="entity.sourceName != null">source_name = #{entity.sourceName},</if>
|
<if test="entity.caseTextHash != null">case_text_hash = #{entity.caseTextHash},</if>
|
<if test="entity.isRisk != null">is_risk = #{entity.isRisk},</if>
|
<if test="entity.isRiskAi != null">is_risk_ai = #{entity.isRiskAi},</if>
|
<if test="entity.deleteStatus != null">delete_status = #{entity.deleteStatus},</if>
|
<if test="entity.updateTime != null">update_time = #{entity.updateTime},</if>
|
<if test="entity.note != null">note = #{entity.note}</if>
|
</set>
|
<where>
|
<if test="terms.aiCaseRiskId != null">
|
and ai_case_risk_id = #{terms.aiCaseRiskId}
|
</if>
|
<if test="terms.caseId != null">
|
and case_id = #{terms.caseId}
|
</if>
|
<if test="terms.isRisk != null">
|
and is_risk = #{terms.isRisk}
|
</if>
|
<if test="terms.isRiskAi != null">
|
and is_risk_ai = #{terms.isRiskAi}
|
</if>
|
</where>
|
</update>
|
|
<!-- 根据编号物理删除 -->
|
<delete id="deleteAiCaseRisk">
|
delete from <include refid="table-name"/> where ai_case_risk_id = #{id}
|
</delete>
|
|
<!-- 按条件查询结果集 -->
|
<select id="listTerms" resultMap="BaseResultMap">
|
select <include refid="Base_Column_List"/>
|
from <include refid="table-name"/>
|
<where>
|
<if test="terms.aiCaseRiskId != null">
|
and ai_case_risk_id = #{terms.aiCaseRiskId}
|
</if>
|
<if test="terms.caseId != null">
|
and case_id = #{terms.caseId}
|
</if>
|
<if test="terms.isRisk != null">
|
and is_risk = #{terms.isRisk}
|
</if>
|
<if test="terms.isRiskAi != null">
|
and is_risk_ai = #{terms.isRiskAi}
|
</if>
|
</where>
|
order by create_time desc
|
</select>
|
|
<!-- 按条件查询实体总数 -->
|
<select id="countTerms" resultType="long">
|
select count(1)
|
from <include refid="table-name"/>
|
<where>
|
<if test="terms.aiCaseRiskId != null">
|
and ai_case_risk_id = #{terms.aiCaseRiskId}
|
</if>
|
<if test="terms.caseId != null">
|
and case_id = #{terms.caseId}
|
</if>
|
<if test="terms.isRisk != null">
|
and is_risk = #{terms.isRisk}
|
</if>
|
<if test="terms.isRiskAi != null">
|
and is_risk_ai = #{terms.isRiskAi}
|
</if>
|
</where>
|
</select>
|
|
<!-- 按条件查询实体分页结果集 -->
|
<select id="pageTerms" resultMap="BaseResultMap">
|
select <include refid="Base_Column_List"/>
|
from <include refid="table-name"/>
|
<where>
|
<if test="terms.aiCaseRiskId != null">
|
and ai_case_risk_id = #{terms.aiCaseRiskId}
|
</if>
|
<if test="terms.caseId != null">
|
and case_id = #{terms.caseId}
|
</if>
|
<if test="terms.isRisk != null">
|
and is_risk = #{terms.isRisk}
|
</if>
|
<if test="terms.isRiskAi != null">
|
and is_risk_ai = #{terms.isRiskAi}
|
</if>
|
</where>
|
<if test="page.sort != null">
|
<foreach collection="page.sort" item="s" index="index" separator="," open="order by ">
|
isnull(${s.property}), ${s.property} ${s.direction}
|
</foreach>
|
</if>
|
<if test="page.sort == null">
|
order by create_time desc
|
</if>
|
limit #{page.offset}, #{page.size}
|
</select>
|
|
<!-- 根据条件查询案件风险评估 -->
|
<select id="findByConditions" resultMap="BaseResultMap">
|
select <include refid="Base_Column_List"/>
|
from <include refid="table-name"/>
|
<where>
|
<if test="risk.caseId != null">
|
and case_id = #{risk.caseId}
|
</if>
|
<if test="risk.source != null">
|
and source = #{risk.source}
|
</if>
|
<if test="risk.sourceName != null">
|
and source_name = #{risk.sourceName}
|
</if>
|
<if test="risk.isRisk != null">
|
and is_risk = #{risk.isRisk}
|
</if>
|
<if test="risk.isRiskAi != null">
|
and is_risk_ai = #{risk.isRiskAi}
|
</if>
|
and delete_status = '1'
|
</where>
|
order by create_time desc
|
</select>
|
</mapper>
|