feat: 添加中介Mapper接口和XML映射
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package com.ruoyi.ccdi.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.ccdi.domain.CcdiBizIntermediary;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 个人中介Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-02-04
|
||||
*/
|
||||
@Mapper
|
||||
public interface CcdiBizIntermediaryMapper extends BaseMapper<CcdiBizIntermediary> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.ruoyi.ccdi.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.ccdi.domain.CcdiEnterpriseBaseInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 实体中介Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-02-04
|
||||
*/
|
||||
@Mapper
|
||||
public interface CcdiEnterpriseBaseInfoMapper extends BaseMapper<CcdiEnterpriseBaseInfo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<?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.ruoyi.ccdi.mapper.CcdiBizIntermediaryMapper">
|
||||
|
||||
<!--
|
||||
统一列表联合查询
|
||||
使用UNION ALL联合查询个人中介和实体中介
|
||||
支持按中介类型、姓名、证件号筛选
|
||||
-->
|
||||
<select id="selectIntermediaryList" resultType="com.ruoyi.ccdi.domain.vo.CcdiIntermediaryVO">
|
||||
<!-- 查询个人中介 -->
|
||||
SELECT
|
||||
biz_id as id,
|
||||
name,
|
||||
person_id as certificate_no,
|
||||
'1' as intermediary_type,
|
||||
person_type,
|
||||
company,
|
||||
data_source,
|
||||
create_time
|
||||
FROM ccdi_biz_intermediary
|
||||
WHERE person_type = '中介'
|
||||
<if test="intermediaryType == null or intermediaryType == '1'">
|
||||
<if test="name != null and name != ''">
|
||||
AND name LIKE CONCAT('%', #{name}, '%')
|
||||
</if>
|
||||
<if test="certificateNo != null and certificateNo != ''">
|
||||
AND person_id = #{certificateNo}
|
||||
</if>
|
||||
</if>
|
||||
|
||||
UNION ALL
|
||||
|
||||
<!-- 查询实体中介 -->
|
||||
SELECT
|
||||
social_credit_code as id,
|
||||
enterprise_name as name,
|
||||
social_credit_code as certificate_no,
|
||||
'2' as intermediary_type,
|
||||
'实体' as person_type,
|
||||
enterprise_name as company,
|
||||
data_source,
|
||||
create_time
|
||||
FROM ccdi_enterprise_base_info
|
||||
WHERE risk_level = '1' AND ent_source = 'INTERMEDIARY'
|
||||
<if test="intermediaryType == null or intermediaryType == '2'">
|
||||
<if test="name != null and name != ''">
|
||||
AND enterprise_name LIKE CONCAT('%', #{name}, '%')
|
||||
</if>
|
||||
<if test="certificateNo != null and certificateNo != ''">
|
||||
AND social_credit_code = #{certificateNo}
|
||||
</if>
|
||||
</if>
|
||||
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user