init
This commit is contained in:
334
ibs/src/main/resources/mapper/list/AnchorMapper.xml
Normal file
334
ibs/src/main/resources/mapper/list/AnchorMapper.xml
Normal file
@@ -0,0 +1,334 @@
|
||||
<?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.ibs.grid.mapper.AnchorMapper">
|
||||
|
||||
<select id="selectAnchorList" resultType="com.ruoyi.ibs.grid.domain.vo.AnchorVo">
|
||||
select
|
||||
a.id as id,
|
||||
a.legal_id as legalId,
|
||||
a.cust_id as custId,
|
||||
a.anchor_name as anchorName,
|
||||
a.belong_business as belongBusiness,
|
||||
a.cust_status as custStatus,
|
||||
a.cust_address_status as custAddressStatus,
|
||||
b.address as address,
|
||||
b.source as source,
|
||||
b.province as province,
|
||||
b.city as city,
|
||||
b.county as county,
|
||||
b.address_name as addressName,
|
||||
b.street as street,
|
||||
b.community as community,
|
||||
b.address_detail as addressDetail,
|
||||
a.status as status,
|
||||
a.anchor_remark as anchorRemark,
|
||||
b.longitude as longitude,
|
||||
b.latitude as latitude
|
||||
from ibs_anchor a
|
||||
left join
|
||||
(select id,
|
||||
source,
|
||||
address,
|
||||
province,
|
||||
city,
|
||||
county,
|
||||
address_name,
|
||||
street,
|
||||
community,
|
||||
address_detail,
|
||||
longitude,
|
||||
latitude
|
||||
from
|
||||
ibs_anchor_address
|
||||
where address_status=1
|
||||
and delete_status = 0) b
|
||||
on a.address_id = b.id
|
||||
where a.delete_status = 0
|
||||
and a.cust_type = #{custType}
|
||||
<if test=" isHead == false">and a.update_org = #{deptId}</if>
|
||||
<if test=" anchorName != null and anchorName != ''">and a.anchor_name like
|
||||
concat('%',concat(#{anchorName},'%'))
|
||||
</if>
|
||||
<if test=" street != null and street != ''">and b.street like concat('%',concat(#{street},'%'))</if>
|
||||
<if test=" community != null and community != ''">and b.community like concat('%',concat(#{community},'%'))
|
||||
</if>
|
||||
<if test=" source != null and source != ''">and b.source like concat('%',concat(#{source},'%'))</if>
|
||||
<if test=" custAddressStatus != null and custAddressStatus != ''">and a.cust_address_status =
|
||||
#{custAddressStatus}
|
||||
</if>
|
||||
<if test=" custStatus != null and custStatus != ''">and a.cust_status = #{custStatus}</if>
|
||||
<if test=" status != null and status != ''">and a.status = #{status}</if>
|
||||
</select>
|
||||
<select id="selectAnchorList_COUNT" resultType="Long">
|
||||
select 999999999
|
||||
</select>
|
||||
<select id="selectAnchorListWithRegion" resultType="com.ruoyi.ibs.grid.domain.vo.AnchorVo">
|
||||
select a.id as id,
|
||||
a.anchor_name as anchorName,
|
||||
a.belong_business as belongBusiness,
|
||||
a.cust_status as cust_status,
|
||||
a.cust_address_status,
|
||||
b.source as source,,
|
||||
b.address_name as addressName,
|
||||
b.street as street,
|
||||
b.community as community,
|
||||
b.address_detail as addressDetail,
|
||||
a.status as status,
|
||||
a.anchor_remark as anchorRemark,
|
||||
b.longitude as longitude,
|
||||
b.latitude as latitude
|
||||
from ibs_anchor a
|
||||
left join
|
||||
(select id, address_name,street,community,address_detail,longitude,latitude,region_code,source
|
||||
from ibs_anchor_address
|
||||
where address_status = 1
|
||||
and delete_status = 0 ) b on a.address_id = b.id
|
||||
left join grid_region_admin_division_relate c on b.region_code = c.code
|
||||
left join grid_region_user_relate d on c.grid_id = d.grid_id
|
||||
where d.user_name = #{userid}
|
||||
and a.delete_status = 0
|
||||
and a.cust_type = #{custType}
|
||||
<if test=" anchorName != null and anchorName != ''">and a.anchor_name like
|
||||
concat('%',concat(#{anchorName},'%'))
|
||||
</if>
|
||||
<if test=" street != null and street != ''">and street like concat('%',concat(#{street},'%'))</if>
|
||||
<if test=" community != null and community != ''">and community like concat('%',concat(#{community},'%'))</if>
|
||||
<if test=" source != null and source != ''">and a.source like concat('%',concat(#{source},'%'))</if>
|
||||
<if test=" custAddressStatus != null and custAddressStatus != ''">and a.cust_address_status =
|
||||
#{custAddressStatus}
|
||||
</if>
|
||||
<if test=" custStatus != null and custStatus != ''">and a.cust_status = #{custStatus}</if>
|
||||
</select>
|
||||
|
||||
<select id="selectAuditList" resultType="com.ruoyi.ibs.grid.domain.vo.AuditVo">
|
||||
select
|
||||
a.id as id,
|
||||
concat(c.nick_name,'-',c.user_name) as nickName,
|
||||
a.update_time as update_time,
|
||||
b.anchor_name as anchorName,
|
||||
b.belong_business as belongBusiness,
|
||||
b.source as source,
|
||||
b.cust_status as custStatus,
|
||||
b.cust_address_status as custAddressStatus,
|
||||
a.type as type,
|
||||
a.address_name as addressName,
|
||||
a.address as address,
|
||||
a.address_now as addressNow,
|
||||
a.province_now as provinceNow,
|
||||
a.city_now as cityNow,
|
||||
a.county_now as countyNow,
|
||||
a.street_now as streetNow,
|
||||
a.community_now as communityNow,
|
||||
a.address_detail_now as addressDetailNow,
|
||||
a.address_remark as addressRemark,
|
||||
a.region_code as region_code
|
||||
from ibs_anchor_address a
|
||||
left join ibs_anchor b on a.anchor_id = b.legal_id
|
||||
left join sys_user c on a.update_by = c.user_name
|
||||
where a.address_status = 0
|
||||
and a.delete_status = 0
|
||||
and b.delete_status = 0
|
||||
and b.cust_type = #{custType}
|
||||
<if test=" isHead == false">and b.update_org = #{deptId}</if>
|
||||
<if test=" custAddressStatus != null and custAddressStatus != ''">and a.cust_address_status =
|
||||
#{custAddressStatus}
|
||||
</if>
|
||||
<if test=" custStatus != null and custStatus != ''">and a.cust_status = #{custStatus}</if>
|
||||
</select>
|
||||
<select id="selectAuditList_COUNT" resultType="Long">
|
||||
select 999999999
|
||||
</select>
|
||||
<select id="selectIgnoreList" resultType="com.ruoyi.ibs.grid.domain.vo.IgnoreVo">
|
||||
select
|
||||
a.id as id,
|
||||
a.update_time as update_time,
|
||||
b.anchor_name as anchorName,
|
||||
b.belong_business as belongBusiness,
|
||||
a.source as source,
|
||||
a.type as type,
|
||||
a.address_name as addressName,
|
||||
a.address_remark as addressRemark,
|
||||
a.address as address,
|
||||
a.address_now as addressNow
|
||||
from ibs_anchor_address a
|
||||
left join ibs_anchor b on a.anchor_id = b.legal_id
|
||||
where a.address_status = 2
|
||||
and a.delete_status = 0
|
||||
and b.delete_status = 0
|
||||
and b.cust_type = #{custType}
|
||||
<if test=" isHead == false">and b.update_org = #{deptId}</if>
|
||||
<if test=" custAddressStatus != null and custAddressStatus != ''">and a.cust_address_status =
|
||||
#{custAddressStatus}
|
||||
</if>
|
||||
<if test=" custStatus != null and custStatus != ''">and a.cust_status = #{custStatus}</if>
|
||||
</select>
|
||||
|
||||
<select id="selectIgnoreList_COUNT" resultType="Long">
|
||||
select 999999999
|
||||
</select>
|
||||
|
||||
<update id="delIgnore">
|
||||
update ibs_anchor_address set delete_status = 1 where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="delAddressByLegalId">
|
||||
update ibs_anchor_address set delete_status = 1 where anchor_id = #{legalId}
|
||||
</update>
|
||||
|
||||
<update id="delAnchorByLegalId">
|
||||
update ibs_anchor set delete_status = 1 where legal_id = #{legalId}
|
||||
</update>
|
||||
<update id="delAnchor">
|
||||
update ibs_anchor set delete_status = 1 where id = #{id}
|
||||
</update>
|
||||
<select id="selectAnchorDetail" resultType="com.ruoyi.ibs.grid.domain.vo.AnchorDetail">
|
||||
select
|
||||
id,
|
||||
legal_id,
|
||||
anchor_name,
|
||||
cust_type,
|
||||
belong_business,
|
||||
anchor_remark
|
||||
from ibs_anchor where id = #{anchorid}
|
||||
</select>
|
||||
|
||||
<select id="selectAnchorAddressList" resultType="com.ruoyi.ibs.grid.domain.vo.AddressDetail">
|
||||
select
|
||||
a.id as id,
|
||||
a.address_name as addressName,
|
||||
a.address as address,
|
||||
a.source as source,
|
||||
a.longitude as longitude,
|
||||
a.latitude as latitude
|
||||
from ibs_anchor_address a
|
||||
left join ibs_anchor b on a.anchor_id = b.legal_id
|
||||
where b.id = #{anchorid}
|
||||
and a.delete_status = 0
|
||||
and a.address_status = 1
|
||||
</select>
|
||||
|
||||
<select id="selectCustAddressList" resultType="com.ruoyi.ibs.grid.domain.vo.AddressDetail">
|
||||
select
|
||||
a.id as id,
|
||||
a.address_name as addressName,
|
||||
a.address as address,
|
||||
a.source as source,
|
||||
a.longitude as longitude,
|
||||
a.latitude as latitude
|
||||
from ibs_anchor_address a
|
||||
left join ibs_anchor b on a.anchor_id = b.legal_id
|
||||
where b.legal_id = #{legalId}
|
||||
and a.delete_status = 0
|
||||
and a.address_status = 1
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectAnchorAddressListByCustId" resultType="com.ruoyi.ibs.grid.domain.vo.AddressDetail">
|
||||
select a.id as id,
|
||||
a.address_name as addressName,
|
||||
a.address as address,
|
||||
a.source as source,
|
||||
a.longitude as longitude,
|
||||
a.latitude as latitude
|
||||
from ibs_anchor_address a
|
||||
left join ibs_anchor b on a.anchor_id = b.legal_id
|
||||
where b.cust_id = #{custId}
|
||||
and a.delete_status = 0
|
||||
and a.address_status = 1
|
||||
</select>
|
||||
|
||||
<update id="reAudit">
|
||||
update ibs_anchor_address set address_status = 0 where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="setIgnore">
|
||||
update ibs_anchor_address set address_status = 2 where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateAnchor">
|
||||
update ibs_anchor
|
||||
set
|
||||
anchor_name = #{anchorName},
|
||||
anchor_remark = #{anchorRemark},
|
||||
belong_business = #{belongBusiness},
|
||||
cust_type = #{custType}
|
||||
where legal_id = #{legalId}
|
||||
</update>
|
||||
|
||||
<update id="updateAnchor2">
|
||||
update ibs_anchor
|
||||
set
|
||||
address_id = #{addressid}
|
||||
where legal_id = #{legalId}
|
||||
</update>
|
||||
|
||||
<select id="selectAddressDetailById" resultType="com.ruoyi.ibs.grid.domain.vo.AddressDetail">
|
||||
select
|
||||
id,
|
||||
address_name,
|
||||
address,
|
||||
source,
|
||||
longitude,
|
||||
latitude
|
||||
from ibs_anchor_address
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectChangeAnchor" resultType="java.lang.String">
|
||||
select
|
||||
a.id as id
|
||||
from ibs_anchor_address a
|
||||
left join ibs_anchor b on a.anchor_id = b.legal_id
|
||||
where a.address_status = 0
|
||||
and a.delete_status = 0
|
||||
and b.delete_status = 0
|
||||
and b.cust_type = #{custType}
|
||||
<if test=" isHead == false ">and a.update_by = #{userid}</if>
|
||||
</select>
|
||||
|
||||
<select id="selectLaLu" resultType="com.ruoyi.ibs.grid.domain.vo.LaLuVo">
|
||||
select b.latitude as lat,b.longitude as lng from ibs_anchor a
|
||||
left join ibs_anchor_address b on a.address_id = b.id
|
||||
where cust_id = #{custId}
|
||||
and a.delete_status = 0
|
||||
</select>
|
||||
|
||||
<select id="selectBusinessCust" resultType="java.lang.String">
|
||||
select id from cust_info_business where social_credit_code = #{legal_id}
|
||||
</select>
|
||||
|
||||
<select id="selectMerchantCust" resultType="java.lang.String">
|
||||
select id from cust_info_merchant where social_credit_code = #{legal_id}
|
||||
</select>
|
||||
|
||||
<select id="selectRetailCust" resultType="java.lang.String">
|
||||
select id from cust_info_retail where cust_idc = #{legal_id}
|
||||
</select>
|
||||
|
||||
<update id="updateAnchorByCust">
|
||||
update ibs_anchor
|
||||
set
|
||||
anchor_name = #{anchorName},
|
||||
belong_business = #{belongBusiness}
|
||||
where legal_id = #{legalId}
|
||||
</update>
|
||||
|
||||
<select id="selectCountCust" resultType="java.lang.Long">
|
||||
select count(*) from ibs_anchor
|
||||
where delete_status = 0
|
||||
and cust_status = 1
|
||||
and cust_type = #{custType}
|
||||
<if test=" isHead == false ">and update_by = #{userid}</if>
|
||||
</select>
|
||||
|
||||
<select id="selectCountCustAddress" resultType="java.lang.Long">
|
||||
select count(*) from ibs_anchor
|
||||
where delete_status = 0
|
||||
and cust_address_status = 1
|
||||
and cust_type = #{custType}
|
||||
<if test=" isHead == false ">and update_by = #{userid}</if>
|
||||
</select>
|
||||
</mapper>
|
||||
373
ibs/src/main/resources/mapper/list/CampaignCountMapper.xml
Normal file
373
ibs/src/main/resources/mapper/list/CampaignCountMapper.xml
Normal file
@@ -0,0 +1,373 @@
|
||||
<?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.ibs.list.mapper.CampaignCountMapper">
|
||||
|
||||
<resultMap type="CampaignCount" id="CampaignCountResult">
|
||||
<result property="dt" column="dt" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="createCampNumYear" column="create_camp_num_year" />
|
||||
<result property="pushCampNumYear" column="push_camp_num_year" />
|
||||
<result property="otherCampNumYear" column="other_camp_num_year" />
|
||||
<result property="createCampNumMonth" column="create_camp_num_month" />
|
||||
<result property="pushCampNumMonth" column="push_camp_num_month" />
|
||||
<result property="otherCampNumMonth" column="other_camp_num_month" />
|
||||
<result property="createCampNumWeek" column="create_camp_num_week" />
|
||||
<result property="pushCampNumWeek" column="push_camp_num_week" />
|
||||
<result property="otherCampNumWeek" column="other_camp_num_week" />
|
||||
<result property="sumType" column="sum_type" />
|
||||
<result property="custType" column="cust_type" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="VisitCampaignCount" id="VisitCampaignCountResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="campaignId" column="campaign_id" />
|
||||
<result property="custNum" column="cust_num" />
|
||||
<result property="pushSuccessNum" column="push_success_num" />
|
||||
<result property="allocateRate" column="allocate_rate" />
|
||||
<result property="issuedNum" column="issued_num" />
|
||||
<result property="claimNum" column="claim_num" />
|
||||
<result property="validVisitNum" column="valid_visit_num" />
|
||||
<result property="visitRate" column="visit_rate" />
|
||||
<result property="loanSignRate" column="loan_sign_rate" />
|
||||
<result property="increaseDepositAmount" column="increase_deposit_amount" />
|
||||
<result property="pushClientId" column="push_client_id" />
|
||||
<result property="custType" column="cust_type" />
|
||||
<result property="dispatchNum" column="dispatch_num" />
|
||||
<result property="userName" column="user_name" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="VisitCampaignComment" id="VisitCampaignCommentResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="campaignId" column="campaign_id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="comment" column="comment" />
|
||||
<result property="outletsId" column="outlets_id" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCampaignCountVo">
|
||||
select dt, dept_id, dept_name, user_id, user_name, create_camp_num_year, push_camp_num_year, other_camp_num_year, create_camp_num_month, push_camp_num_month, other_camp_num_month, create_camp_num_week, push_camp_num_week, other_camp_num_week, sum_type, cust_type from campaign_count
|
||||
</sql>
|
||||
|
||||
<select id="selectCampaignCountList" parameterType="CampaignCount" resultMap="CampaignCountResult">
|
||||
select dt, dept_id, dept_name, user_id, user_name, create_camp_num_year, push_camp_num_year, other_camp_num_year, create_camp_num_month, push_camp_num_month, other_camp_num_month, create_camp_num_week, push_camp_num_week, other_camp_num_week, sum_type, cust_type
|
||||
from campaign_count
|
||||
where 1=1
|
||||
<if test="sumType == 0 or sumType == 1 or sumType == 2 or sumType == 3">
|
||||
and dept_id = concat(left(#{deptId}, 3), '000')
|
||||
</if>
|
||||
<if test="sumType == 5 ">
|
||||
and dept_id = #{deptId}
|
||||
</if>
|
||||
<if test="sumType == -1 ">
|
||||
and dept_id = #{userId}
|
||||
</if>
|
||||
<if test="dt != null and dt != ''"> and dt = #{dt}</if>
|
||||
<if test="custType != null "> and cust_type = #{custType}</if>
|
||||
</select>
|
||||
|
||||
<select id="selectVisitCampaignCountList" parameterType="VisitCampaignCount" resultMap="VisitCampaignCountResult">
|
||||
select vc.id, vc.campaign_id, vc.cust_num, vc.push_success_num, vc.allocate_rate, vc.issued_num, vc.claim_num, vc.valid_visit_num, vc.visit_rate, vc.loan_sign_rate, vc.increase_deposit_amount, vc.push_client_id, vc.cust_type,vc.dispatch_num,vc.visited_num,
|
||||
sc.campaign_name,sc.start_time,sc.end_time,sc.claim_start_time,sc.claim_end_time,sc.claim_type,sc.create_role
|
||||
from visit_campaign_count vc
|
||||
left join sys_campaign sc on vc.campaign_id = sc.campaign_id
|
||||
where vc.dept_type = '0'
|
||||
<if test="campaignId != null and campaignId != ''"> and vc.campaign_id = #{campaignId}</if>
|
||||
<if test="campaignName != null and campaignName != ''"> AND sc.campaign_name like concat('%', #{campaignName}, '%')</if>
|
||||
<if test="startTime != null "> and sc.start_time >= date_format(#{startTime}, '%Y-%m-%d')</if>
|
||||
<if test="endTime != null "> and sc.end_time <= date_format(#{endTime}, '%Y-%m-%d')</if>
|
||||
<if test="deptId != null "> and sc.dept_id = #{deptId}</if>
|
||||
<if test="custType != null "> and vc.cust_type = #{custType}</if>
|
||||
<if test="createRole != null "> and sc.create_role = #{createRole}</if>
|
||||
</select>
|
||||
|
||||
<select id="selectVisitCampaignBranchList" parameterType="VisitCampaignCount" resultMap="VisitCampaignCountResult">
|
||||
select distinct vc.id, vc.campaign_id, vc.cust_num, vc.push_success_num, vc.allocate_rate, vc.issued_num, vc.claim_num, vc.valid_visit_num, vc.visit_rate, vc.loan_sign_rate, vc.increase_deposit_amount, vc.push_client_id, vc.cust_type,vc.dispatch_num,vc.visited_num,
|
||||
sc.campaign_name,sc.start_time,sc.end_time,sc.claim_start_time,sc.claim_end_time,sc.claim_type,sc.create_role,vc.allocate_status as org_distribute_status,
|
||||
vc.dept_id,dep.dept_name,
|
||||
CASE
|
||||
WHEN sc.create_role = '5' THEN '我创建的'
|
||||
ELSE '总行推送的'
|
||||
END AS campsource
|
||||
from visit_campaign_count vc
|
||||
left join sys_campaign sc on vc.campaign_id = sc.campaign_id
|
||||
left join sys_dept dep on vc.dept_id = dep.dept_id
|
||||
left join (
|
||||
select distinct campaign_id,org_distribute_status,dept_id from sys_campaign_group_customer as scgc
|
||||
where ((scgc.push_user_level = 'branch' or (scgc.push_user_level = 'head' and scgc.user_id is null)) or scgc.create_role = '5')
|
||||
<if test="campaignId != null and campaignId != ''"> and scgc.campaign_id = #{campaignId}</if>
|
||||
and scgc.push_status = '1'
|
||||
)scgc2 on scgc2.campaign_id = vc.campaign_id and scgc2.dept_id=vc.dept_id
|
||||
where
|
||||
vc.dept_type = '1'
|
||||
<if test="campaignId != null and campaignId != ''"> and vc.campaign_id = #{campaignId}</if>
|
||||
<if test="campaignName != null and campaignName != ''"> AND sc.campaign_name like concat('%', #{campaignName}, '%')</if>
|
||||
<if test="deptId != null "> and vc.dept_id = #{deptId}</if>
|
||||
<if test="startTime != null "> and sc.start_time >= date_format(#{startTime}, '%Y-%m-%d')</if>
|
||||
<if test="endTime != null "> and sc.end_time <= date_format(#{endTime}, '%Y-%m-%d')</if>
|
||||
<if test="custType != null "> and vc.cust_type = #{custType}</if>
|
||||
<choose>
|
||||
<when test="campsource == '我创建的'">
|
||||
and sc.create_role = '5'
|
||||
</when>
|
||||
<when test="campsource == '总行推送的'">
|
||||
and sc.create_role != '5'
|
||||
</when>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
<select id="selectVisitCampaignCountCheckList" parameterType="VisitCampaignCount" resultMap="VisitCampaignCountResult">
|
||||
select distinct vc.id, vc.campaign_id, vc.cust_num, vc.push_success_num, vc.allocate_rate, vc.issued_num, vc.claim_num, vc.valid_visit_num, vc.visit_rate, vc.loan_sign_rate, vc.increase_deposit_amount, vc.push_client_id, vc.cust_type,vc.dispatch_num,
|
||||
sc.campaign_name,sc.start_time,sc.end_time,sc.claim_start_time,sc.claim_end_time,sc.claim_type,sc.create_role,vc.allocate_status as org_distribute_status,
|
||||
vc.dept_id,
|
||||
case when substr(dep.dept_id,-3) = '000' then ''
|
||||
else dep.dept_name end as dept_name,
|
||||
CASE
|
||||
WHEN sc.create_role = '5' THEN '我创建的'
|
||||
ELSE '总行推送的'
|
||||
END AS campsource
|
||||
from visit_campaign_count vc
|
||||
left join sys_campaign sc on vc.campaign_id = sc.campaign_id
|
||||
left join sys_dept dep on vc.dept_id = dep.dept_id
|
||||
left join (
|
||||
select distinct campaign_id,org_distribute_status,dept_id from sys_campaign_group_customer as scgc
|
||||
where ((scgc.push_user_level = 'branch' or (scgc.push_user_level = 'head' and scgc.user_id is null)) or scgc.create_role = '5')
|
||||
<if test="campaignId != null and campaignId != ''"> and scgc.campaign_id = #{campaignId}</if>
|
||||
and scgc.push_status = '1'
|
||||
)scgc2 on scgc2.campaign_id = vc.campaign_id and scgc2.dept_id=vc.dept_id
|
||||
where
|
||||
vc.dept_type = '1'
|
||||
<if test="campaignId != null and campaignId != ''"> and vc.campaign_id = #{campaignId}</if>
|
||||
<if test="campaignName != null and campaignName != ''"> AND sc.campaign_name like concat('%', #{campaignName}, '%')</if>
|
||||
<if test="startTime != null "> and sc.start_time = #{startTime}</if>
|
||||
<if test="endTime != null "> and sc.end_time = #{endTime}</if>
|
||||
<if test="custType != null "> and vc.cust_type = #{custType}</if>
|
||||
<choose>
|
||||
<when test="campsource == '我创建的'">
|
||||
and sc.create_role = '5'
|
||||
</when>
|
||||
<when test="campsource == '总行推送的'">
|
||||
and sc.create_role != '5'
|
||||
</when>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
<select id="selectOutletList" parameterType="VisitCampaignCount" resultMap="VisitCampaignCountResult">
|
||||
select
|
||||
distinct vc.id,vc.campaign_id,vc.cust_num,vc.push_success_num,vc.allocate_rate,vc.issued_num,vc.claim_num,vc.valid_visit_num,vc.visit_rate,vc.loan_sign_rate,vc.increase_deposit_amount,vc.push_client_id,vc.cust_type,vc.dispatch_num,vc.visited_num,
|
||||
sc.campaign_name,sc.start_time,sc.end_time,sc.claim_start_time,sc.claim_end_time,sc.claim_type,sc.create_role,su.user_name as user_id,
|
||||
|
||||
case
|
||||
when dep2.dept_type = 'head' then dep.dept_id
|
||||
when dep2.dept_type is null then dep.dept_id
|
||||
when dep2.dept_type ='bureau' then dep.dept_id
|
||||
else dep2.dept_id
|
||||
end as dept_id,
|
||||
|
||||
case
|
||||
when dep2.dept_type = 'head' then ''
|
||||
when dep2.dept_type is null then ''
|
||||
when dep2.dept_type ='bureau' then ''
|
||||
else dep.dept_name
|
||||
end as outlets,
|
||||
|
||||
case
|
||||
when dep2.dept_type = 'head' then ''
|
||||
when dep2.dept_type is null then ''
|
||||
when dep2.dept_type ='bureau' then ''
|
||||
else dep.dept_id
|
||||
end as outlets_id,
|
||||
|
||||
case
|
||||
when dep2.dept_type = 'head' then dep.dept_name
|
||||
else dep2.dept_name
|
||||
end as dept_name,
|
||||
|
||||
concat( su.nick_name, '-', su.user_name ) as nick_name,
|
||||
case
|
||||
when sc.create_role = '5' then '支行下发的'
|
||||
else '总行下发的'
|
||||
end as campsource
|
||||
from
|
||||
visit_campaign_count vc left join sys_campaign sc on
|
||||
vc.campaign_id = sc.campaign_id left join sys_user su on
|
||||
vc.dept_id = su.user_name
|
||||
left join sys_dept dep on vc.dept_id = dep.dept_id
|
||||
left join sys_dept dep2 on dep.parent_id = dep2.dept_id
|
||||
where
|
||||
vc.dept_type = '2'
|
||||
<if test="campaignId != null and campaignId != ''"> and vc.campaign_id = #{campaignId}</if>
|
||||
<choose>
|
||||
<when test="deptId != null and deptId.toString().endsWith('000')">
|
||||
AND dep.dept_id = #{deptId}
|
||||
</when>
|
||||
<when test="deptId != null">
|
||||
AND (dep.dept_id = #{deptId} OR dep2.dept_id = #{deptId})
|
||||
</when>
|
||||
</choose>
|
||||
<if test="campaignName != null and campaignName != ''"> AND sc.campaign_name like concat('%', #{campaignName}, '%')</if>
|
||||
<if test="startTime != null "> and sc.start_time >= date_format(#{startTime}, '%Y-%m-%d')</if>
|
||||
<if test="endTime != null "> and sc.end_time <= date_format(#{endTime}, '%Y-%m-%d')</if>
|
||||
<if test="custType != null "> and vc.cust_type = #{custType}</if>
|
||||
<choose>
|
||||
<when test="campsource == '支行下发的'">
|
||||
and sc.create_role = '5'
|
||||
</when>
|
||||
<when test="campsource == '总行下发的'">
|
||||
and sc.create_role != '5'
|
||||
</when>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
<select id="selectPersonList" parameterType="VisitCampaignCount" resultMap="VisitCampaignCountResult">
|
||||
select
|
||||
distinct vc.id,vc.campaign_id,vc.cust_num,vc.push_success_num,vc.allocate_rate,vc.issued_num,vc.claim_num,vc.valid_visit_num,vc.visit_rate,vc.loan_sign_rate,vc.increase_deposit_amount,vc.push_client_id,vc.cust_type,vc.dispatch_num,vc.visited_num,
|
||||
vc.start_time,vc.end_time,sc.claim_type,su.user_name as user_id,
|
||||
case when left(vc.campaign_id,7)='appoint' then '预约任务' else sc.campaign_name end as campaign_name,
|
||||
case when left(vc.campaign_id,7)='appoint' then vc.start_time else sc.claim_start_time end as claim_start_time,
|
||||
case when left(vc.campaign_id,7)='appoint' then vc.end_time else sc.claim_end_time end as claim_end_time,
|
||||
case when left(vc.campaign_id,7)='appoint' then '-1' else sc.create_role end as create_role ,
|
||||
|
||||
case
|
||||
when dep2.dept_type = 'head' then dep.dept_id
|
||||
else dep2.dept_id
|
||||
end as dept_id,
|
||||
case
|
||||
when dep2.dept_type = 'head' then ''
|
||||
else dep.dept_name
|
||||
end as outlets,
|
||||
|
||||
case
|
||||
when dep2.dept_type = 'head' then dep.dept_name
|
||||
else dep2.dept_name
|
||||
end as dept_name,
|
||||
|
||||
concat( su.nick_name, '-', su.user_name ) as nick_name,
|
||||
case
|
||||
when sc.create_role = '5' then '支行下发的'
|
||||
else '总行下发的'
|
||||
end as campsource
|
||||
from
|
||||
visit_campaign_count vc left join sys_campaign sc on
|
||||
vc.campaign_id = sc.campaign_id left join sys_user su on
|
||||
vc.dept_id = su.user_name
|
||||
left join sys_dept dep on su.dept_id = dep.dept_id
|
||||
left join sys_dept dep2 on dep.parent_id = dep2.dept_id
|
||||
where
|
||||
vc.dept_type = '3'
|
||||
<if test="campaignId != null and campaignId != ''"> and vc.campaign_id = #{campaignId}</if>
|
||||
<if test="campaignName != null and campaignName != ''"> AND sc.campaign_name like concat('%', #{campaignName}, '%')</if>
|
||||
<choose>
|
||||
<when test="outletsId != null">
|
||||
AND (dep.dept_id = #{outletsId} OR dep2.dept_id = #{outletsId})
|
||||
</when>
|
||||
<otherwise>
|
||||
<if test="deptId != null and personType == 'branch' and deptId.toString().endsWith('000')">
|
||||
AND dep.dept_id = #{deptId}
|
||||
</if>
|
||||
<if test="deptId != null and personType == 'branch'">
|
||||
AND (dep.dept_id = #{deptId} OR dep2.dept_id = #{deptId})
|
||||
</if>
|
||||
<if test="deptId != null and personType == 'outlet'">
|
||||
AND (dep.dept_id = #{deptId})
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="userId != null " >and vc.dept_id =#{userId} </if>
|
||||
<if test="startTime != null "> and sc.start_time >= date_format(#{startTime}, '%Y-%m-%d')</if>
|
||||
<if test="endTime != null "> and sc.end_time <= date_format(#{endTime}, '%Y-%m-%d')</if>
|
||||
<if test="custType != null "> and vc.cust_type = #{custType}</if>
|
||||
<choose>
|
||||
<when test="campsource == '支行下发的'">
|
||||
and sc.create_role = '5'
|
||||
</when>
|
||||
<when test="campsource == '总行下发的'">
|
||||
and sc.create_role != '5'
|
||||
</when>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
<select id="selectCommentList" parameterType="VisitCampaignComment" resultMap="VisitCampaignCommentResult">
|
||||
select id, campaign_id, dept_id, user_id, nick_name, comment, outlets_id, create_by, create_time, update_by, update_time from visit_campaign_comment
|
||||
<where>
|
||||
<if test="campaignId != null and campaignId != ''"> and campaign_id = #{campaignId}</if>
|
||||
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
|
||||
<if test="comment != null and comment != ''"> and comment = #{comment}</if>
|
||||
<if test="outletsId != null "> and outlets_id = #{outletsId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertVisitCampaignComment" parameterType="VisitCampaignComment" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into visit_campaign_comment
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="campaignId != null">campaign_id,</if>
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="nickName != null">nick_name,</if>
|
||||
<if test="comment != null">comment,</if>
|
||||
<if test="outletsId != null">outlets_id,</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>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="campaignId != null">#{campaignId},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="nickName != null">#{nickName},</if>
|
||||
<if test="comment != null">#{comment},</if>
|
||||
<if test="outletsId != null">#{outletsId},</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>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateCampaignCount" parameterType="CampaignCount">
|
||||
update campaign_count
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="deptName != null">dept_name = #{deptName},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="createCampNumYear != null">create_camp_num_year = #{createCampNumYear},</if>
|
||||
<if test="pushCampNumYear != null">push_camp_num_year = #{pushCampNumYear},</if>
|
||||
<if test="otherCampNumYear != null">other_camp_num_year = #{otherCampNumYear},</if>
|
||||
<if test="createCampNumMonth != null">create_camp_num_month = #{createCampNumMonth},</if>
|
||||
<if test="pushCampNumMonth != null">push_camp_num_month = #{pushCampNumMonth},</if>
|
||||
<if test="otherCampNumMonth != null">other_camp_num_month = #{otherCampNumMonth},</if>
|
||||
<if test="createCampNumWeek != null">create_camp_num_week = #{createCampNumWeek},</if>
|
||||
<if test="pushCampNumWeek != null">push_camp_num_week = #{pushCampNumWeek},</if>
|
||||
<if test="otherCampNumWeek != null">other_camp_num_week = #{otherCampNumWeek},</if>
|
||||
<if test="sumType != null">sum_type = #{sumType},</if>
|
||||
<if test="custType != null">cust_type = #{custType},</if>
|
||||
</trim>
|
||||
where dt = #{dt}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCampaignCountByDt" parameterType="String">
|
||||
delete from campaign_count where dt = #{dt}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCampaignCountByDts" parameterType="String">
|
||||
delete from campaign_count where dt in
|
||||
<foreach item="dt" collection="array" open="(" separator="," close=")">
|
||||
#{dt}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,79 @@
|
||||
<?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.ibs.list.mapper.CorporateShareholderMapper">
|
||||
|
||||
<resultMap type="CorporateShareholder" id="CorporateShareholderResult">
|
||||
<result property="socialCreditCode" column="social_credit_code" />
|
||||
<result property="custType" column="cust_type" />
|
||||
<result property="percent" column="percent" />
|
||||
<result property="name" column="name" />
|
||||
<result property="custIdc" column="cust_idc" />
|
||||
<result property="customerType" column="customer_type" />
|
||||
<result property="perCustType" column="per_cust_type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCorporateShareholderVo">
|
||||
select social_credit_code, cust_type, percent, name, cust_idc, customer_type,per_cust_type from corporate_shareholder
|
||||
</sql>
|
||||
|
||||
<select id="selectCorporateShareholderList" parameterType="CorporateShareholder" resultMap="CorporateShareholderResult">
|
||||
<include refid="selectCorporateShareholderVo"/>
|
||||
<where>
|
||||
<if test="socialCreditCode != null and socialCreditCode != ''"> and social_credit_code = #{socialCreditCode}</if>
|
||||
<if test="custType != null and custType != ''"> and cust_type = #{custType}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="custIdc != null and custIdc != ''"> and cust_idc = #{custIdc}</if>
|
||||
<if test="customerType != null and customerType != ''"> and customer_type = #{customerType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCorporateShareholderBySocialCreditCode" parameterType="String" resultMap="CorporateShareholderResult">
|
||||
<include refid="selectCorporateShareholderVo"/>
|
||||
where social_credit_code = #{socialCreditCode}
|
||||
</select>
|
||||
|
||||
<insert id="insertCorporateShareholder" parameterType="CorporateShareholder">
|
||||
insert into corporate_shareholder
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="socialCreditCode != null">social_credit_code,</if>
|
||||
<if test="custType != null">cust_type,</if>
|
||||
<if test="percent != null">percent,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="custIdc != null">cust_idc,</if>
|
||||
<if test="customerType != null">customer_type,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="socialCreditCode != null">#{socialCreditCode},</if>
|
||||
<if test="custType != null">#{custType},</if>
|
||||
<if test="percent != null">#{percent},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="custIdc != null">#{custIdc},</if>
|
||||
<if test="customerType != null">#{customerType},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCorporateShareholder" parameterType="CorporateShareholder">
|
||||
update corporate_shareholder
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="custType != null">cust_type = #{custType},</if>
|
||||
<if test="percent != null">percent = #{percent},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="custIdc != null">cust_idc = #{custIdc},</if>
|
||||
<if test="customerType != null">customerType = #{customerType},</if>
|
||||
</trim>
|
||||
where social_credit_code = #{socialCreditCode}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCorporateShareholderBySocialCreditCode" parameterType="String">
|
||||
delete from corporate_shareholder where social_credit_code = #{socialCreditCode}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCorporateShareholderBySocialCreditCodes" parameterType="String">
|
||||
delete from corporate_shareholder where social_credit_code in
|
||||
<foreach item="socialCreditCode" collection="array" open="(" separator="," close=")">
|
||||
#{socialCreditCode}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
128
ibs/src/main/resources/mapper/list/CustDeptUserCmpmMapper.xml
Normal file
128
ibs/src/main/resources/mapper/list/CustDeptUserCmpmMapper.xml
Normal file
@@ -0,0 +1,128 @@
|
||||
<?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.ibs.list.mapper.CustDeptUserCmpmMapper">
|
||||
|
||||
<resultMap type="CustDeptUserCmpm" id="CustDeptUserCmpmResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="outlets" column="outlets" />
|
||||
<result property="outletsId" column="outlets_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="custId" column="cust_id" />
|
||||
<result property="custType" column="cust_type" />
|
||||
<result property="custName" column="cust_name" />
|
||||
<result property="custIdc" column="cust_idc" />
|
||||
<result property="codeNoLevel1" column="code_no_level1" />
|
||||
<result property="codeValueLevel1" column="code_value_level1" />
|
||||
<result property="codeNoLevel2" column="code_no_level2" />
|
||||
<result property="codeValueLevel2" column="code_value_level2" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCustDeptUserCmpmVo">
|
||||
select id, dept_id, dept_name, outlets, outlets_id, user_id, user_name, nick_name, cust_id, cust_type, cust_name, cust_idc,
|
||||
code_no_level1, code_value_level1, code_no_level2, code_value_level2
|
||||
from cust_dept_user_cmpm
|
||||
</sql>
|
||||
|
||||
<select id="selectCustDeptUserCmpmList" parameterType="CustDeptUserCmpm" resultMap="CustDeptUserCmpmResult">
|
||||
<include refid="selectCustDeptUserCmpmVo"/>
|
||||
<where>
|
||||
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
||||
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
|
||||
<if test="outlets != null and outlets != ''"> and outlets = #{outlets}</if>
|
||||
<if test="outletsId != null and outletsId != ''"> and outlets_id = #{outletsId}</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
|
||||
<if test="custId != null and custId != ''"> and cust_id = #{custId}</if>
|
||||
<if test="custType != null and custType != ''"> and cust_type = #{custType}</if>
|
||||
<if test="custName != null and custName != ''"> and cust_name like concat('%', #{custName}, '%')</if>
|
||||
<if test="custIdc != null and custIdc != ''"> and cust_idc = #{custIdc}</if>
|
||||
<if test="codeNoLevel1 != null and codeNoLevel1 != ''"> and code_no_level1 = #{codeNoLevel1}</if>
|
||||
<if test="codeValueLevel1 != null "> and code_value_level1 = #{codeValueLevel1}</if>
|
||||
<if test="codeNoLevel2 != null and codeNoLevel2 != ''"> and code_no_level2 = #{codeNoLevel2}</if>
|
||||
<if test="codeValueLevel2 != null "> and code_value_level2 = #{codeValueLevel2}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCustDeptUserCmpmById" parameterType="Long" resultMap="CustDeptUserCmpmResult">
|
||||
<include refid="selectCustDeptUserCmpmVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertCustDeptUserCmpm" parameterType="CustDeptUserCmpm" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into cust_dept_user_cmpm
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="deptName != null">dept_name,</if>
|
||||
<if test="outlets != null">outlets,</if>
|
||||
<if test="outletsId != null">outlets_id,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="userName != null">user_name,</if>
|
||||
<if test="nickName != null">nick_name,</if>
|
||||
<if test="custId != null">cust_id,</if>
|
||||
<if test="custType != null">cust_type,</if>
|
||||
<if test="custName != null">cust_name,</if>
|
||||
<if test="custIdc != null">cust_idc,</if>
|
||||
<if test="codeNoLevel1 != null">code_no_level1,</if>
|
||||
<if test="codeValueLevel1 != null">code_value_level1,</if>
|
||||
<if test="codeNoLevel2 != null">code_no_level2,</if>
|
||||
<if test="codeValueLevel2 != null">code_value_level2,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="deptName != null">#{deptName},</if>
|
||||
<if test="outlets != null">#{outlets},</if>
|
||||
<if test="outletsId != null">#{outletsId},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="userName != null">#{userName},</if>
|
||||
<if test="nickName != null">#{nickName},</if>
|
||||
<if test="custId != null">#{custId},</if>
|
||||
<if test="custType != null">#{custType},</if>
|
||||
<if test="custName != null">#{custName},</if>
|
||||
<if test="custIdc != null">#{custIdc},</if>
|
||||
<if test="codeNoLevel1 != null">#{codeNoLevel1},</if>
|
||||
<if test="codeValueLevel1 != null">#{codeValueLevel1},</if>
|
||||
<if test="codeNoLevel2 != null">#{codeNoLevel2},</if>
|
||||
<if test="codeValueLevel2 != null">#{codeValueLevel2},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCustDeptUserCmpm" parameterType="CustDeptUserCmpm">
|
||||
update cust_dept_user_cmpm
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="deptName != null">dept_name = #{deptName},</if>
|
||||
<if test="outlets != null">outlets = #{outlets},</if>
|
||||
<if test="outletsId != null">outlets_id = #{outletsId},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="nickName != null">nick_name = #{nickName},</if>
|
||||
<if test="custId != null">cust_id = #{custId},</if>
|
||||
<if test="custType != null">cust_type = #{custType},</if>
|
||||
<if test="custName != null">cust_name = #{custName},</if>
|
||||
<if test="custIdc != null">cust_idc = #{custIdc},</if>
|
||||
<if test="codeNoLevel1 != null">code_no_level1 = #{codeNoLevel1},</if>
|
||||
<if test="codeValueLevel1 != null">code_value_level1 = #{codeValueLevel1},</if>
|
||||
<if test="codeNoLevel2 != null">code_no_level2 = #{codeNoLevel2},</if>
|
||||
<if test="codeValueLevel2 != null">code_value_level2 = #{codeValueLevel2},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCustDeptUserCmpmById" parameterType="Long">
|
||||
delete from cust_dept_user_cmpm where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCustDeptUserCmpmByIds" parameterType="String">
|
||||
delete from cust_dept_user_cmpm where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
139
ibs/src/main/resources/mapper/list/CustDeptUserGridMapper.xml
Normal file
139
ibs/src/main/resources/mapper/list/CustDeptUserGridMapper.xml
Normal file
@@ -0,0 +1,139 @@
|
||||
<?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.ibs.list.mapper.CustDeptUserGridMapper">
|
||||
|
||||
<resultMap type="CustDeptUserGrid" id="CustDeptUserGridResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="deptId" column="dept_id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="userName" column="user_name"/>
|
||||
<result property="gridId" column="grid_id"/>
|
||||
<result property="gridName" column="grid_name"/>
|
||||
<result property="custId" column="cust_id"/>
|
||||
<result property="custIdc" column="cust_idc"/>
|
||||
<result property="custName" column="cust_name"/>
|
||||
<result property="custPhone" column="cust_phone"/>
|
||||
<result property="deptName" column="dept_name"/>
|
||||
<result property="gridName2" column="grid_name2"/>
|
||||
<result property="outlets" column="outlets"/>
|
||||
<result property="outletsId" column="outlets_id"/>
|
||||
<result property="tellerId" column="teller_id"/>
|
||||
<result property="opsDept" column="ops_dept"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCustDeptUserGridVo">
|
||||
select id,
|
||||
dept_id,
|
||||
user_id,
|
||||
user_name,
|
||||
grid_id,
|
||||
grid_name,
|
||||
cust_id,
|
||||
cust_idc,
|
||||
cust_name,
|
||||
cust_phone,
|
||||
dept_name,
|
||||
grid_name2,
|
||||
outlets,
|
||||
outlets_id,
|
||||
teller_id,
|
||||
ops_dept
|
||||
from cust_dept_user_grid
|
||||
</sql>
|
||||
|
||||
<select id="selectCustDeptUserGridList" parameterType="CustDeptUserGrid" resultMap="CustDeptUserGridResult">
|
||||
<include refid="selectCustDeptUserGridVo"/>
|
||||
<where>
|
||||
<if test="deptId != null ">and dept_id in
|
||||
(select dept_id from sys_dept where dept_id = #{deptId} or find_in_set(#{deptId},ancestors))</if>
|
||||
<if test="userId != null ">and user_id = #{userId}</if>
|
||||
<if test="userName != null and userName != ''">and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="gridId != null ">and grid_id = #{gridId}</if>
|
||||
<if test="gridName != null and gridName != ''">and grid_name like concat('%', #{gridName}, '%')</if>
|
||||
<if test="custId != null and custId != ''">and cust_id = #{custId}</if>
|
||||
<if test="custIdc != null and custIdc != ''">and cust_idc = #{custIdc}</if>
|
||||
<if test="custName != null and custName != ''">and cust_name like concat('%', #{custName}, '%')</if>
|
||||
<if test="custPhone != null and custPhone != ''">and cust_phone = #{custPhone}</if>
|
||||
<if test="deptName != null and deptName != ''">and dept_name like concat('%', #{deptName}, '%')</if>
|
||||
<if test="gridName2 != null and gridName2 != ''">and grid_name2 like concat('%', #{gridName2}, '%')</if>
|
||||
<if test="outlets != null and outlets != ''">and outlets like concat('%', #{outlets}, '%')</if>
|
||||
<if test="tellerId != null and tellerId != ''">and teller_id = #{tellerId}</if>
|
||||
<if test="opsDept != null and opsDept != ''">and ops_dept = #{opsDept}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCustDeptUserGridById" parameterType="Long" resultMap="CustDeptUserGridResult">
|
||||
<include refid="selectCustDeptUserGridVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertCustDeptUserGrid" parameterType="CustDeptUserGrid" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into cust_dept_user_grid
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="userName != null">user_name,</if>
|
||||
<if test="gridId != null">grid_id,</if>
|
||||
<if test="gridName != null">grid_name,</if>
|
||||
<if test="custId != null">cust_id,</if>
|
||||
<if test="custIdc != null">cust_idc,</if>
|
||||
<if test="custName != null">cust_name,</if>
|
||||
<if test="custPhone != null">cust_phone,</if>
|
||||
<if test="deptName != null">dept_name,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="userName != null">#{userName},</if>
|
||||
<if test="gridId != null">#{gridId},</if>
|
||||
<if test="gridName != null">#{gridName},</if>
|
||||
<if test="custId != null">#{custId},</if>
|
||||
<if test="custIdc != null">#{custIdc},</if>
|
||||
<if test="custName != null">#{custName},</if>
|
||||
<if test="custPhone != null">#{custPhone},</if>
|
||||
<if test="deptName != null">#{deptName},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCustDeptUserGrid" parameterType="CustDeptUserGrid">
|
||||
update cust_dept_user_grid
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="gridId != null">grid_id = #{gridId},</if>
|
||||
<if test="gridName != null">grid_name = #{gridName},</if>
|
||||
<if test="custId != null">cust_id = #{custId},</if>
|
||||
<if test="custIdc != null">cust_idc = #{custIdc},</if>
|
||||
<if test="custName != null">cust_name = #{custName},</if>
|
||||
<if test="custPhone != null">cust_phone = #{custPhone},</if>
|
||||
<if test="deptName != null">dept_name = #{deptName},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCustDeptUserGridById" parameterType="Long">
|
||||
delete
|
||||
from cust_dept_user_grid
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCustDeptUserGridByIds" parameterType="String">
|
||||
delete from cust_dept_user_grid where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
<select id="selectCustDeptUserGridListByCustIds" parameterType="String" resultMap="CustDeptUserGridResult">
|
||||
<include refid="selectCustDeptUserGridVo"/>
|
||||
where cust_id in
|
||||
<foreach item="id" collection="custIds" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
810
ibs/src/main/resources/mapper/list/CustInfoMerchantMapper.xml
Normal file
810
ibs/src/main/resources/mapper/list/CustInfoMerchantMapper.xml
Normal file
@@ -0,0 +1,810 @@
|
||||
<?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.ibs.list.mapper.CustInfoMerchantMapper">
|
||||
|
||||
<resultMap type="CustInfoMerchant" id="CustInfoMerchantResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="custType" column="cust_type" />
|
||||
<result property="custTag" column="cust_tag" />
|
||||
<result property="custScale" column="cust_scale" />
|
||||
<result property="custName" column="cust_name" />
|
||||
<result property="lpName" column="lp_name" />
|
||||
<result property="custPhone" column="cust_phone" />
|
||||
<result property="custId" column="cust_id" />
|
||||
<result property="custIsn" column="cust_isn" />
|
||||
<result property="custCapital" column="cust_capital" />
|
||||
<result property="custLocation" column="cust_location" />
|
||||
<result property="loanTag" column="loan_tag" />
|
||||
<result property="status" column="status" />
|
||||
<result property="belongBranchId" column="belong_branch_id" />
|
||||
<result property="belongBranchName" column="belong_branch_name" />
|
||||
<result property="belongOutletId" column="belong_outlet_id" />
|
||||
<result property="belongOutletName" column="belong_outlet_name" />
|
||||
<result property="belongUserId" column="belong_user_id" />
|
||||
<result property="belongUserName" column="belong_user_name" />
|
||||
<result property="belongUserNameList" column="belong_user_name_list" />
|
||||
<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="regionCode" column="region_code" />
|
||||
<result property="socialCreditCode" column="social_credit_code" />
|
||||
<result property="tel" column="tel" />
|
||||
<result property="registerLocation" column="register_location" />
|
||||
<result property="businessScope" column="business_scope" />
|
||||
<result property="taxpayerIdentificationNumber" column="taxpayer_identification_number" />
|
||||
<result property="taxpayerQualification" column="taxpayer_qualification" />
|
||||
<result property="label" column="label" />
|
||||
<result property="industry" column="industry" />
|
||||
<result property="custIdc" column="cust_idc" />
|
||||
<result property="birthday" column="birthday" />
|
||||
<result property="custAge" column="cust_age" />
|
||||
<result property="custGender" column="cust_gender" />
|
||||
<result property="recordStatus" column="record_status" />
|
||||
<result property="asset" column="asset" />
|
||||
<result property="credit" column="credit" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="CustInfoMerchant" id="CustInfoMerchantResult2">
|
||||
<result property="id" column="id" />
|
||||
<result property="custType" column="cust_type" />
|
||||
<result property="custTag" column="cust_tag" />
|
||||
<result property="custScale" column="cust_scale" />
|
||||
<result property="custName" column="cust_name" />
|
||||
<result property="lpName" column="lp_name" />
|
||||
<result property="custPhone" column="cust_phone" />
|
||||
<result property="custId" column="cust_id" />
|
||||
<result property="custIsn" column="cust_isn" />
|
||||
<result property="custCapital" column="cust_capital" />
|
||||
<result property="custLocation" column="cust_location" />
|
||||
<result property="loanTag" column="loan_tag" />
|
||||
<result property="status" column="status" />
|
||||
<result property="belongBranchId" column="belong_branch_id" />
|
||||
<result property="belongBranchName" column="dept_name" />
|
||||
<result property="belongOutletId" column="belong_outlet_id" />
|
||||
<result property="belongOutletName" column="outlets" />
|
||||
<result property="belongUserId" column="belong_user_id" />
|
||||
<result property="belongUserName" column="belong_user_name" />
|
||||
<result property="belongUserNameList" column="belong_user_name_list" />
|
||||
<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="regionCode" column="region_code" />
|
||||
<result property="socialCreditCode" column="social_credit_code" />
|
||||
<result property="tel" column="tel" />
|
||||
<result property="registerLocation" column="register_location" />
|
||||
<result property="businessScope" column="business_scope" />
|
||||
<result property="taxpayerIdentificationNumber" column="taxpayer_identification_number" />
|
||||
<result property="taxpayerQualification" column="taxpayer_qualification" />
|
||||
<result property="label" column="label" />
|
||||
<result property="industry" column="industry" />
|
||||
<result property="custIdc" column="cust_idc" />
|
||||
<result property="birthday" column="birthday" />
|
||||
<result property="custAge" column="cust_age" />
|
||||
<result property="custGender" column="cust_gender" />
|
||||
<result property="actualController" column="actual_controller" />
|
||||
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="CustManageInfo" id="CustManageInfoResult">
|
||||
<result property="custId" column="cust_id" />
|
||||
<result property="custName" column="cust_name" />
|
||||
<result property="custNo" column="social_credit_code" />
|
||||
<result property="belongUserId" column="user_name" />
|
||||
<result property="belongUserName" column="nick_name" />
|
||||
<result property="custPattern" column="cust_type" />
|
||||
<result property="regionCode" column="region_code" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCustInfoMerchantVo">
|
||||
select id, cust_type, cust_tag, cust_scale, cust_name, lp_name, cust_phone, cust_id, cust_isn, cust_capital, cust_location, loan_tag, status, belong_branch_id, belong_branch_name, belong_outlet_id, belong_outlet_name, belong_user_id, belong_user_name, create_by, create_time, update_by, update_time, region_code, social_credit_code, tel, register_location, business_scope, taxpayer_identification_number, taxpayer_qualification,
|
||||
label, industry, cust_idc, birthday,cust_age,cust_gender,record_status from cust_info_merchant
|
||||
</sql>
|
||||
|
||||
<select id="selectCustInfoMerchantList" parameterType="CustInfoMerchant" resultMap="CustInfoMerchantResult">
|
||||
<include refid="selectCustInfoMerchantVo"/>
|
||||
<where>
|
||||
<if test="custType != null and custType != ''"> and cust_type = #{custType}</if>
|
||||
<if test="custTag != null and custTag != ''"> and cust_tag = #{custTag}</if>
|
||||
<if test="custScale != null and custScale != ''"> and cust_scale = #{custScale}</if>
|
||||
<if test="custName != null and custName != ''"> and cust_name like concat('%', #{custName}, '%')</if>
|
||||
<if test="lpName != null and lpName != ''"> and lp_name like concat('%', #{lpName}, '%')</if>
|
||||
<if test="custPhone != null and custPhone != ''"> and cust_phone = #{custPhone}</if>
|
||||
<if test="custId != null and custId != ''"> and cust_id = #{custId}</if>
|
||||
<if test="custIsn != null and custIsn != ''"> and cust_isn = #{custIsn}</if>
|
||||
<if test="custCapital != null and custCapital != ''"> and cust_capital = #{custCapital}</if>
|
||||
<if test="custLocation != null and custLocation != ''"> and cust_location = #{custLocation}</if>
|
||||
<if test="loanTag != null and loanTag != ''"> and loan_tag = #{loanTag}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="belongBranchId != null and belongBranchId != ''"> and belong_branch_id = #{belongBranchId}</if>
|
||||
<if test="belongBranchName != null and belongBranchName != ''"> and belong_branch_name like concat('%', #{belongBranchName}, '%')</if>
|
||||
<if test="belongOutletId != null and belongOutletId != ''"> and belong_outlet_id = #{belongOutletId}</if>
|
||||
<if test="belongOutletName != null and belongOutletName != ''"> and belong_outlet_name like concat('%', #{belongOutletName}, '%')</if>
|
||||
<if test="belongUserId != null and belongUserId != ''"> and belong_user_id = #{belongUserId}</if>
|
||||
<if test="belongUserName != null and belongUserName != ''"> and belong_user_name like concat('%', #{belongUserName}, '%')</if>
|
||||
<if test="regionCode != null and regionCode != ''"> and region_code = #{regionCode}</if>
|
||||
<if test="socialCreditCode != null and socialCreditCode != ''"> and social_credit_code = #{socialCreditCode}</if>
|
||||
<if test="tel != null and tel != ''"> and tel = #{tel}</if>
|
||||
<if test="registerLocation != null and registerLocation != ''"> and register_location = #{registerLocation}</if>
|
||||
<if test="businessScope != null and businessScope != ''"> and business_scope = #{businessScope}</if>
|
||||
<if test="taxpayerIdentificationNumber != null and taxpayerIdentificationNumber != ''"> and taxpayer_identification_number = #{taxpayerIdentificationNumber}</if>
|
||||
<if test="taxpayerQualification != null and taxpayerQualification != ''"> and taxpayer_qualification = #{taxpayerQualification}</if>
|
||||
<if test="label != null and label != ''"> and label = #{label}</if>
|
||||
<if test="industry != null and industry != ''"> and industry = #{industry}</if>
|
||||
<if test="custIdc != null and custIdc != ''"> and cust_idc = #{custIdc}</if>
|
||||
<if test="birthday != null "> and birthday = #{birthday}</if>
|
||||
<if test="custAge != null and custAge != ''"> and cust_age = #{custAge}</if>
|
||||
<if test="custGender != null and custGender != ''"> and cust_gender = #{custGender}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCustInfoMerchantListByKeyword" parameterType="String" resultMap="CustInfoMerchantResult">
|
||||
<include refid="selectCustInfoMerchantVo"/>
|
||||
<where>
|
||||
<if test="keyword != null and keyword != ''"> and ( cust_idc like concat('%', #{keyword}, '%') or cust_name like concat('%', #{keyword}, '%')
|
||||
or cust_phone like concat('%', #{keyword}, '%') or lp_name like concat('%', #{keyword}, '%') )
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCustInfoMerchantListByKeywordBranchAndManager" parameterType="String" resultMap="CustInfoMerchantResult">
|
||||
select distinct a.id, a.cust_name, a.lp_name, a.cust_id, a.social_credit_code,a.cust_phone,a.tel ,a.cust_idc
|
||||
from cust_info_merchant a
|
||||
inner join
|
||||
(select user_id,dept_id,outlets_id,cust_id from cust_dept_user_grid
|
||||
<where>
|
||||
<if test="deptId != null and deptId != ''">
|
||||
and dept_id in (select dept_id from sys_dept where dept_id = #{deptId} or find_in_set(#{deptId},ancestors))
|
||||
</if>
|
||||
<if test="outletsId != null and outletsId != ''">
|
||||
and outlets_id in (select dept_id from sys_dept where dept_id = #{outletsId} or find_in_set(#{outletsId},ancestors))
|
||||
</if>
|
||||
<if test="userId != null and userId != ''">
|
||||
and user_id = #{userId}
|
||||
</if>
|
||||
<if test="opsDept != null and opsDept != ''">
|
||||
and ops_dept = #{opsDept}
|
||||
</if>
|
||||
</where>
|
||||
union all
|
||||
(select t2.user_id,t2.dept_id,t2.outlets_id,t2.cust_id from cust_dept_user_cmpm t2
|
||||
<where>
|
||||
and t2.cust_type = '1'
|
||||
<if test="deptId != null and deptId != ''">
|
||||
and t2.dept_id in (select dept_id from sys_dept where dept_id = #{deptId} or find_in_set(#{deptId},ancestors))
|
||||
</if>
|
||||
<if test="outletsId != null and outletsId != ''">
|
||||
and t2.outlets_id in (select dept_id from sys_dept where dept_id = #{outletsId} or find_in_set(#{outletsId},ancestors))
|
||||
</if>
|
||||
<if test="userId != null and userId != ''">
|
||||
and t2.user_id = #{userId}
|
||||
</if>
|
||||
</where>
|
||||
)) b
|
||||
on a.cust_id = b.cust_id
|
||||
<where>
|
||||
<if test="keyword != null and keyword != ''"> and ( a.cust_idc like concat('%', #{keyword}, '%') or a.cust_name like concat('%', #{keyword}, '%')
|
||||
or a.cust_phone like concat('%', #{keyword}, '%') or a.lp_name like concat('%', #{keyword}, '%'))
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectCustInfoMerchantById" parameterType="Long" resultMap="CustInfoMerchantResult">
|
||||
<include refid="selectCustInfoMerchantVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertCustInfoMerchant" parameterType="CustInfoMerchant" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into cust_info_merchant
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="custType != null">cust_type,</if>
|
||||
<if test="custTag != null">cust_tag,</if>
|
||||
<if test="custScale != null">cust_scale,</if>
|
||||
<if test="custName != null">cust_name,</if>
|
||||
<if test="lpName != null">lp_name,</if>
|
||||
<if test="custPhone != null">cust_phone,</if>
|
||||
<if test="custId != null">cust_id,</if>
|
||||
<if test="custIsn != null">cust_isn,</if>
|
||||
<if test="custCapital != null">cust_capital,</if>
|
||||
<if test="custLocation != null">cust_location,</if>
|
||||
<if test="loanTag != null">loan_tag,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="belongBranchId != null">belong_branch_id,</if>
|
||||
<if test="belongBranchName != null">belong_branch_name,</if>
|
||||
<if test="belongOutletId != null">belong_outlet_id,</if>
|
||||
<if test="belongOutletName != null">belong_outlet_name,</if>
|
||||
<if test="belongUserId != null">belong_user_id,</if>
|
||||
<if test="belongUserName != null">belong_user_name,</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="regionCode != null">region_code,</if>
|
||||
<if test="socialCreditCode != null">social_credit_code,</if>
|
||||
<if test="tel != null">tel,</if>
|
||||
<if test="registerLocation != null">register_location,</if>
|
||||
<if test="businessScope != null">business_scope,</if>
|
||||
<if test="taxpayerIdentificationNumber != null">taxpayer_identification_number,</if>
|
||||
<if test="taxpayerQualification != null">taxpayer_qualification,</if>
|
||||
<if test="label != null">label,</if>
|
||||
<if test="industry != null">industry,</if>
|
||||
<if test="custIdc != null">cust_idc,</if>
|
||||
<if test="birthday != null">birthday,</if>
|
||||
<if test="custAge != null">cust_age,</if>
|
||||
<if test="custGender != null">cust_gender,</if>
|
||||
<if test="recordStatus != null "> record_status ,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="custType != null">#{custType},</if>
|
||||
<if test="custTag != null">#{custTag},</if>
|
||||
<if test="custScale != null">#{custScale},</if>
|
||||
<if test="custName != null">#{custName},</if>
|
||||
<if test="lpName != null">#{lpName},</if>
|
||||
<if test="custPhone != null">#{custPhone},</if>
|
||||
<if test="custId != null">#{custId},</if>
|
||||
<if test="custIsn != null">#{custIsn},</if>
|
||||
<if test="custCapital != null">#{custCapital},</if>
|
||||
<if test="custLocation != null">#{custLocation},</if>
|
||||
<if test="loanTag != null">#{loanTag},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="belongBranchId != null">#{belongBranchId},</if>
|
||||
<if test="belongBranchName != null">#{belongBranchName},</if>
|
||||
<if test="belongOutletId != null">#{belongOutletId},</if>
|
||||
<if test="belongOutletName != null">#{belongOutletName},</if>
|
||||
<if test="belongUserId != null">#{belongUserId},</if>
|
||||
<if test="belongUserName != null">#{belongUserName},</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="regionCode != null">#{regionCode},</if>
|
||||
<if test="socialCreditCode != null">#{socialCreditCode},</if>
|
||||
<if test="tel != null">#{tel},</if>
|
||||
<if test="registerLocation != null">#{registerLocation},</if>
|
||||
<if test="businessScope != null">#{businessScope},</if>
|
||||
<if test="taxpayerIdentificationNumber != null">#{taxpayerIdentificationNumber},</if>
|
||||
<if test="taxpayerQualification != null">#{taxpayerQualification},</if>
|
||||
<if test="label != null">#{label},</if>
|
||||
<if test="industry != null">#{industry},</if>
|
||||
<if test="custIdc != null">#{custIdc},</if>
|
||||
<if test="birthday != null">#{birthday},</if>
|
||||
<if test="custAge != null">#{custAge},</if>
|
||||
<if test="custGender != null">#{custGender},</if>
|
||||
<if test="recordStatus != null"> #{recordStatus}</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCustInfoMerchant" parameterType="CustInfoMerchant">
|
||||
update cust_info_merchant
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="custType != null">cust_type = #{custType},</if>
|
||||
<if test="custTag != null">cust_tag = #{custTag},</if>
|
||||
<if test="custScale != null">cust_scale = #{custScale},</if>
|
||||
<if test="custName != null">cust_name = #{custName},</if>
|
||||
<if test="lpName != null">lp_name = #{lpName},</if>
|
||||
<if test="custPhone != null">cust_phone = #{custPhone},</if>
|
||||
<if test="custId != null">cust_id = #{custId},</if>
|
||||
<if test="custIsn != null">cust_isn = #{custIsn},</if>
|
||||
<if test="custCapital != null">cust_capital = #{custCapital},</if>
|
||||
<if test="custLocation != null">cust_location = #{custLocation},</if>
|
||||
<if test="loanTag != null">loan_tag = #{loanTag},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="belongBranchId != null">belong_branch_id = #{belongBranchId},</if>
|
||||
<if test="belongBranchName != null">belong_branch_name = #{belongBranchName},</if>
|
||||
<if test="belongOutletId != null">belong_outlet_id = #{belongOutletId},</if>
|
||||
<if test="belongOutletName != null">belong_outlet_name = #{belongOutletName},</if>
|
||||
<if test="belongUserId != null">belong_user_id = #{belongUserId},</if>
|
||||
<if test="belongUserName != null">belong_user_name = #{belongUserName},</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="regionCode != null">region_code = #{regionCode},</if>
|
||||
<if test="socialCreditCode != null">social_credit_code = #{socialCreditCode},</if>
|
||||
<if test="tel != null">tel = #{tel},</if>
|
||||
<if test="registerLocation != null">register_location = #{registerLocation},</if>
|
||||
<if test="businessScope != null">business_scope = #{businessScope},</if>
|
||||
<if test="taxpayerIdentificationNumber != null">taxpayer_identification_number = #{taxpayerIdentificationNumber},</if>
|
||||
<if test="taxpayerQualification != null">taxpayer_qualification = #{taxpayerQualification},</if>
|
||||
<if test="label != null">label = #{label},</if>
|
||||
<if test="industry != null">industry = #{industry},</if>
|
||||
<if test="custIdc != null">cust_idc = #{custIdc},</if>
|
||||
<if test="birthday != null">birthday = #{birthday},</if>
|
||||
<if test="custAge != null">cust_age = #{custAge},</if>
|
||||
<if test="custGender != null">cust_gender = #{custGender},</if>
|
||||
<if test="recordStatus != null and recordStatus != ''"> record_status = #{recordStatus},</if>
|
||||
<if test="actualController != null">actual_controller = #{actualController},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateCustInfoMerchantLabel" parameterType="CustInfoMerchant">
|
||||
update cust_info_merchant
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="custType != null and custType != ''">cust_type = #{custType},</if>
|
||||
<if test="custTag != null and custTag != ''">cust_tag = #{custTag},</if>
|
||||
<if test="custScale != null and custScale != ''">cust_scale = #{custScale},</if>
|
||||
<if test="custName != null and custName != ''">cust_name = #{custName},</if>
|
||||
<if test="lpName != null and lpName != ''">lp_name = #{lpName},</if>
|
||||
<if test="custPhone != null and custPhone != ''">cust_phone = #{custPhone},</if>
|
||||
<if test="custId != null and custId != ''">cust_id = #{custId},</if>
|
||||
<if test="custIsn != null and custIsn != ''">cust_isn = #{custIsn},</if>
|
||||
<if test="custCapital != null and custCapital != ''">cust_capital = #{custCapital},</if>
|
||||
<if test="custLocation != null and custLocation != ''">cust_location = #{custLocation},</if>
|
||||
<if test="loanTag != null and loanTag != ''">loan_tag = #{loanTag},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="belongBranchId != null and belongBranchId != ''">belong_branch_id = #{belongBranchId},</if>
|
||||
<if test="belongBranchName != null and belongBranchName != ''">belong_branch_name = #{belongBranchName},</if>
|
||||
<if test="belongOutletId != null and belongOutletId != ''">belong_outlet_id = #{belongOutletId},</if>
|
||||
<if test="belongOutletName != null and belongOutletName != ''">belong_outlet_name = #{belongOutletName},</if>
|
||||
<if test="belongUserId != null and belongUserId != ''">belong_user_id = #{belongUserId},</if>
|
||||
<if test="belongUserName != null and belongUserName != ''">belong_user_name = #{belongUserName},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="regionCode != null and regionCode != ''">region_code = #{regionCode},</if>
|
||||
<if test="socialCreditCode != null and socialCreditCode != ''">social_credit_code = #{socialCreditCode},</if>
|
||||
<if test="tel != null and tel != ''">tel = #{tel},</if>
|
||||
<if test="registerLocation != null and registerLocation != ''">register_location = #{registerLocation},</if>
|
||||
<if test="businessScope != null and businessScope != ''">business_scope = #{businessScope},</if>
|
||||
<if test="taxpayerIdentificationNumber != null and taxpayerIdentificationNumber != ''">taxpayer_identification_number = #{taxpayerIdentificationNumber},</if>
|
||||
<if test="taxpayerQualification != null and taxpayerQualification != ''">taxpayer_qualification = #{taxpayerQualification},</if>
|
||||
<if test="label != null and label != ''">label = #{label},</if>
|
||||
<if test="industry != null and industry != ''">industry = #{industry},</if>
|
||||
<if test="custIdc != null and custIdc != ''">cust_idc = #{custIdc},</if>
|
||||
<if test="custAge != null and custAge != ''">cust_age = #{custAge},</if>
|
||||
<if test="custGender != null and custGender != ''">cust_gender = #{custGender},</if>
|
||||
<if test="recordStatus != null and recordStatus != ''"> record_status = #{recordStatus},</if>
|
||||
<if test="birthday != null ">birthday = #{birthday},</if>
|
||||
<if test="actualController != null and actualController != ''">actual_controller = #{actualController},</if>
|
||||
</trim>
|
||||
where cust_id = #{custId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCustInfoMerchantById" parameterType="Long">
|
||||
delete from cust_info_merchant where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCustInfoMerchantByIds" parameterType="String">
|
||||
delete from cust_info_merchant where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectCustInfoMerchantByCustId" parameterType="String" resultMap="CustInfoMerchantResult">
|
||||
select * from cust_info_merchant
|
||||
where cust_id = #{custId}
|
||||
</select>
|
||||
|
||||
<select id="selectCustInfoMerchantBySocialCreditCode" parameterType="String" resultMap="CustInfoMerchantResult">
|
||||
select * from cust_info_merchant
|
||||
where social_credit_code = #{socialCreditCode}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="selectMyCustInfoMerchantList" parameterType="CustInfoBusiness" resultMap="CustInfoMerchantResult2">
|
||||
SELECT a.id, a.cust_type, a.cust_tag, a.cust_scale, a.cust_name, a.lp_name,
|
||||
a.cust_phone, a.cust_id, a.cust_isn,
|
||||
GROUP_CONCAT(b.dept_name SEPARATOR ',') as dept_name,
|
||||
GROUP_CONCAT(b.outlets SEPARATOR ',') as outlets,
|
||||
a.cust_idc,
|
||||
GROUP_CONCAT(b.user_name SEPARATOR ',') as belong_user_name_list
|
||||
from cust_info_merchant a
|
||||
<if test="opsDept != null and opsDept != ''">
|
||||
inner </if>
|
||||
<if test="opsDept == null or opsDept == ''">
|
||||
left </if> join
|
||||
(select user_name,user_id,dept_id,cust_id,dept_name,outlets from
|
||||
(select concat_ws('-',user_name,teller_id) as user_name,user_id,dept_id,cust_id,dept_name,outlets from cust_dept_user_grid
|
||||
<where>
|
||||
<if test="opsDept != null and opsDept != ''">
|
||||
ops_dept = #{opsDept}</if>
|
||||
</where>
|
||||
union
|
||||
(select '', t2.user_id,t2.dept_id,t2.cust_id,'','' from cust_dept_user_cmpm t2
|
||||
left join (select cust_id from cust_dept_user_grid
|
||||
<where>
|
||||
<if test="opsDept != null and opsDept != ''">
|
||||
ops_dept = #{opsDept}</if>
|
||||
</where>
|
||||
group by cust_id)t1 on t2.cust_id = t1.cust_id
|
||||
where (t1.cust_id is null or t1.cust_id = '') and t2.cust_type = '1' and t2.dept_id is not null)) f
|
||||
where 1=1
|
||||
<if test = "isHead == false">
|
||||
${params.dataScope}
|
||||
</if>
|
||||
) b on a.cust_id = b.cust_id
|
||||
<where>
|
||||
<if test = "isHead == false">
|
||||
b.user_id>0
|
||||
</if>
|
||||
<if test="custTag != null and custTag != ''"> and
|
||||
((CASE WHEN substr(#{custTag}, 1, 1) = '1' THEN substr(a.cust_tag, 1, 1) = '1' end)
|
||||
OR (CASE WHEN substr(#{custTag}, 2, 1) = '1' THEN substr(a.cust_tag, 2, 1) = '1' end)
|
||||
OR (CASE WHEN substr(#{custTag}, 3, 1) = '1' THEN substr(a.cust_tag, 3, 1) = '1' end))
|
||||
</if>
|
||||
<if test="custName != null and custName != ''"> and a.cust_name like concat('%', #{custName}, '%') </if>
|
||||
<if test="custType != null and custType != ''"> and a.cust_type = #{custType}</if>
|
||||
</where>
|
||||
group by a.cust_id,a.id
|
||||
limit #{start},#{size}
|
||||
</select>
|
||||
|
||||
<select id="selectMyCustInfoMerchantListHead" parameterType="CustInfoBusiness" resultType="com.ruoyi.ibs.customerselect.domain.CustBaseInfo">
|
||||
SELECT a.id, a.cust_type, a.cust_tag, a.cust_scale, a.cust_name, a.lp_name,
|
||||
a.cust_phone, a.cust_id, a.cust_isn,a.asset,a.credit,
|
||||
a.cust_idc,
|
||||
a.cust_type,a.cur_bal_d, a.cur_bal_t, a.bal_loan, a.cur_bal_5_bad, a.cur_d_ave,
|
||||
a.cur_t_ave, a.loan_ave, is_ph, a.is_sx, a.is_yxht, a.is_xyk, a.fshl, a.is_sd, a.etc, a.dian, a.is_black, a.is_bad,
|
||||
a.is_365zf,a.is_180zf,a.is_90zf,a.is_30zf, a.cust_level
|
||||
from cust_info_merchant a
|
||||
<where>
|
||||
<if test="regionTopGridIds != null and regionTopGridIds.size() > 0 ">
|
||||
AND a.cust_id IN (
|
||||
SELECT cust_id
|
||||
FROM grid_region_cust_user grcu
|
||||
<where>
|
||||
<if test="regionTopGridIds != null and regionTopGridIds.size()>0">
|
||||
<foreach collection="regionTopGridIds" item="param" separator="or">
|
||||
grcu.top_grid_id = #{param.value}
|
||||
</foreach>
|
||||
</if>
|
||||
)
|
||||
</where>
|
||||
</if>
|
||||
<if test="regionSecGridIds != null and regionSecGridIds.size()>0">
|
||||
AND a.cust_id IN (
|
||||
SELECT cust_id
|
||||
FROM grid_region_cust_user grcu
|
||||
<where>
|
||||
<foreach collection="regionSecGridIds" item="param" separator="or">
|
||||
grcu.sec_grid_id = #{param.value}
|
||||
</foreach>
|
||||
</where>
|
||||
)
|
||||
</if>
|
||||
<if test="virtualGridIds != null and virtualGridIds.size() > 0 ">
|
||||
AND a.cust_id IN (
|
||||
SELECT cust_id
|
||||
FROM grid_virtual_cust_user gvcu
|
||||
<where>
|
||||
<foreach collection="virtualGridIds" item="param" separator="or">
|
||||
gvcu.grid_id = #{param.value}
|
||||
</foreach>
|
||||
</where>
|
||||
)
|
||||
</if>
|
||||
<if test="drawGridIds != null and drawGridIds.size() > 0 ">
|
||||
AND a.cust_id IN (
|
||||
SELECT dsc.cust_id
|
||||
FROM grid_draw_user_relate gdur
|
||||
INNER JOIN grid_draw_shape_relate gdsr ON gdur.grid_id = gdsr.grid_id
|
||||
INNER JOIN draw_shape_cust dsc ON gdsr.shape_id = dsc.shape_id
|
||||
<where>
|
||||
<foreach collection="drawGridIds" item="param" separator="or">
|
||||
gdur.grid_id = #{param.value}
|
||||
</foreach>
|
||||
</where>
|
||||
)
|
||||
</if>
|
||||
<if test="continuousParams != null and continuousParams.size() > 0 or discreteParams != null and discreteParams.size() > 0">
|
||||
<if test="continuousParams != null and continuousParams.size() > 0">
|
||||
and
|
||||
<foreach collection="continuousParams" item="param" separator="and">
|
||||
<choose>
|
||||
<when test="param.value[0] != null and param.value[0] != '' and param.value[1] != null and param.value[1] != ''">
|
||||
CAST(${param.key} AS DECIMAL(10,2)) BETWEEN CAST(#{param.value[0]} AS DECIMAL(10,2)) AND CAST(#{param.value[1]} AS DECIMAL(10,2))
|
||||
</when>
|
||||
<when test="param.value[0] != null and param.value[0] != ''">
|
||||
CAST(${param.key} AS DECIMAL(10,2)) >= CAST(#{param.value[0]} AS DECIMAL(10,2))
|
||||
</when>
|
||||
<when test="param.value[1] != null and param.value[1] != ''">
|
||||
CAST(${param.key} AS DECIMAL(10,2)) <= CAST(#{param.value[1]} AS DECIMAL(10,2))
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="discreteParams != null and discreteParams.size() > 0">
|
||||
and
|
||||
<foreach collection="discreteParams" item="param" separator="and">
|
||||
${param.key} = #{param.value}
|
||||
</foreach>
|
||||
</if>
|
||||
</if>
|
||||
<if test="custTag != null and custTag != ''"> and
|
||||
((CASE WHEN substr(#{custTag}, 1, 1) = '1' THEN substr(a.cust_tag, 1, 1) = '1' end)
|
||||
OR (CASE WHEN substr(#{custTag}, 2, 1) = '1' THEN substr(a.cust_tag, 2, 1) = '1' end)
|
||||
OR (CASE WHEN substr(#{custTag}, 3, 1) = '1' THEN substr(a.cust_tag, 3, 1) = '1' end))
|
||||
</if>
|
||||
<if test="custName != null and custName != ''"> and a.cust_name like concat('%', #{custName}, '%') </if>
|
||||
<if test="custId != null and custId != ''"> and a.cust_id like concat('%', #{custId}, '%') </if>
|
||||
<if test="custType != null and custType != ''"> and a.cust_type = #{custType}</if>
|
||||
</where>
|
||||
group by a.cust_id,a.id
|
||||
limit #{start},#{size}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectMyCustInfoMerchantListOps" parameterType="CustInfoBusiness" resultType="com.ruoyi.ibs.customerselect.domain.CustBaseInfo">
|
||||
SELECT distinct a.id, a.cust_type, a.cust_tag, a.cust_scale, a.cust_name, a.lp_name,
|
||||
a.cust_phone, a.cust_id, a.cust_isn,a.asset,a.credit,
|
||||
a.cust_idc,
|
||||
a.cust_type,a.cur_bal_d, a.cur_bal_t, a.bal_loan, a.cur_bal_5_bad, a.cur_d_ave,
|
||||
a.cur_t_ave, a.loan_ave, is_ph, a.is_sx, a.is_yxht, a.is_xyk, a.fshl, a.is_sd, a.etc, a.dian, a.is_black, a.is_bad,
|
||||
a.is_365zf,a.is_180zf,a.is_90zf,a.is_30zf, a.cust_level
|
||||
from cust_info_merchant a
|
||||
<if test="isSelectGrid == false">
|
||||
inner join
|
||||
(select user_id,dept_id,cust_id from
|
||||
(select user_id,dept_id,cust_id,outlets_id from cust_dept_user_grid
|
||||
<where>
|
||||
<if test="opsDept != null and opsDept != ''">
|
||||
ops_dept = #{opsDept}</if>
|
||||
</where>
|
||||
union all
|
||||
select t2.user_id,t2.dept_id,t2.cust_id,t2.outlets_id from cust_dept_user_cmpm t2 where 1=1 and t2.cust_type = '1'
|
||||
)f
|
||||
where 1=1
|
||||
<if test="deptId != null ">
|
||||
and f.dept_id in (select dept_id from sys_dept where dept_id = #{deptId} or find_in_set(#{deptId},ancestors))
|
||||
</if>
|
||||
<if test="outletsId != null ">
|
||||
and f.outlets_id in (select dept_id from sys_dept where dept_id = #{outletsId} or find_in_set(#{outletsId},ancestors))
|
||||
</if>
|
||||
<if test="userId != null ">
|
||||
and f.user_id = #{userId}</if>
|
||||
) b on a.cust_id = b.cust_id
|
||||
</if>
|
||||
<where>
|
||||
<if test="regionTopGridIds != null and regionTopGridIds.size() > 0 ">
|
||||
AND a.cust_id IN (
|
||||
SELECT cust_id
|
||||
FROM grid_region_cust_user grcu
|
||||
<where>
|
||||
<if test="regionTopGridIds != null and regionTopGridIds.size()>0">
|
||||
<foreach collection="regionTopGridIds" item="param" separator="or">
|
||||
grcu.top_grid_id = #{param.value}
|
||||
</foreach>
|
||||
</if>
|
||||
)
|
||||
</where>
|
||||
</if>
|
||||
<if test="regionSecGridIds != null and regionSecGridIds.size()>0">
|
||||
AND a.cust_id IN (
|
||||
SELECT cust_id
|
||||
FROM grid_region_cust_user grcu
|
||||
<where>
|
||||
<foreach collection="regionSecGridIds" item="param" separator="or">
|
||||
grcu.sec_grid_id = #{param.value}
|
||||
</foreach>
|
||||
</where>
|
||||
)
|
||||
</if>
|
||||
<if test="virtualGridIds != null and virtualGridIds.size() > 0 ">
|
||||
AND a.cust_id IN (
|
||||
SELECT cust_id
|
||||
FROM grid_virtual_cust_user gvcu
|
||||
<where>
|
||||
<foreach collection="virtualGridIds" item="param" separator="or">
|
||||
gvcu.grid_id = #{param.value}
|
||||
</foreach>
|
||||
<if test="userName != null ">
|
||||
and gvcu.user_name = #{userName}
|
||||
</if>
|
||||
</where>
|
||||
)
|
||||
</if>
|
||||
<if test="drawGridIds != null and drawGridIds.size() > 0 ">
|
||||
AND a.cust_id IN (
|
||||
SELECT dsc.cust_id
|
||||
FROM grid_draw_user_relate gdur
|
||||
INNER JOIN grid_draw_shape_relate gdsr ON gdur.grid_id = gdsr.grid_id
|
||||
INNER JOIN draw_shape_cust dsc ON gdsr.shape_id = dsc.shape_id
|
||||
<where>
|
||||
<foreach collection="drawGridIds" item="param" separator="or">
|
||||
gdur.grid_id = #{param.value}
|
||||
</foreach>
|
||||
</where>
|
||||
)
|
||||
</if>
|
||||
<if test="continuousParams != null and continuousParams.size() > 0 or discreteParams != null and discreteParams.size() > 0">
|
||||
<if test="continuousParams != null and continuousParams.size() > 0">
|
||||
and
|
||||
<foreach collection="continuousParams" item="param" separator="and">
|
||||
<choose>
|
||||
<when test="param.value[0] != null and param.value[0] != '' and param.value[1] != null and param.value[1] != ''">
|
||||
CAST(${param.key} AS DECIMAL(10,2)) BETWEEN CAST(#{param.value[0]} AS DECIMAL(10,2)) AND CAST(#{param.value[1]} AS DECIMAL(10,2))
|
||||
</when>
|
||||
<when test="param.value[0] != null and param.value[0] != ''">
|
||||
CAST(${param.key} AS DECIMAL(10,2)) >= CAST(#{param.value[0]} AS DECIMAL(10,2))
|
||||
</when>
|
||||
<when test="param.value[1] != null and param.value[1] != ''">
|
||||
CAST(${param.key} AS DECIMAL(10,2)) <= CAST(#{param.value[1]} AS DECIMAL(10,2))
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="discreteParams != null and discreteParams.size() > 0">
|
||||
and
|
||||
<foreach collection="discreteParams" item="param" separator="and">
|
||||
${param.key} = #{param.value}
|
||||
</foreach>
|
||||
</if>
|
||||
</if>
|
||||
<if test="custTag != null and custTag != ''"> and
|
||||
((CASE WHEN substr(#{custTag}, 1, 1) = '1' THEN substr(a.cust_tag, 1, 1) = '1' end)
|
||||
OR (CASE WHEN substr(#{custTag}, 2, 1) = '1' THEN substr(a.cust_tag, 2, 1) = '1' end)
|
||||
OR (CASE WHEN substr(#{custTag}, 3, 1) = '1' THEN substr(a.cust_tag, 3, 1) = '1' end))
|
||||
</if>
|
||||
<if test="custName != null and custName != ''"> and a.cust_name like concat('%', #{custName}, '%') </if>
|
||||
<if test="custId != null and custId != ''"> and a.cust_id like concat('%', #{custId}, '%') </if>
|
||||
<if test="custType != null and custType != ''"> and a.cust_type = #{custType}</if>
|
||||
</where>
|
||||
group by a.cust_id,a.id
|
||||
limit #{start},#{size}
|
||||
</select>
|
||||
<select id="selectMyCustInfoMerchantList_COUNT" resultType="Long">
|
||||
select -1
|
||||
</select>
|
||||
<select id="getMerchantNumByDeptId" parameterType="Long" resultType="java.lang.Long">
|
||||
select count(distinct a.cust_id) from cust_info_merchant a
|
||||
inner join (select distinct code, grid_id
|
||||
from grid_region_admin_division_relate
|
||||
where delete_flag = '0') b
|
||||
on b.code = a.region_code
|
||||
inner join (select distinct grid_id from grid_region_user_relate where delete_flag ='0' and parent_grid_id is null
|
||||
and relate_dept_id in (select dept_id from sys_dept where dept_id = #{headDeptId} or find_in_set(#{headDeptId},ancestors))) c
|
||||
on b.grid_id =c.grid_id
|
||||
</select>
|
||||
|
||||
<select id="getMerchantNumByUserId" parameterType="String" resultType="java.lang.Long">
|
||||
select count(distinct a.cust_id) from cust_info_merchant a
|
||||
inner join (select distinct code, grid_id
|
||||
from grid_region_admin_division_relate
|
||||
where delete_flag = '0'
|
||||
and ops_dept != '1') b
|
||||
on b.code = a.region_code
|
||||
inner join (select distinct grid_id, user_name, delete_flag
|
||||
from grid_region_user_relate
|
||||
where delete_flag = '0'
|
||||
and parent_grid_id is not null) c
|
||||
on b.grid_id = c.grid_id
|
||||
where c.user_name = #{UserId} and c.delete_flag ='0'
|
||||
</select>
|
||||
|
||||
<select id="getMerchantNumByLegalId" parameterType="String" resultType="java.lang.Long">
|
||||
select count(*) from cust_info_merchant
|
||||
where social_credit_code = #{LegalId}
|
||||
</select>
|
||||
|
||||
<update id="updateMerchantByAnchor" parameterType="CustInfoUpdateFromAnchor">
|
||||
update cust_info_merchant
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="anchorName != null">cust_name = #{anchorName},</if>
|
||||
<if test="belongBusiness != null">industry = #{belongBusiness},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateOrg != null">update_dept = #{updateOrg},</if>
|
||||
<if test="address != null">${addressName} = #{address},</if>
|
||||
<if test="regionCode != null">region_code = #{regionCode},</if>
|
||||
</trim>
|
||||
where social_credit_code = #{legalId}
|
||||
</update>
|
||||
|
||||
<insert id="insertMerchantByAnchor" parameterType="CustInfoUpdateFromAnchor" >
|
||||
insert into cust_info_merchant
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="custId != null">cust_id,</if>
|
||||
<if test="custIsn != null">cust_isn,</if>
|
||||
<if test="legalId != null">social_credit_code,</if>
|
||||
<if test="anchorName != null">cust_name,</if>
|
||||
<if test="belongBusiness != null">industry,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="address != null">${addressName},</if>
|
||||
<if test="regionCode != null">region_code,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="custId != null">#{custId},</if>
|
||||
<if test="custIsn != null">#{custIsn},</if>
|
||||
<if test="legalId != null">#{legalId},</if>
|
||||
<if test="anchorName != null">#{anchorName},</if>
|
||||
<if test="belongBusiness != null">#{belongBusiness},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="address != null">#{address},</if>
|
||||
<if test="regionCode != null">#{regionCode},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteMerchantByAnchor" parameterType="CustInfoDeleteFromAnchor">
|
||||
update cust_info_merchant set region_code ='' where social_credit_code = #{legalId}
|
||||
</delete>
|
||||
|
||||
<select id="selectPosNumByAdmin" parameterType="Long" resultType="java.lang.Long">
|
||||
select count(distinct a.cust_id) from (select cust_id,region_code from cust_info_merchant) a
|
||||
inner join (select distinct code,grid_id from grid_region_admin_division_relate) b on b.code = a.region_code
|
||||
inner join (select distinct grid_id from grid_region_user_relate where delete_flag ='0'
|
||||
and (relate_dept_id in (select dept_id from sys_dept where dept_id = #{userDept} or find_in_set(#{userDept},ancestors)) or user_name = #{userDept})) c on b.grid_id = c.grid_id
|
||||
where b.grid_id = #{gridId}
|
||||
</select>
|
||||
|
||||
<select id="getLpNameByCustId" >
|
||||
select distinct lp_name from cust_info_merchant
|
||||
where cust_id = #{custId}
|
||||
</select>
|
||||
|
||||
<select id="selectCustInfoMerchatByCustNameAndCustIdc" parameterType="String" resultMap="CustInfoMerchantResult">
|
||||
<include refid="selectCustInfoMerchantVo"/>
|
||||
<where>
|
||||
<if test="custName != null and custName != ''"> and cust_name = #{custName}</if>
|
||||
<if test="custIdc != null and custIdc != ''"> and cust_idc = #{custIdc}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCustInfoMerchatByCustId" parameterType="String" resultMap="CustInfoMerchantResult">
|
||||
<include refid="selectCustInfoMerchantVo"/>
|
||||
<where>
|
||||
<if test="custId != null "> and cust_id = #{custId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getMerchantIdcByCustId" parameterType="String">
|
||||
select distinct social_credit_code from cust_info_merchant
|
||||
where cust_id = #{custId}
|
||||
</select>
|
||||
|
||||
<select id="selectMerchantInfoByManage" parameterType="CustManageInfo" resultMap="CustManageInfoResult">
|
||||
select distinct a.cust_id,a.cust_name,a.social_credit_code,a.region_code,c.user_name,c.nick_name,'1' as cust_type from cust_info_merchant a
|
||||
inner join (select distinct code,grid_id from grid_region_admin_division_relate where delete_flag ='0') b on
|
||||
b.code =a.region_code
|
||||
inner join (select distinct grid_id,relate_dept_id,user_name,nick_name from grid_region_user_relate where delete_flag ='0'
|
||||
and (relate_dept_id in (select dept_id from sys_dept where dept_id = #{userDept} or find_in_set(#{userDept},ancestors)) or user_name =#{userDept})) c
|
||||
on b.grid_id = c.grid_id
|
||||
where c.grid_id = #{gridId}
|
||||
<if test="custName != null and custName != ''"> and a.cust_name like concat('%', #{custName}, '%') </if>
|
||||
<if test="custId != null and custId != ''"> and a.cust_id like concat('%', #{custId}, '%') </if>
|
||||
<if test="custNo != null and custNo != ''"> and a.cust_idc like concat('%', #{custNo}, '%') </if>
|
||||
<if test="distributeTag != null and distributeTag != ''">
|
||||
and case when #{distributeTag} = '0' then exists (select * from sys_grid_user_cust d where d.grid_id = #{gridId} and a.cust_id =d.cust_id and c.user_name = d.user_name)
|
||||
when #{distributeTag} = '1' then not exists (select * from sys_grid_user_cust d where d.grid_id = #{gridId} and a.cust_id =d.cust_id and c.user_name = d.user_name)
|
||||
else 1=1 end
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="countByCode" resultType="Long">
|
||||
select count(distinct cust_id)
|
||||
from cust_info_merchant_${deptCode}
|
||||
where region_code like concat(#{code}, '%')
|
||||
</select>
|
||||
|
||||
<insert id="insertCustomersToMmerchantByScCode" parameterType="java.util.List">
|
||||
INSERT INTO cust_info_merchant
|
||||
(cust_id,cust_name, social_credit_code, update_by, update_time, cust_phone, industry, asset, credit)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.custId},#{item.custName}, #{item.socialCreditCode}, #{item.createBy}, #{item.createTime}, #{item.custPhone},#{item.industry},#{item.asset},#{item.credit})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="selectCustInfoByScCodeList" resultType="java.lang.String">
|
||||
select social_credit_code from
|
||||
<if test="custType == 1">cust_info_merchant</if>
|
||||
<if test="custType == 2">cust_info_business</if>
|
||||
where social_credit_code in
|
||||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="selectRecord" resultType="com.ruoyi.ibs.list.domain.CustInfoMerchant">
|
||||
select id,cust_name from cust_info_merchant where social_credit_code = #{socialCreditCode}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
216
ibs/src/main/resources/mapper/list/CustInfoRecordMapper.xml
Normal file
216
ibs/src/main/resources/mapper/list/CustInfoRecordMapper.xml
Normal file
@@ -0,0 +1,216 @@
|
||||
<?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.ibs.list.mapper.CustInfoRecordMapper">
|
||||
|
||||
<resultMap type="CustInfoRecord" id="CustInfoRecordResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="custName" column="cust_name" />
|
||||
<result property="lpName" column="lp_name" />
|
||||
<result property="custPhone" column="cust_phone" />
|
||||
<result property="custCapital" column="cust_capital" />
|
||||
<result property="custLocation" column="cust_location" />
|
||||
<result property="belongBranchId" column="belong_branch_id" />
|
||||
<result property="belongBranchName" column="belong_branch_name" />
|
||||
<result property="belongUserId" column="belong_user_id" />
|
||||
<result property="belongUserName" column="belong_user_name" />
|
||||
<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="socialCreditCode" column="social_credit_code" />
|
||||
<result property="tel" column="tel" />
|
||||
<result property="registerLocation" column="register_location" />
|
||||
<result property="businessScope" column="business_scope" />
|
||||
<result property="industry" column="industry" />
|
||||
<result property="custIdc" column="cust_idc" />
|
||||
<result property="custGender" column="cust_gender" />
|
||||
<result property="custAge" column="cust_age" />
|
||||
<result property="status" column="status" />
|
||||
<result property="isMarried" column="is_married" />
|
||||
<result property="custEdu" column="cust_edu" />
|
||||
<result property="custSalary" column="cust_salary" />
|
||||
<result property="birthday" column="birthday" />
|
||||
<result property="jobLocation" column="job_location" />
|
||||
<result property="custType" column="cust_type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCustInfoRecordVo">
|
||||
select id, cust_name, lp_name, cust_phone, cust_capital, cust_location, belong_branch_id, belong_branch_name, belong_user_id, belong_user_name, create_by, create_time, update_by, update_time, social_credit_code, tel, register_location, business_scope, industry, cust_idc, cust_gender, cust_age, status, is_married, cust_edu, cust_salary, birthday, job_location, cust_type from cust_info_record
|
||||
</sql>
|
||||
|
||||
<select id="selectCustInfoRecordList" parameterType="CustInfoRecord" resultMap="CustInfoRecordResult">
|
||||
<include refid="selectCustInfoRecordVo"/>
|
||||
<where>
|
||||
<if test="custName != null and custName != ''"> and cust_name like concat('%', #{custName}, '%')</if>
|
||||
<if test="lpName != null and lpName != ''"> and lp_name like concat('%', #{lpName}, '%')</if>
|
||||
<if test="custPhone != null and custPhone != ''"> and cust_phone = #{custPhone}</if>
|
||||
<if test="custCapital != null and custCapital != ''"> and cust_capital = #{custCapital}</if>
|
||||
<if test="custLocation != null and custLocation != ''"> and cust_location = #{custLocation}</if>
|
||||
<if test="belongBranchId != null and belongBranchId != ''"> and belong_branch_id like concat(#{belongBranchId},'%') </if>
|
||||
<if test="belongBranchName != null and belongBranchName != ''"> and belong_branch_name like concat('%', #{belongBranchName}, '%')</if>
|
||||
<if test="belongUserId != null and belongUserId != ''"> and belong_user_id = #{belongUserId}</if>
|
||||
<if test="belongUserName != null and belongUserName != ''"> and belong_user_name like concat('%', #{belongUserName}, '%')</if>
|
||||
<if test="socialCreditCode != null and socialCreditCode != ''"> and social_credit_code = #{socialCreditCode}</if>
|
||||
<if test="tel != null and tel != ''"> and tel = #{tel}</if>
|
||||
<if test="registerLocation != null and registerLocation != ''"> and register_location = #{registerLocation}</if>
|
||||
<if test="businessScope != null and businessScope != ''"> and business_scope = #{businessScope}</if>
|
||||
<if test="industry != null and industry != ''"> and industry = #{industry}</if>
|
||||
<if test="custIdc != null and custIdc != ''"> and cust_idc = #{custIdc}</if>
|
||||
<if test="custGender != null and custGender != ''"> and cust_gender = #{custGender}</if>
|
||||
<if test="custAge != null and custAge != ''"> and cust_age = #{custAge}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="isMarried != null and isMarried != ''"> and is_married = #{isMarried}</if>
|
||||
<if test="custEdu != null and custEdu != ''"> and cust_edu = #{custEdu}</if>
|
||||
<if test="custSalary != null and custSalary != ''"> and cust_salary = #{custSalary}</if>
|
||||
<if test="birthday != null and birthday != ''"> and birthday = #{birthday}</if>
|
||||
<if test="jobLocation != null and jobLocation != ''"> and job_location = #{jobLocation}</if>
|
||||
<if test="custType != null and custType != ''"> and cust_type = #{custType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCustInfoRecordListByCustTypeAndKeywords" parameterType="CustInfoRecord" resultMap="CustInfoRecordResult">
|
||||
<include refid="selectCustInfoRecordVo"/>
|
||||
<where>
|
||||
<if test="deptId != null and deptId != ''">
|
||||
and belong_branch_id in (select dept_id from sys_dept where dept_id = #{deptId}
|
||||
or find_in_set(#{deptId},ancestors))
|
||||
</if>
|
||||
<if test="userName != null and userName != ''"> and belong_user_id = #{userName}</if>
|
||||
<if test="keyword != null and keyword != ''"> and ( cust_idc like concat('%', #{keyword}, '%') or cust_name like concat('%', #{keyword}, '%')
|
||||
or cust_phone like concat('%', #{keyword}, '%') or lp_name like concat('%', #{keyword}, '%'))
|
||||
</if>
|
||||
<if test="custType != null and custType != ''"> and cust_type = #{custType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectHeadCustInfoRecordListByCustTypeAndKeywords" parameterType="CustInfoRecord" resultMap="CustInfoRecordResult">
|
||||
<include refid="selectCustInfoRecordVo"/>
|
||||
<where>
|
||||
<if test="deptId != null and deptId != ''">
|
||||
and belong_branch_id like concat('%', #{deptId}, '%')
|
||||
</if>
|
||||
<if test="keyword != null and keyword != ''"> and ( cust_idc like concat('%', #{keyword}, '%') or cust_name like concat('%', #{keyword}, '%')
|
||||
or cust_phone like concat('%', #{keyword}, '%') or lp_name like concat('%', #{keyword}, '%'))
|
||||
</if>
|
||||
<if test="custType != null and custType != ''"> and cust_type = #{custType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectCustInfoRecordById" parameterType="Long" resultMap="CustInfoRecordResult">
|
||||
<include refid="selectCustInfoRecordVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertCustInfoRecord" parameterType="CustInfoRecord" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into cust_info_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="custName != null">cust_name,</if>
|
||||
<if test="lpName != null">lp_name,</if>
|
||||
<if test="custPhone != null">cust_phone,</if>
|
||||
<if test="custCapital != null">cust_capital,</if>
|
||||
<if test="custLocation != null">cust_location,</if>
|
||||
<if test="belongBranchId != null">belong_branch_id,</if>
|
||||
<if test="belongBranchName != null">belong_branch_name,</if>
|
||||
<if test="belongUserId != null">belong_user_id,</if>
|
||||
<if test="belongUserName != null">belong_user_name,</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="socialCreditCode != null">social_credit_code,</if>
|
||||
<if test="tel != null">tel,</if>
|
||||
<if test="registerLocation != null">register_location,</if>
|
||||
<if test="businessScope != null">business_scope,</if>
|
||||
<if test="industry != null">industry,</if>
|
||||
<if test="custIdc != null">cust_idc,</if>
|
||||
<if test="custGender != null">cust_gender,</if>
|
||||
<if test="custAge != null">cust_age,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="isMarried != null">is_married,</if>
|
||||
<if test="custEdu != null">cust_edu,</if>
|
||||
<if test="custSalary != null">cust_salary,</if>
|
||||
<if test="birthday != null">birthday,</if>
|
||||
<if test="jobLocation != null">job_location,</if>
|
||||
<if test="custType != null">cust_type,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="custName != null">#{custName},</if>
|
||||
<if test="lpName != null">#{lpName},</if>
|
||||
<if test="custPhone != null">#{custPhone},</if>
|
||||
<if test="custCapital != null">#{custCapital},</if>
|
||||
<if test="custLocation != null">#{custLocation},</if>
|
||||
<if test="belongBranchId != null">#{belongBranchId},</if>
|
||||
<if test="belongBranchName != null">#{belongBranchName},</if>
|
||||
<if test="belongUserId != null">#{belongUserId},</if>
|
||||
<if test="belongUserName != null">#{belongUserName},</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="socialCreditCode != null">#{socialCreditCode},</if>
|
||||
<if test="tel != null">#{tel},</if>
|
||||
<if test="registerLocation != null">#{registerLocation},</if>
|
||||
<if test="businessScope != null">#{businessScope},</if>
|
||||
<if test="industry != null">#{industry},</if>
|
||||
<if test="custIdc != null">#{custIdc},</if>
|
||||
<if test="custGender != null">#{custGender},</if>
|
||||
<if test="custAge != null">#{custAge},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="isMarried != null">#{isMarried},</if>
|
||||
<if test="custEdu != null">#{custEdu},</if>
|
||||
<if test="custSalary != null">#{custSalary},</if>
|
||||
<if test="birthday != null">#{birthday},</if>
|
||||
<if test="jobLocation != null">#{jobLocation},</if>
|
||||
<if test="custType != null">#{custType},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCustInfoRecord" parameterType="CustInfoRecord">
|
||||
update cust_info_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="custName != null and custName != ''">cust_name = #{custName},</if>
|
||||
<if test="lpName != null">lp_name = #{lpName},</if>
|
||||
<if test="custPhone != null">cust_phone = #{custPhone},</if>
|
||||
<if test="custCapital != null">cust_capital = #{custCapital},</if>
|
||||
<if test="custLocation != null">cust_location = #{custLocation},</if>
|
||||
<if test="belongBranchId != null">belong_branch_id = #{belongBranchId},</if>
|
||||
<if test="belongBranchName != null">belong_branch_name = #{belongBranchName},</if>
|
||||
<if test="belongUserId != null">belong_user_id = #{belongUserId},</if>
|
||||
<if test="belongUserName != null">belong_user_name = #{belongUserName},</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="socialCreditCode != null">social_credit_code = #{socialCreditCode},</if>
|
||||
<if test="tel != null">tel = #{tel},</if>
|
||||
<if test="registerLocation != null">register_location = #{registerLocation},</if>
|
||||
<if test="businessScope != null">business_scope = #{businessScope},</if>
|
||||
<if test="industry != null">industry = #{industry},</if>
|
||||
<if test="custIdc != null">cust_idc = #{custIdc},</if>
|
||||
<if test="custGender != null">cust_gender = #{custGender},</if>
|
||||
<if test="custAge != null">cust_age = #{custAge},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="isMarried != null">is_married = #{isMarried},</if>
|
||||
<if test="custEdu != null">cust_edu = #{custEdu},</if>
|
||||
<if test="custSalary != null">cust_salary = #{custSalary},</if>
|
||||
<if test="birthday != null">birthday = #{birthday},</if>
|
||||
<if test="jobLocation != null">job_location = #{jobLocation},</if>
|
||||
<if test="custType != null">cust_type = #{custType},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCustInfoRecordById" parameterType="Long">
|
||||
delete from cust_info_record where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCustInfoRecordByIds" parameterType="String">
|
||||
delete from cust_info_record where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
1059
ibs/src/main/resources/mapper/list/CustInfoRetailMapper.xml
Normal file
1059
ibs/src/main/resources/mapper/list/CustInfoRetailMapper.xml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,38 @@
|
||||
<?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.ibs.list.mapper.DwBGridCmpmCorpcustClaimRptMapper">
|
||||
|
||||
|
||||
<select id="selectResultList" resultType="DwBGridCmpmCorpcustClaimResultRpt">
|
||||
select id,outlet_id,outlet_name,branch_id,branch_name,manager_id,manager_name,base_claim_cust_cnt,base_claim_acct_cnt,base_dep_bal,
|
||||
base_dep_avg,base_dfgz_cnt,base_qyhl_prod_cnt,base_dkdj_prod_cnt,report_claim_cust_cnt,report_claim_acct_cnt,report_dep_bal,
|
||||
report_dep_avg,report_dfgz_cnt,report_qyhl_prod_cnt,report_dkdj_prod_cnt,data_date
|
||||
from dwb_grid_cmpm_corpcust_claim_result_rpt
|
||||
<where>
|
||||
<if test="role != null and role == 'outlet'"> and d.outlet_id = #{deptId} </if>
|
||||
<if test="role != null and role == 'branch'"> and d.branch_id = #{deptId} </if>
|
||||
<if test="role != null and role in {'head', 'ops', 'public', 'private'}">
|
||||
and (left(outlet_id, 3) = left(#{deptId}, 3) or left(branch_id, 3) = left(#{deptId}, 3))
|
||||
</if>
|
||||
</where>
|
||||
order by id
|
||||
</select>
|
||||
|
||||
<select id="selectDetailList" resultType="DwBGridCmpmCorpcustClaimDetailRpt">
|
||||
select id,outlet_id,outlet_name,branch_id,branch_name,manager_id,manager_name,cust_id,cust_name,cust_idc,cust_isn,base_claim_acct_cnt,
|
||||
base_dep_bal,base_dep_avg,base_dfgz_flag,base_qyhl_prod_cnt,base_dkdj_prod_cnt,report_claim_acct_cnt,report_dep_bal,report_dep_avg,
|
||||
report_dfgz_flag,report_qyhl_prod_cnt,report_dkdj_prod_cnt,data_date
|
||||
from dwb_grid_cmpm_corpcust_claim_detail_rpt
|
||||
<where>
|
||||
<if test="role != null and role == 'outlet'"> and d.outlet_id = #{deptId} </if>
|
||||
<if test="role != null and role == 'branch'"> and d.branch_id = #{deptId} </if>
|
||||
<if test="role != null and role in {'head', 'ops', 'public', 'private'}">
|
||||
and (left(outlet_id, 3) = left(#{deptId}, 3) or left(branch_id, 3) = left(#{deptId}, 3))
|
||||
</if>
|
||||
</where>
|
||||
order by id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
204
ibs/src/main/resources/mapper/list/FamilyMemberMapper.xml
Normal file
204
ibs/src/main/resources/mapper/list/FamilyMemberMapper.xml
Normal file
@@ -0,0 +1,204 @@
|
||||
<?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.ibs.list.mapper.FamilyMemberMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.ibs.list.domain.FamilyMember" id="FamilyMemberResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="idCard" column="id_card" />
|
||||
<result property="name" column="name" />
|
||||
<result property="fatherCard" column="father_card" />
|
||||
<result property="motherCard" column="mother_card" />
|
||||
<result property="spouseCard" column="spouse_card" />
|
||||
<result property="familyId" column="family_id" />
|
||||
<result property="gender" column="gender" />
|
||||
<result property="age" column="age" />
|
||||
<result property="bsId" column="bs_id" />
|
||||
<result property="spouseFamilyId" column="spouse_family_id" />
|
||||
<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="birthDate" column="birth_date" />
|
||||
<result property="isVirtual" column="is_virtual" />
|
||||
<result property="depositBalance" column="deposit_balance" />
|
||||
<result property="loanBalance" column="loan_balance" />
|
||||
<result property="loanManager" column="loan_manager" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectFamilyMemberVo">
|
||||
select id,id_card, name, father_card, mother_card, spouse_card, family_id, gender, age,bs_id,spouse_family_id,create_time,update_time,
|
||||
create_by,update_by,birth_date,is_virtual, deposit_balance, loan_balance, loan_manager
|
||||
from family_member
|
||||
</sql>
|
||||
|
||||
<select id="selectFamilyMemberList" parameterType="FamilyMember" resultMap="FamilyMemberResult">
|
||||
<include refid="selectFamilyMemberVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="fatherCard != null and fatherCard != ''"> and father_card = #{fatherCard}</if>
|
||||
<if test="motherCard != null and motherCard != ''"> and mother_card = #{motherCard}</if>
|
||||
<if test="spouseCard != null and spouseCard != ''"> and spouse_card = #{spouseCard}</if>
|
||||
<if test="familyId != null and familyId != ''"> and family_id = #{familyId}</if>
|
||||
<if test="gender != null and gender != ''"> and gender = #{gender}</if>
|
||||
<if test="age != null "> and age = #{age}</if>
|
||||
<if test="bsId != null "> and bs_id = #{bsId}</if>
|
||||
<if test="spouseFamilyId != null "> and spouse_family_id = #{spouseFamilyId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectFamilyMemberByIdCard" parameterType="String" resultMap="FamilyMemberResult">
|
||||
<include refid="selectFamilyMemberVo"/>
|
||||
where id_card = #{idCard}
|
||||
</select>
|
||||
|
||||
<select id="selectFamilyMemberByBsId" parameterType="String" resultMap="FamilyMemberResult">
|
||||
<include refid="selectFamilyMemberVo"/>
|
||||
where bs_id = #{bsId}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<insert id="insertFamilyMember" parameterType="FamilyMember">
|
||||
insert into family_member
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="idCard != null">id_card,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="fatherCard != null">father_card,</if>
|
||||
<if test="motherCard != null">mother_card,</if>
|
||||
<if test="spouseCard != null">spouse_card,</if>
|
||||
<if test="familyId != null">family_id,</if>
|
||||
<if test="gender != null">gender,</if>
|
||||
<if test="age != null">age,</if>
|
||||
<if test="bsId != null">bs_id,</if>
|
||||
<if test="spouseFamilyId != null "> spouse_family_id ,</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="birthDate != null">birth_date,</if>
|
||||
<if test="isVirtual != null">is_virtual,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="idCard != null">#{idCard},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="fatherCard != null">#{fatherCard},</if>
|
||||
<if test="motherCard != null">#{motherCard},</if>
|
||||
<if test="spouseCard != null">#{spouseCard},</if>
|
||||
<if test="familyId != null">#{familyId},</if>
|
||||
<if test="gender != null">#{gender},</if>
|
||||
<if test="age != null">#{age},</if>
|
||||
<if test="bsId != null">#{bsId},</if>
|
||||
<if test="spouseFamilyId != null "> #{spouseFamilyId},</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="birthDate != null">#{birthDate},</if>
|
||||
<if test="isVirtual != null">#{isVirtual},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateFamilyMember" parameterType="FamilyMember">
|
||||
update family_member
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="fatherCard != null">father_card = #{fatherCard},</if>
|
||||
<if test="motherCard != null">mother_card = #{motherCard},</if>
|
||||
<if test="spouseCard != null">spouse_card = #{spouseCard},</if>
|
||||
<if test="familyId != null">family_id = #{familyId},</if>
|
||||
<if test="gender != null">gender = #{gender},</if>
|
||||
<if test="age != null">age = #{age},</if>
|
||||
<if test="bsId != null">bs_id = #{bsId},</if>
|
||||
<if test="spouseFamilyId != null "> spouse_family_id = #{spouseFamilyId},</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="birthDate != null">birth_date = #{birthDate},</if>
|
||||
<if test="isVirtual != null">is_virtual= #{isVirtual},</if>
|
||||
</trim>
|
||||
where id_card = #{idCard}
|
||||
</update>
|
||||
|
||||
<delete id="deleteFamilyMemberByIdCard" parameterType="String">
|
||||
delete from family_member where id_card = #{idCard}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteFamilyMemberByIdCards" parameterType="String">
|
||||
delete from family_member where id_card in
|
||||
<foreach item="idCard" collection="array" open="(" separator="," close=")">
|
||||
#{idCard}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getMemberByIdCard" resultMap="FamilyMemberResult">
|
||||
SELECT * FROM family_member
|
||||
WHERE id_card = #{idCard}
|
||||
</select>
|
||||
|
||||
<select id="getMembersByFamilyId" resultMap="FamilyMemberResult">
|
||||
<include refid="selectFamilyMemberVo"/>
|
||||
WHERE family_id = #{familyId} or spouse_family_id = #{familyId}
|
||||
union
|
||||
select f1.id,f1.id_card, f1.name, f1.father_card, f1.mother_card, f1.spouse_card, f1.family_id, f1.gender, f1.age,f1.bs_id,f1.spouse_family_id,
|
||||
f1.create_time,f1.update_time,f1.create_by,f1.update_by,f1.birth_date, f1.is_virtual, f1.deposit_balance, f1.loan_balance, f1.loan_manager
|
||||
from family_member f1
|
||||
inner join family_member f2 on f1.mother_card = f2.id_card
|
||||
where f2.family_id = #{familyId} and f2.gender = 'F'
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getMembersByFamilyId2" resultMap="FamilyMemberResult">
|
||||
<include refid="selectFamilyMemberVo"/>
|
||||
WHERE family_id = #{familyId}
|
||||
union all
|
||||
select distinct f1.id,f1.id_card, f1.name, f1.father_card, f1.mother_card, f1.spouse_card, f1.family_id, f1.gender, f1.age,f1.bs_id,f1.spouse_family_id,
|
||||
f1.create_time,f1.update_time,f1.create_by,f1.update_by,f1.birth_date, f1.is_virtual , f1.deposit_balance, f1.loan_balance, f1.loan_manager
|
||||
from family_member f1
|
||||
inner join family_member f2 on (f1.id_card = f2.mother_card or f1.id_card = f2.spouse_card)
|
||||
where f2.family_id = #{familyId}
|
||||
union all
|
||||
select f1.id,f1.id_card, f1.name, f1.father_card, f1.mother_card, f1.spouse_card, f1.family_id, f1.gender, f1.age,f1.bs_id,
|
||||
f1.spouse_family_id,f1.create_time,f1.update_time,f1.create_by,f1.update_by,f1.birth_date, f1.is_virtual, f1.deposit_balance, f1.loan_balance, f1.loan_manager
|
||||
from family_member f1
|
||||
inner join family_member f2 on f1.mother_card = f2.id_card where f2.family_id = #{familyId} and f2.gender = 'F'
|
||||
</select>
|
||||
|
||||
<select id="getMembersSpouseByFamilyId" resultMap="FamilyMemberResult">
|
||||
<include refid="selectFamilyMemberVo"/>
|
||||
WHERE id_card in (SELECT spouse_card FROM family_member where family_id = #{familyId})
|
||||
</select>
|
||||
|
||||
<select id="getSpouseFamilyId" resultType="String">
|
||||
SELECT fm2.family_id
|
||||
FROM family_member fm1
|
||||
JOIN family_member fm2 ON fm1.spouse_card = fm2.id_card
|
||||
WHERE fm1.id_card = #{idCard}
|
||||
</select>
|
||||
|
||||
<select id="getChildrenByAnyParent" resultMap="FamilyMemberResult">
|
||||
SELECT * FROM family_member WHERE father_card = #{parentCard} OR mother_card = #{parentCard}
|
||||
</select>
|
||||
|
||||
<select id="batchSelect" resultMap="FamilyMemberResult">
|
||||
SELECT * FROM family_member WHERE id_card IN
|
||||
<foreach item='id' collection='ids' open='(' separator=',' close=')'>
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="selectChildrenIds" resultType="String">
|
||||
SELECT id_card FROM family_member WHERE father_card = #{memberId} OR mother_card = #{memberId}
|
||||
</select>
|
||||
|
||||
<select id="selectSiblingIds" resultType="String">
|
||||
SELECT id_card FROM family_member WHERE (father_card = #{fatherId} OR mother_card = #{motherId} or bs_id = #{bsId})
|
||||
AND id_card != #{memberId}
|
||||
</select>
|
||||
</mapper>
|
||||
131
ibs/src/main/resources/mapper/list/FamilyMembersMapper.xml
Normal file
131
ibs/src/main/resources/mapper/list/FamilyMembersMapper.xml
Normal file
@@ -0,0 +1,131 @@
|
||||
<?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.ibs.list.mapper.FamilyMembersMapper">
|
||||
|
||||
<resultMap type="FamilyMembers" id="FamilyMembersResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="custIsn" column="cust_isn" />
|
||||
<result property="custId" column="cust_id" />
|
||||
<result property="fmyCustId" column="fmy_cust_id" />
|
||||
<result property="fmyCustIdc" column="fmy_cust_idc" />
|
||||
<result property="fmyName" column="fmy_name" />
|
||||
<result property="tel" column="tel" />
|
||||
<result property="birthday" column="birthday" />
|
||||
<result property="fmyRln" column="fmy_rln" />
|
||||
<result property="label" column="label" />
|
||||
<result property="belongBusi" column="belong_busi" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectFamilyMembersVo">
|
||||
select id,cust_isn, cust_id, fmy_cust_id,fmy_cust_idc, fmy_name, tel, birthday, fmy_rln, label, belong_busi from family_members
|
||||
</sql>
|
||||
|
||||
<select id="selectFamilyMembersList" parameterType="FamilyMembers" resultMap="FamilyMembersResult">
|
||||
<include refid="selectFamilyMembersVo"/>
|
||||
<where>
|
||||
<if test="id != null "> and id = #{id}</if>
|
||||
<if test="custIsn != null and custIsn != ''"> and cust_isn = #{custIsn}</if>
|
||||
<if test="custId != null and custId != ''"> and cust_id = #{custId}</if>
|
||||
<if test="fmyCustId != null and fmyCustId != ''"> and fmy_cust_id = #{fmyCustId}</if>
|
||||
<if test="fmyCustIdc != null and fmyCustIdc != ''"> and fmy_cust_idc = #{fmyCustIdc}</if>
|
||||
<if test="fmyName != null and fmyName != ''"> and fmy_name like concat('%', #{fmyName}, '%')</if>
|
||||
<if test="tel != null and tel != ''"> and tel = #{tel}</if>
|
||||
<if test="birthday != null "> and birthday = #{birthday}</if>
|
||||
<if test="fmyRln != null and fmyRln != ''"> and fmy_rln = #{fmyRln}</if>
|
||||
<if test="label != null and label != ''"> and label = #{label}</if>
|
||||
<if test="belongBusi != null and belongBusi != ''"> and belong_busi = #{belongBusi}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectFamilyMembersByCustIsn" parameterType="String" resultMap="FamilyMembersResult">
|
||||
<include refid="selectFamilyMembersVo"/>
|
||||
where cust_isn = #{custIsn}
|
||||
</select>
|
||||
|
||||
<select id="selectCustEnumByCustId" resultType="CustTagVo">
|
||||
select cstn.id, cstn.cust_tag_name, case when cst.cust_id is null then 'false' else 'true' end as flag,
|
||||
cstn.cust_tag_level1,cstn.cust_tag_level2,cstn.tag_type
|
||||
from sys_cust_tag_nemu cstn
|
||||
left join
|
||||
(select * from sys_cust_tag where cust_id = #{custId} )cst on cst.tag_id = cstn.id
|
||||
where cstn.dept_id = #{deptId3} and cstn.cust_tag_type = #{custType}
|
||||
order by cstn.cust_tag_level1,cstn.cust_tag_level2,flag desc
|
||||
</select>
|
||||
|
||||
<select id="selectManualTag" resultType="CustManualTagVO">
|
||||
select
|
||||
tm.id AS id,
|
||||
tm.parent_id AS parentId,
|
||||
tm.cust_tag_name AS custTagName,
|
||||
case when ctm.cust_id is null then 'false' else 'true' end as flag
|
||||
from sys_tag_manual tm
|
||||
left join sys_cust_tag_manual ctm
|
||||
on ctm.tag_id = tm.id and ctm.cust_id = #{custId}
|
||||
where tm.dept_id = #{deptId3} and tm.cust_tag_type = #{custType}
|
||||
order by tm.id, flag desc
|
||||
</select>
|
||||
|
||||
<select id="selectmanualAll" resultType="CustManualTagVO">
|
||||
select id, parent_id, cust_tag_name
|
||||
from sys_tag_manual
|
||||
where dept_id = #{deptId} and cust_tag_type = #{custType}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertFamilyMembers" parameterType="FamilyMembers">
|
||||
insert into family_members
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="custIsn != null">cust_isn,</if>
|
||||
<if test="custId != null">cust_id,</if>
|
||||
<if test="fmyCustId != null">fmy_cust_id,</if>
|
||||
<if test="fmyCustIdc != null">fmy_cust_idc,</if>
|
||||
<if test="fmyName != null">fmy_name,</if>
|
||||
<if test="tel != null">tel,</if>
|
||||
<if test="birthday != null">birthday,</if>
|
||||
<if test="fmyRln != null">fmy_rln,</if>
|
||||
<if test="label != null">label,</if>
|
||||
<if test="belongBusi != null">belong_busi,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="custIsn != null">#{custIsn},</if>
|
||||
<if test="custId != null">#{custId},</if>
|
||||
<if test="fmyCustId != null">#{fmyCustId},</if>
|
||||
<if test="fmyCustIdc != null">#{fmyCustIdc},</if>
|
||||
<if test="fmyName != null">#{fmyName},</if>
|
||||
<if test="tel != null">#{tel},</if>
|
||||
<if test="birthday != null">#{birthday},</if>
|
||||
<if test="fmyRln != null">#{fmyRln},</if>
|
||||
<if test="label != null">#{label},</if>
|
||||
<if test="belongBusi != null">#{belongBusi},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateFamilyMembers" parameterType="FamilyMembers">
|
||||
update family_members
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="custId != null">cust_id = #{custId},</if>
|
||||
<if test="fmyCustId != null">fmy_cust_id = #{fmyCustId},</if>
|
||||
<if test="fmyCustIdc != null">fmy_cust_idc = #{fmyCustIdc},</if>
|
||||
<if test="fmyName != null">fmy_name = #{fmyName},</if>
|
||||
<if test="tel != null">tel = #{tel},</if>
|
||||
<if test="birthday != null">birthday = #{birthday},</if>
|
||||
<if test="fmyRln != null">fmy_rln = #{fmyRln},</if>
|
||||
<if test="label != null">label = #{label},</if>
|
||||
<if test="belongBusi != null">belong_busi = #{belongBusi},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteFamilyMembersByCustIsn" parameterType="String">
|
||||
delete from family_members where cust_isn = #{custIsn}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteFamilyMembersByCustIsns" parameterType="String">
|
||||
delete from family_members where cust_isn in
|
||||
<foreach item="custIsn" collection="array" open="(" separator="," close=")">
|
||||
#{custIsn}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,90 @@
|
||||
<?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.ibs.list.mapper.FamilyMembersRecordMapper">
|
||||
|
||||
<resultMap type="FamilyMembersRecord" id="FamilyMembersRecordResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="custIdc" column="cust_idc" />
|
||||
<result property="fmyName" column="fmy_name" />
|
||||
<result property="tel" column="tel" />
|
||||
<result property="birthday" column="birthday" />
|
||||
<result property="fmyRln" column="fmy_rln" />
|
||||
<result property="belongBusi" column="belong_busi" />
|
||||
<result property="fmyCustIdc" column="fmy_cust_idc" />
|
||||
<result property="recordId" column="record_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectFamilyMembersRecordVo">
|
||||
select id,cust_idc, fmy_name, tel, birthday, fmy_rln, belong_busi, fmy_cust_idc,record_id from family_members_record
|
||||
</sql>
|
||||
|
||||
<select id="selectFamilyMembersRecordList" parameterType="FamilyMembersRecord" resultMap="FamilyMembersRecordResult">
|
||||
<include refid="selectFamilyMembersRecordVo"/>
|
||||
<where>
|
||||
<if test="custIdc != null and custIdc != ''"> and cust_idc = #{custIdc}</if>
|
||||
<if test="fmyName != null and fmyName != ''"> and fmy_name like concat('%', #{fmyName}, '%')</if>
|
||||
<if test="tel != null and tel != ''"> and tel = #{tel}</if>
|
||||
<if test="birthday != null "> and birthday = #{birthday}</if>
|
||||
<if test="fmyRln != null and fmyRln != ''"> and fmy_rln = #{fmyRln}</if>
|
||||
<if test="belongBusi != null and belongBusi != ''"> and belong_busi = #{belongBusi}</if>
|
||||
<if test="fmyCustIdc != null and fmyCustIdc != ''"> and fmy_cust_idc = #{fmyCustIdc}</if>
|
||||
<if test="recordId != null "> and record_id = #{recordId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectFamilyMembersRecordByCustIdc" parameterType="String" resultMap="FamilyMembersRecordResult">
|
||||
<include refid="selectFamilyMembersRecordVo"/>
|
||||
where cust_idc = #{custIdc}
|
||||
</select>
|
||||
|
||||
<insert id="insertFamilyMembersRecord" parameterType="FamilyMembersRecord">
|
||||
insert into family_members_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="custIdc != null">cust_idc,</if>
|
||||
<if test="fmyName != null">fmy_name,</if>
|
||||
<if test="tel != null">tel,</if>
|
||||
<if test="birthday != null">birthday,</if>
|
||||
<if test="fmyRln != null">fmy_rln,</if>
|
||||
<if test="belongBusi != null">belong_busi,</if>
|
||||
<if test="fmyCustIdc != null">fmy_cust_idc,</if>
|
||||
<if test="recordId != null">record_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="custIdc != null">#{custIdc},</if>
|
||||
<if test="fmyName != null">#{fmyName},</if>
|
||||
<if test="tel != null">#{tel},</if>
|
||||
<if test="birthday != null">#{birthday},</if>
|
||||
<if test="fmyRln != null">#{fmyRln},</if>
|
||||
<if test="belongBusi != null">#{belongBusi},</if>
|
||||
<if test="fmyCustIdc != null">#{fmyCustIdc},</if>
|
||||
<if test="recordId != null">#{recordId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateFamilyMembersRecord" parameterType="FamilyMembersRecord">
|
||||
update family_members_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="fmyName != null">fmy_name = #{fmyName},</if>
|
||||
<if test="tel != null">tel = #{tel},</if>
|
||||
<if test="birthday != null">birthday = #{birthday},</if>
|
||||
<if test="fmyRln != null">fmy_rln = #{fmyRln},</if>
|
||||
<if test="belongBusi != null">belong_busi = #{belongBusi},</if>
|
||||
<if test="fmyCustIdc != null">fmy_cust_idc = #{fmyCustIdc},</if>
|
||||
<if test="recordId != null">record_id = #{recordId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteFamilyMembersRecordByCustIdc" parameterType="String">
|
||||
delete from family_members_record where cust_idc = #{custIdc}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteFamilyMembersRecordByCustIdcs" parameterType="String">
|
||||
delete from family_members_record where cust_idc in
|
||||
<foreach item="custIdc" collection="array" open="(" separator="," close=")">
|
||||
#{custIdc}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
87
ibs/src/main/resources/mapper/list/OtherBankRateMapper.xml
Normal file
87
ibs/src/main/resources/mapper/list/OtherBankRateMapper.xml
Normal file
@@ -0,0 +1,87 @@
|
||||
<?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.ibs.list.mapper.OtherBankRateMapper">
|
||||
|
||||
<resultMap type="OtherBankRate" id="OtherBankRateResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="custIdc" column="cust_idc" />
|
||||
<result property="bank" column="bank" />
|
||||
<result property="rate" column="rate" />
|
||||
<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="source" column="source" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectOtherBankRateVo">
|
||||
select id, cust_idc, bank, rate, create_by, create_time, update_by, update_time,source from other_bank_rate
|
||||
</sql>
|
||||
|
||||
<select id="selectOtherBankRateList" parameterType="OtherBankRate" resultMap="OtherBankRateResult">
|
||||
<include refid="selectOtherBankRateVo"/>
|
||||
<where>
|
||||
<if test="custIdc != null and custIdc != ''"> and cust_idc = #{custIdc}</if>
|
||||
<if test="bank != null and bank != ''"> and bank = #{bank}</if>
|
||||
<if test="rate != null and rate != ''"> and rate = #{rate}</if>
|
||||
<if test="source != null and source != ''"> and source = #{source}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectOtherBankRateById" parameterType="Long" resultMap="OtherBankRateResult">
|
||||
<include refid="selectOtherBankRateVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertOtherBankRate" parameterType="OtherBankRate" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into other_bank_rate
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="custIdc != null">cust_idc,</if>
|
||||
<if test="bank != null">bank,</if>
|
||||
<if test="rate != null">rate,</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="source != null">source,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="custIdc != null">#{custIdc},</if>
|
||||
<if test="bank != null">#{bank},</if>
|
||||
<if test="rate != null">#{rate},</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="source != null">#{source},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateOtherBankRate" parameterType="OtherBankRate">
|
||||
update other_bank_rate
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="custIdc != null">cust_idc = #{custIdc},</if>
|
||||
<if test="bank != null">bank = #{bank},</if>
|
||||
<if test="rate != null">rate = #{rate},</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="source != null">source = #{source},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteOtherBankRateById" parameterType="Long">
|
||||
delete from other_bank_rate where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteOtherBankRateByIds" parameterType="String">
|
||||
delete from other_bank_rate where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
101
ibs/src/main/resources/mapper/list/RecordRelateMapper.xml
Normal file
101
ibs/src/main/resources/mapper/list/RecordRelateMapper.xml
Normal file
@@ -0,0 +1,101 @@
|
||||
<?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.ibs.list.mapper.RecordRelateMapper">
|
||||
|
||||
<resultMap type="RecordRelate" id="RecordRelateResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="socialCreditCode" column="social_credit_code" />
|
||||
<result property="relateCustIdc" column="relate_cust_idc" />
|
||||
<result property="relatePerson" column="relate_person" />
|
||||
<result property="relateMerchant" column="relate_merchant" />
|
||||
<result property="relateBusiness" column="relate_business" />
|
||||
<result property="custIdc" column="cust_idc" />
|
||||
<result property="custType" column="cust_type" />
|
||||
<result property="relateMerchantCode" column="relate_merchant_code" />
|
||||
<result property="relateBusinessCode" column="relate_business_code" />
|
||||
<result property="recordId" column="record_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRecordRelateVo">
|
||||
select id, social_credit_code, relate_cust_idc, relate_person, relate_merchant, relate_business, cust_idc, cust_type, relate_merchant_code, relate_business_code,record_id from record_relate
|
||||
</sql>
|
||||
|
||||
<select id="selectRecordRelateList" parameterType="RecordRelate" resultMap="RecordRelateResult">
|
||||
<include refid="selectRecordRelateVo"/>
|
||||
<where>
|
||||
<if test="socialCreditCode != null and socialCreditCode != ''"> and social_credit_code = #{socialCreditCode}</if>
|
||||
<if test="relateCustIdc != null and relateCustIdc != ''"> and relate_cust_idc = #{relateCustIdc}</if>
|
||||
<if test="relatePerson != null and relatePerson != ''"> and relate_person = #{relatePerson}</if>
|
||||
<if test="relateMerchant != null and relateMerchant != ''"> and relate_merchant = #{relateMerchant}</if>
|
||||
<if test="relateBusiness != null and relateBusiness != ''"> and relate_business = #{relateBusiness}</if>
|
||||
<if test="custIdc != null and custIdc != ''"> and cust_idc = #{custIdc}</if>
|
||||
<if test="custType != null and custType != ''"> and cust_type = #{custType}</if>
|
||||
<if test="relateMerchantCode != null and relateMerchantCode != ''"> and relate_merchant_code = #{relateMerchantCode}</if>
|
||||
<if test="relateBusinessCode != null and relateBusinessCode != ''"> and relate_business_code = #{relateBusinessCode}</if>
|
||||
<if test="recordId != null "> and record_id = #{recordId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRecordRelateById" parameterType="Long" resultMap="RecordRelateResult">
|
||||
<include refid="selectRecordRelateVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRecordRelate" parameterType="RecordRelate" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into record_relate
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="socialCreditCode != null">social_credit_code,</if>
|
||||
<if test="relateCustIdc != null">relate_cust_idc,</if>
|
||||
<if test="relatePerson != null">relate_person,</if>
|
||||
<if test="relateMerchant != null">relate_merchant,</if>
|
||||
<if test="relateBusiness != null">relate_business,</if>
|
||||
<if test="custIdc != null">cust_idc,</if>
|
||||
<if test="custType != null">cust_type,</if>
|
||||
<if test="relateMerchantCode != null">relate_merchant_code,</if>
|
||||
<if test="relateBusinessCode != null">relate_business_code,</if>
|
||||
<if test="recordId != null">record_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="socialCreditCode != null">#{socialCreditCode},</if>
|
||||
<if test="relateCustIdc != null">#{relateCustIdc},</if>
|
||||
<if test="relatePerson != null">#{relatePerson},</if>
|
||||
<if test="relateMerchant != null">#{relateMerchant},</if>
|
||||
<if test="relateBusiness != null">#{relateBusiness},</if>
|
||||
<if test="custIdc != null">#{custIdc},</if>
|
||||
<if test="custType != null">#{custType},</if>
|
||||
<if test="relateMerchantCode != null">#{relateMerchantCode},</if>
|
||||
<if test="relateBusinessCode != null">#{relateBusinessCode},</if>
|
||||
<if test="recordId != null">#{recordId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRecordRelate" parameterType="RecordRelate">
|
||||
update record_relate
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="socialCreditCode != null">social_credit_code = #{socialCreditCode},</if>
|
||||
<if test="relateCustIdc != null">relate_cust_idc = #{relateCustIdc},</if>
|
||||
<if test="relatePerson != null">relate_person = #{relatePerson},</if>
|
||||
<if test="relateMerchant != null">relate_merchant = #{relateMerchant},</if>
|
||||
<if test="relateBusiness != null">relate_business = #{relateBusiness},</if>
|
||||
<if test="custIdc != null">cust_idc = #{custIdc},</if>
|
||||
<if test="custType != null">cust_type = #{custType},</if>
|
||||
<if test="relateMerchantCode != null">relate_merchant_code = #{relateMerchantCode},</if>
|
||||
<if test="relateBusinessCode != null">relate_business_code = #{relateBusinessCode},</if>
|
||||
<if test="recordId != null">record_id = #{recordId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRecordRelateById" parameterType="Long">
|
||||
delete from record_relate where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRecordRelateByIds" parameterType="String">
|
||||
delete from record_relate where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
119
ibs/src/main/resources/mapper/list/SignedProductsMapper.xml
Normal file
119
ibs/src/main/resources/mapper/list/SignedProductsMapper.xml
Normal file
@@ -0,0 +1,119 @@
|
||||
<?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.ibs.list.mapper.SignedProductsMapper">
|
||||
|
||||
<resultMap type="SignedProducts" id="SignedProductsResult">
|
||||
<result property="currdeposFlag" column="currdepos_flag" />
|
||||
<result property="hatflowcostbookFlag" column="hatflowcostbook_flag" />
|
||||
<result property="phmortgloanFlag" column="phmortgloan_flag" />
|
||||
<result property="zheliloanFlag" column="zheliloan_flag" />
|
||||
<result property="frcdFlag" column="frcd_flag" />
|
||||
<result property="financialbookFlag" column="financialbook_flag" />
|
||||
<result property="fundbookFlag" column="fundbook_flag" />
|
||||
<result property="insurbookFlag" column="insurbook_flag" />
|
||||
<result property="bondbookFlag" column="bondbook_flag" />
|
||||
<result property="watfeeWhcFlag" column="watfee_whc_flag" />
|
||||
<result property="elefeeWhcFlag" column="elefee_whc_flag" />
|
||||
<result property="gasfeeWhcFlag" column="gasfee_whc_flag" />
|
||||
<result property="etcFlag" column="etc_flag" />
|
||||
<result property="custId" column="cust_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSignedProductsVo">
|
||||
select currdepos_flag, hatflowcostbook_flag, phmortgloan_flag, zheliloan_flag, frcd_flag, financialbook_flag, fundbook_flag, insurbook_flag, bondbook_flag, watfee_whc_flag, elefee_whc_flag, gasfee_whc_flag, etc_flag, cust_id from signed_products
|
||||
</sql>
|
||||
|
||||
<select id="selectSignedProductsList" parameterType="SignedProducts" resultMap="SignedProductsResult">
|
||||
<include refid="selectSignedProductsVo"/>
|
||||
<where>
|
||||
<if test="currdeposFlag != null and currdeposFlag != ''"> and currdepos_flag = #{currdeposFlag}</if>
|
||||
<if test="hatflowcostbookFlag != null and hatflowcostbookFlag != ''"> and hatflowcostbook_flag = #{hatflowcostbookFlag}</if>
|
||||
<if test="phmortgloanFlag != null and phmortgloanFlag != ''"> and phmortgloan_flag = #{phmortgloanFlag}</if>
|
||||
<if test="zheliloanFlag != null and zheliloanFlag != ''"> and zheliloan_flag = #{zheliloanFlag}</if>
|
||||
<if test="frcdFlag != null and frcdFlag != ''"> and frcd_flag = #{frcdFlag}</if>
|
||||
<if test="financialbookFlag != null and financialbookFlag != ''"> and financialbook_flag = #{financialbookFlag}</if>
|
||||
<if test="fundbookFlag != null and fundbookFlag != ''"> and fundbook_flag = #{fundbookFlag}</if>
|
||||
<if test="insurbookFlag != null and insurbookFlag != ''"> and insurbook_flag = #{insurbookFlag}</if>
|
||||
<if test="bondbookFlag != null and bondbookFlag != ''"> and bondbook_flag = #{bondbookFlag}</if>
|
||||
<if test="watfeeWhcFlag != null and watfeeWhcFlag != ''"> and watfee_whc_flag = #{watfeeWhcFlag}</if>
|
||||
<if test="elefeeWhcFlag != null and elefeeWhcFlag != ''"> and elefee_whc_flag = #{elefeeWhcFlag}</if>
|
||||
<if test="gasfeeWhcFlag != null and gasfeeWhcFlag != ''"> and gasfee_whc_flag = #{gasfeeWhcFlag}</if>
|
||||
<if test="etcFlag != null and etcFlag != ''"> and etc_flag = #{etcFlag}</if>
|
||||
<if test="custId != null and custId != ''"> and cust_id = #{custId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSignedProductsByCurrdeposFlag" parameterType="String" resultMap="SignedProductsResult">
|
||||
<include refid="selectSignedProductsVo"/>
|
||||
where cust_id = #{custId}
|
||||
</select>
|
||||
|
||||
<insert id="insertSignedProducts" parameterType="SignedProducts">
|
||||
insert into signed_products
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="currdeposFlag != null">currdepos_flag,</if>
|
||||
<if test="hatflowcostbookFlag != null">hatflowcostbook_flag,</if>
|
||||
<if test="phmortgloanFlag != null">phmortgloan_flag,</if>
|
||||
<if test="zheliloanFlag != null">zheliloan_flag,</if>
|
||||
<if test="frcdFlag != null">frcd_flag,</if>
|
||||
<if test="financialbookFlag != null">financialbook_flag,</if>
|
||||
<if test="fundbookFlag != null">fundbook_flag,</if>
|
||||
<if test="insurbookFlag != null">insurbook_flag,</if>
|
||||
<if test="bondbookFlag != null">bondbook_flag,</if>
|
||||
<if test="watfeeWhcFlag != null">watfee_whc_flag,</if>
|
||||
<if test="elefeeWhcFlag != null">elefee_whc_flag,</if>
|
||||
<if test="gasfeeWhcFlag != null">gasfee_whc_flag,</if>
|
||||
<if test="etcFlag != null">etc_flag,</if>
|
||||
<if test="custId != null">cust_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="currdeposFlag != null">#{currdeposFlag},</if>
|
||||
<if test="hatflowcostbookFlag != null">#{hatflowcostbookFlag},</if>
|
||||
<if test="phmortgloanFlag != null">#{phmortgloanFlag},</if>
|
||||
<if test="zheliloanFlag != null">#{zheliloanFlag},</if>
|
||||
<if test="frcdFlag != null">#{frcdFlag},</if>
|
||||
<if test="financialbookFlag != null">#{financialbookFlag},</if>
|
||||
<if test="fundbookFlag != null">#{fundbookFlag},</if>
|
||||
<if test="insurbookFlag != null">#{insurbookFlag},</if>
|
||||
<if test="bondbookFlag != null">#{bondbookFlag},</if>
|
||||
<if test="watfeeWhcFlag != null">#{watfeeWhcFlag},</if>
|
||||
<if test="elefeeWhcFlag != null">#{elefeeWhcFlag},</if>
|
||||
<if test="gasfeeWhcFlag != null">#{gasfeeWhcFlag},</if>
|
||||
<if test="etcFlag != null">#{etcFlag},</if>
|
||||
<if test="custId != null">#{custId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSignedProducts" parameterType="SignedProducts">
|
||||
update signed_products
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="hatflowcostbookFlag != null">hatflowcostbook_flag = #{hatflowcostbookFlag},</if>
|
||||
<if test="phmortgloanFlag != null">phmortgloan_flag = #{phmortgloanFlag},</if>
|
||||
<if test="zheliloanFlag != null">zheliloan_flag = #{zheliloanFlag},</if>
|
||||
<if test="frcdFlag != null">frcd_flag = #{frcdFlag},</if>
|
||||
<if test="financialbookFlag != null">financialbook_flag = #{financialbookFlag},</if>
|
||||
<if test="fundbookFlag != null">fundbook_flag = #{fundbookFlag},</if>
|
||||
<if test="insurbookFlag != null">insurbook_flag = #{insurbookFlag},</if>
|
||||
<if test="bondbookFlag != null">bondbook_flag = #{bondbookFlag},</if>
|
||||
<if test="watfeeWhcFlag != null">watfee_whc_flag = #{watfeeWhcFlag},</if>
|
||||
<if test="elefeeWhcFlag != null">elefee_whc_flag = #{elefeeWhcFlag},</if>
|
||||
<if test="gasfeeWhcFlag != null">gasfee_whc_flag = #{gasfeeWhcFlag},</if>
|
||||
<if test="etcFlag != null">etc_flag = #{etcFlag},</if>
|
||||
<if test="custId != null">cust_id = #{custId},</if>
|
||||
</trim>
|
||||
where currdepos_flag = #{currdeposFlag}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSignedProductsByCurrdeposFlag" parameterType="String">
|
||||
delete from signed_products where currdepos_flag = #{currdeposFlag}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSignedProductsByCurrdeposFlags" parameterType="String">
|
||||
delete from signed_products where currdepos_flag in
|
||||
<foreach item="currdeposFlag" collection="array" open="(" separator="," close=")">
|
||||
#{currdeposFlag}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
136
ibs/src/main/resources/mapper/list/SocialSecurityMapper.xml
Normal file
136
ibs/src/main/resources/mapper/list/SocialSecurityMapper.xml
Normal file
@@ -0,0 +1,136 @@
|
||||
<?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.ibs.list.mapper.SocialSecurityMapper">
|
||||
|
||||
<resultMap type="SocialSecurity" id="SocialSecurityResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="custIdc" column="cust_idc" />
|
||||
<result property="paymentStatus" column="payment_status" />
|
||||
<result property="unitType" column="unit_type" />
|
||||
<result property="belongBusi" column="belong_busi" />
|
||||
<result property="economicType" column="economic_type" />
|
||||
<result property="qualityLabel" column="quality_label" />
|
||||
<result property="paymentBaseRank" column="payment_base_rank" />
|
||||
<result property="paymentCountRank" column="payment_count_rank" />
|
||||
<result property="paymentType" column="payment_type" />
|
||||
<result property="insuranceStatus" column="insurance_status" />
|
||||
<result property="recentTwoYearsCount" column="recent_two_years_count" />
|
||||
<result property="recentOneYearsCount" column="recent_one_years_count" />
|
||||
<result property="paymentBase" column="payment_base" />
|
||||
<result property="blackList" column="black_list" />
|
||||
<result property="labourArbitration" column="labour_arbitration" />
|
||||
<result property="receivePensionBenefits" column="receive_pension_benefits" />
|
||||
<result property="receiveUnemploymentBenefits" column="receive_unemployment_benefits" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSocialSecurityVo">
|
||||
select id, cust_idc, payment_status, unit_type, belong_busi, economic_type, quality_label, payment_base_rank, payment_count_rank, payment_type, insurance_status, recent_two_years_count, recent_one_years_count, payment_base, black_list, labour_arbitration, receive_pension_benefits, receive_unemployment_benefits from social_security
|
||||
</sql>
|
||||
|
||||
<select id="selectSocialSecurityList" parameterType="SocialSecurity" resultMap="SocialSecurityResult">
|
||||
<include refid="selectSocialSecurityVo"/>
|
||||
<where>
|
||||
<if test="custIdc != null and custIdc != ''"> and cust_idc = #{custIdc}</if>
|
||||
<if test="paymentStatus != null and paymentStatus != ''"> and payment_status = #{paymentStatus}</if>
|
||||
<if test="unitType != null and unitType != ''"> and unit_type = #{unitType}</if>
|
||||
<if test="belongBusi != null and belongBusi != ''"> and belong_busi = #{belongBusi}</if>
|
||||
<if test="economicType != null and economicType != ''"> and economic_type = #{economicType}</if>
|
||||
<if test="qualityLabel != null and qualityLabel != ''"> and quality_label = #{qualityLabel}</if>
|
||||
<if test="paymentBaseRank != null and paymentBaseRank != ''"> and payment_base_rank = #{paymentBaseRank}</if>
|
||||
<if test="paymentCountRank != null and paymentCountRank != ''"> and payment_count_rank = #{paymentCountRank}</if>
|
||||
<if test="paymentType != null and paymentType != ''"> and payment_type = #{paymentType}</if>
|
||||
<if test="insuranceStatus != null and insuranceStatus != ''"> and insurance_status = #{insuranceStatus}</if>
|
||||
<if test="recentTwoYearsCount != null and recentTwoYearsCount != ''"> and recent_two_years_count = #{recentTwoYearsCount}</if>
|
||||
<if test="recentOneYearsCount != null and recentOneYearsCount != ''"> and recent_one_years_count = #{recentOneYearsCount}</if>
|
||||
<if test="paymentBase != null and paymentBase != ''"> and payment_base = #{paymentBase}</if>
|
||||
<if test="blackList != null and blackList != ''"> and black_list = #{blackList}</if>
|
||||
<if test="labourArbitration != null and labourArbitration != ''"> and labour_arbitration = #{labourArbitration}</if>
|
||||
<if test="receivePensionBenefits != null and receivePensionBenefits != ''"> and receive_pension_benefits = #{receivePensionBenefits}</if>
|
||||
<if test="receiveUnemploymentBenefits != null and receiveUnemploymentBenefits != ''"> and receive_unemployment_benefits = #{receiveUnemploymentBenefits}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSocialSecurityById" parameterType="Long" resultMap="SocialSecurityResult">
|
||||
<include refid="selectSocialSecurityVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSocialSecurity" parameterType="SocialSecurity" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into social_security
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="custIdc != null">cust_idc,</if>
|
||||
<if test="paymentStatus != null">payment_status,</if>
|
||||
<if test="unitType != null">unit_type,</if>
|
||||
<if test="belongBusi != null">belong_busi,</if>
|
||||
<if test="economicType != null">economic_type,</if>
|
||||
<if test="qualityLabel != null">quality_label,</if>
|
||||
<if test="paymentBaseRank != null">payment_base_rank,</if>
|
||||
<if test="paymentCountRank != null">payment_count_rank,</if>
|
||||
<if test="paymentType != null">payment_type,</if>
|
||||
<if test="insuranceStatus != null">insurance_status,</if>
|
||||
<if test="recentTwoYearsCount != null">recent_two_years_count,</if>
|
||||
<if test="recentOneYearsCount != null">recent_one_years_count,</if>
|
||||
<if test="paymentBase != null">payment_base,</if>
|
||||
<if test="blackList != null">black_list,</if>
|
||||
<if test="labourArbitration != null">labour_arbitration,</if>
|
||||
<if test="receivePensionBenefits != null">receive_pension_benefits,</if>
|
||||
<if test="receiveUnemploymentBenefits != null">receive_unemployment_benefits,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="custIdc != null">#{custIdc},</if>
|
||||
<if test="paymentStatus != null">#{paymentStatus},</if>
|
||||
<if test="unitType != null">#{unitType},</if>
|
||||
<if test="belongBusi != null">#{belongBusi},</if>
|
||||
<if test="economicType != null">#{economicType},</if>
|
||||
<if test="qualityLabel != null">#{qualityLabel},</if>
|
||||
<if test="paymentBaseRank != null">#{paymentBaseRank},</if>
|
||||
<if test="paymentCountRank != null">#{paymentCountRank},</if>
|
||||
<if test="paymentType != null">#{paymentType},</if>
|
||||
<if test="insuranceStatus != null">#{insuranceStatus},</if>
|
||||
<if test="recentTwoYearsCount != null">#{recentTwoYearsCount},</if>
|
||||
<if test="recentOneYearsCount != null">#{recentOneYearsCount},</if>
|
||||
<if test="paymentBase != null">#{paymentBase},</if>
|
||||
<if test="blackList != null">#{blackList},</if>
|
||||
<if test="labourArbitration != null">#{labourArbitration},</if>
|
||||
<if test="receivePensionBenefits != null">#{receivePensionBenefits},</if>
|
||||
<if test="receiveUnemploymentBenefits != null">#{receiveUnemploymentBenefits},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSocialSecurity" parameterType="SocialSecurity">
|
||||
update social_security
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="custIdc != null">cust_idc = #{custIdc},</if>
|
||||
<if test="paymentStatus != null">payment_status = #{paymentStatus},</if>
|
||||
<if test="unitType != null">unit_type = #{unitType},</if>
|
||||
<if test="belongBusi != null">belong_busi = #{belongBusi},</if>
|
||||
<if test="economicType != null">economic_type = #{economicType},</if>
|
||||
<if test="qualityLabel != null">quality_label = #{qualityLabel},</if>
|
||||
<if test="paymentBaseRank != null">payment_base_rank = #{paymentBaseRank},</if>
|
||||
<if test="paymentCountRank != null">payment_count_rank = #{paymentCountRank},</if>
|
||||
<if test="paymentType != null">payment_type = #{paymentType},</if>
|
||||
<if test="insuranceStatus != null">insurance_status = #{insuranceStatus},</if>
|
||||
<if test="recentTwoYearsCount != null">recent_two_years_count = #{recentTwoYearsCount},</if>
|
||||
<if test="recentOneYearsCount != null">recent_one_years_count = #{recentOneYearsCount},</if>
|
||||
<if test="paymentBase != null">payment_base = #{paymentBase},</if>
|
||||
<if test="blackList != null">black_list = #{blackList},</if>
|
||||
<if test="labourArbitration != null">labour_arbitration = #{labourArbitration},</if>
|
||||
<if test="receivePensionBenefits != null">receive_pension_benefits = #{receivePensionBenefits},</if>
|
||||
<if test="receiveUnemploymentBenefits != null">receive_unemployment_benefits = #{receiveUnemploymentBenefits},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSocialSecurityById" parameterType="Long">
|
||||
delete from social_security where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSocialSecurityByIds" parameterType="String">
|
||||
delete from social_security where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,333 @@
|
||||
<?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.ibs.list.mapper.SysCampaignGroupCustomerMapper">
|
||||
|
||||
<resultMap type="SysCampaignGroupCustomer" id="SysCampaignGroupCustomerResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="custId" column="cust_id"/>
|
||||
<result property="campaignId" column="campaign_id"/>
|
||||
<result property="groupId" column="group_id"/>
|
||||
<result property="deptId" column="dept_id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<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="delFlag" column="del_flag"/>
|
||||
<result property="gridId" column="grid_id"/>
|
||||
<result property="listType" column="list_type"/>
|
||||
<result property="pushStatus" column="push_status"/>
|
||||
<result property="orgClaimStatus" column="org_claim_status"/>
|
||||
<result property="orgDistributeStatus" column="org_distribute_status"/>
|
||||
<result property="custClaimStatus" column="cust_claim_status"/>
|
||||
<result property="createRole" column="create_role"/>
|
||||
<result property="gridName" column="grid_name"/>
|
||||
<result property="gridName2" column="grid_name2"/>
|
||||
<result property="outlets" column="outlets"/>
|
||||
<result property="custIdc" column="cust_idc"/>
|
||||
<result property="secondPushStatus" column="second_push_status"/>
|
||||
<result property="socialCreditCode" column="social_credit_code" />
|
||||
<result property="custPhone" column="cust_phone" />
|
||||
<result property="outletsId" column="outlets_id"/>
|
||||
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysCampaignGroupCustomerVo">
|
||||
select id,
|
||||
cust_id,
|
||||
campaign_id,
|
||||
group_id,
|
||||
dept_id,
|
||||
user_id,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
remark,
|
||||
del_flag,
|
||||
grid_id,
|
||||
list_type,
|
||||
push_status,
|
||||
org_claim_status,
|
||||
org_distribute_status,
|
||||
cust_claim_status,
|
||||
create_role,
|
||||
grid_name,
|
||||
grid_name2,
|
||||
outlets,cust_idc,second_push_status,social_credit_code,cust_phone,outlets_id
|
||||
from sys_campaign_group_customer
|
||||
</sql>
|
||||
|
||||
<select id="selectSysCampaignGroupCustomerList" parameterType="SysCampaignGroupCustomer"
|
||||
resultMap="SysCampaignGroupCustomerResult">
|
||||
<include refid="selectSysCampaignGroupCustomerVo"/>
|
||||
<where>
|
||||
<if test="custId != null and custId != ''">and cust_id = #{custId}</if>
|
||||
<if test="campaignId != null and campaignId != ''">and campaign_id = #{campaignId}</if>
|
||||
<if test="groupId != null and groupId != ''">and group_id = #{groupId}</if>
|
||||
<if test="deptId != null ">and dept_id = #{deptId}</if>
|
||||
<if test="outletsId != null ">and outlets_id = #{outletsId}</if>
|
||||
<if test="userId != null ">and user_id = #{userId}</if>
|
||||
<if test="deptFlag != null ">and user_id is null </if>
|
||||
<if test="gridId != null ">and grid_id = #{gridId}</if>
|
||||
<if test="listType != null and listType != ''">and list_type = #{listType}</if>
|
||||
<if test="pushStatus != null and pushStatus != ''">and push_status = #{pushStatus}</if>
|
||||
<if test="secondPushStatus != null and secondPushStatus != ''">and second_push_status = #{secondPushStatus}</if>
|
||||
<if test="orgDistributeStatus != null and orgDistributeStatus != ''">and org_distribute_status = #{orgDistributeStatus}</if>
|
||||
<if test="createRole != null and createRole != ''">and create_role = #{createRole}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysCampaignGroupCustomerList2" parameterType="SysCampaignGroupCustomer"
|
||||
resultMap="SysCampaignGroupCustomerResult">
|
||||
<include refid="selectSysCampaignGroupCustomerVo"/>
|
||||
<where>
|
||||
<if test="custId != null and custId != ''">and cust_id = #{custId}</if>
|
||||
<if test="campaignId != null and campaignId != ''">and campaign_id = #{campaignId}</if>
|
||||
<if test="groupId != null and groupId != ''">and group_id = #{groupId}</if>
|
||||
<if test="deptId != null "> and dept_id in (select dept_id from sys_dept where dept_id = #{deptId} or find_in_set(#{deptId},ancestors))</if>
|
||||
<if test="userId != null ">and user_id = #{userId}</if>
|
||||
<if test="gridId != null ">and grid_id = #{gridId}</if>
|
||||
<if test="listType != null and listType != ''">and list_type = #{listType}</if>
|
||||
<if test="pushStatus != null and pushStatus != ''">and push_status = #{pushStatus}</if>
|
||||
<if test="createRole != null and createRole != ''">and create_role = #{createRole}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysCampaignGroupCustomerById" parameterType="Long" resultMap="SysCampaignGroupCustomerResult">
|
||||
<include refid="selectSysCampaignGroupCustomerVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysCampaignGroupCustomer" parameterType="SysCampaignGroupCustomer" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into sys_campaign_group_customer
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="custId != null">cust_id,</if>
|
||||
<if test="campaignId != null">campaign_id,</if>
|
||||
<if test="groupId != null">group_id,</if>
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="userId != null">user_id,</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="delFlag != null">del_flag,</if>
|
||||
<if test="gridId != null">grid_id,</if>
|
||||
<if test="listType != null">list_type,</if>
|
||||
<if test="pushStatus != null">push_status,</if>
|
||||
<if test="orgClaimStatus != null">org_claim_status,</if>
|
||||
<if test="orgDistributeStatus != null">org_distribute_status,</if>
|
||||
<if test="custClaimStatus != null">cust_claim_status,</if>
|
||||
<if test="createRole != null">create_role,</if>
|
||||
<if test="gridName!= null">grid_name,</if>
|
||||
<if test="gridName2 != null">grid_name2,</if>
|
||||
<if test="outlets != null">outlets,</if>
|
||||
<if test="custIdc != null">cust_idc,</if>
|
||||
<if test="secondPushStatus != null">second_push_status,</if>
|
||||
<if test="socialCreditCode != null">social_credit_code,</if>
|
||||
<if test="custPhone != null">cust_phone,</if>
|
||||
<if test="outletsId != null">outlets_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="custId != null">#{custId},</if>
|
||||
<if test="campaignId != null">#{campaignId},</if>
|
||||
<if test="groupId != null">#{groupId},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="userId != null">#{userId},</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="delFlag != null">#{delFlag},</if>
|
||||
<if test="gridId != null">#{gridId},</if>
|
||||
<if test="listType != null">#{listType},</if>
|
||||
<if test="pushStatus != null">#{pushStatus},</if>
|
||||
<if test="orgClaimStatus != null">#{orgClaimStatus},</if>
|
||||
<if test="orgDistributeStatus != null">#{orgDistributeStatus},</if>
|
||||
<if test="custClaimStatus != null">#{custClaimStatus},</if>
|
||||
<if test="createRole != null">#{createRole},</if>
|
||||
<if test="gridName != null">#{gridName},</if>
|
||||
<if test="gridName2 != null">#{gridName2},</if>
|
||||
<if test="outlets != null">#{outlets},</if>
|
||||
<if test="custIdc != null">#{custIdc},</if>
|
||||
<if test="secondPushStatus != null">#{secondPushStatus},</if>
|
||||
<if test="socialCreditCode != null">#{socialCreditCode},</if>
|
||||
<if test="custPhone != null">#{custPhone},</if>
|
||||
<if test="outletsId != null">#{outletsId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertSysCampaignGroupCustomerBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_campaign_group_customer
|
||||
(cust_id,campaign_id,group_id,dept_id,user_id,create_by,create_time,update_by,
|
||||
update_time,remark,del_flag,grid_id,list_type,push_status,org_claim_status,org_distribute_status,cust_claim_status,create_role,grid_name,
|
||||
grid_name2,outlets,cust_idc,second_push_status,social_credit_code,cust_phone,outlets_id,push_user_level,cust_name,lp_name,cust_isn)
|
||||
values
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
|
||||
(#{item.custId},#{item.campaignId},#{item.groupId},#{item.deptId},#{item.userId},#{item.createBy},sysdate(),
|
||||
#{item.updateBy},#{item.updateTime},#{item.remark},#{item.delFlag},#{item.gridId},#{item.listType},#{item.pushStatus},
|
||||
#{item.orgClaimStatus},#{item.orgDistributeStatus},#{item.custClaimStatus},#{item.createRole},#{item.gridName},
|
||||
#{item.gridName2},#{item.outlets},#{item.custIdc},#{item.secondPushStatus},#{item.socialCreditCode},#{item.custPhone},#{item.outletsId},#{item.pushUserLevel}
|
||||
,#{item.custName},#{item.lpName},#{item.custIsn})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertHeadHandledMission" >
|
||||
insert into head_handled_mission (campaign_id, create_time, create_by)
|
||||
values (#{campaignId},sysdate(),#{userName})
|
||||
</insert>
|
||||
|
||||
|
||||
|
||||
|
||||
<update id="updateSysCampaignGroupCustomer" parameterType="SysCampaignGroupCustomer">
|
||||
update sys_campaign_group_customer
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="custId != null">cust_id = #{custId},</if>
|
||||
<if test="campaignId != null">campaign_id = #{campaignId},</if>
|
||||
<if test="groupId != null">group_id = #{groupId},</if>
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="userId != null">user_id = #{userId},</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="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="gridId != null">grid_id = #{gridId},</if>
|
||||
<if test="listType != null">list_type = #{listType},</if>
|
||||
<if test="pushStatus != null">push_status = #{pushStatus},</if>
|
||||
<if test="orgClaimStatus != null">org_claim_status = #{orgClaimStatus},</if>
|
||||
<if test="orgDistributeStatus != null">org_distribute_status = #{orgDistributeStatus},</if>
|
||||
<if test="custClaimStatus != null">cust_claim_status = #{custClaimStatus},</if>
|
||||
<if test="createRole != null">create_role = #{createRole},</if>
|
||||
<if test="gridName != null">grid_name = #{gridName},</if>
|
||||
<if test="gridName2 != null">grid_name2 = #{gridName2},</if>
|
||||
<if test="outlets != null">outlets = #{outlets},</if>
|
||||
<if test="custIdc != null">cust_idc = #{custIdc},</if>
|
||||
<if test="secondPushStatus != null">second_push_status = #{secondPushStatus},</if>
|
||||
<if test="socialCreditCode != null">social_credit_code = #{socialCreditCode},</if>
|
||||
<if test="custPhone != null">cust_phone = #{custPhone},</if>
|
||||
<if test="outletsId != null">outlets_id = #{outletsId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateSysCampaignGroupCustomerBatch">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
update sys_campaign_group_customer
|
||||
<set>
|
||||
<if test="item.custId != null">cust_id = #{item.custId},</if>
|
||||
<if test="item.campaignId != null">campaign_id = #{item.campaignId},</if>
|
||||
<if test="item.groupId != null">group_id = #{item.groupId},</if>
|
||||
<if test="item.deptId != null">dept_id = #{item.deptId},</if>
|
||||
<if test="item.userId != null">user_id = #{item.userId},</if>
|
||||
<if test="item.createBy != null">create_by = #{item.createBy},</if>
|
||||
<if test="item.createTime != null">create_time = #{item.createTime},</if>
|
||||
<if test="item.updateBy != null">update_by = #{item.updateBy},</if>
|
||||
<if test="item.updateTime != null">update_time = #{item.updateTime},</if>
|
||||
<if test="item.remark != null">remark = #{item.remark},</if>
|
||||
<if test="item.delFlag != null">del_flag = #{item.delFlag},</if>
|
||||
<if test="item.gridId != null">grid_id = #{item.gridId},</if>
|
||||
<if test="item.listType != null">list_type = #{item.listType},</if>
|
||||
<if test="item.pushStatus != null">push_status = #{item.pushStatus},</if>
|
||||
<if test="item.orgClaimStatus != null">org_claim_status = #{item.orgClaimStatus},</if>
|
||||
<if test="item.orgDistributeStatus != null">org_distribute_status = #{item.orgDistributeStatus},</if>
|
||||
<if test="item.custClaimStatus != null">cust_claim_status = #{item.custClaimStatus},</if>
|
||||
<if test="item.createRole != null">create_role = #{item.createRole},</if>
|
||||
<if test="item.gridName != null">grid_name = #{item.gridName},</if>
|
||||
<if test="item.gridName2 != null">grid_name2 = #{item.gridName2},</if>
|
||||
<if test="item.outlets != null">outlets = #{item.outlets},</if>
|
||||
<if test="item.custIdc != null">cust_idc = #{item.custIdc},</if>
|
||||
<if test="item.secondPushStatus != null">second_push_status = #{item.secondPushStatus},</if>
|
||||
<if test="item.socialCreditCode != null">social_credit_code = #{item.socialCreditCode},</if>
|
||||
<if test="item.custPhone != null">cust_phone = #{item.custPhone},</if>
|
||||
<if test="item.outletsId != null">outlets_id = #{item.outletsId},</if>
|
||||
<if test="item.pushUserLevel != null">push_user_level = #{item.pushUserLevel},</if>
|
||||
</set>
|
||||
|
||||
<where>
|
||||
id = #{item.id}
|
||||
</where>
|
||||
|
||||
</foreach>
|
||||
|
||||
</update>
|
||||
|
||||
|
||||
<delete id="deleteSysCampaignGroupCustomerById" parameterType="Long">
|
||||
delete
|
||||
from sys_campaign_group_customer
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysCampaignGroupCustomerByIds" parameterType="String">
|
||||
delete from sys_campaign_group_customer where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getDeptIdByUserId" parameterType="Long" resultType="java.lang.Long">
|
||||
select dept_id
|
||||
from sys_user
|
||||
where user_Id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="getReceiveUserNum" resultType="java.lang.String">
|
||||
select distinct user_id from sys_campaign_group_customer where group_id = #{groupId} and campaign_id = #{campaignId} and cust_claim_status = '1'
|
||||
and case when #{deptId} is null then org_claim_status not in ('0','1')
|
||||
and dept_id in (select dept_id from sys_dept where dept_id = #{userDept} or find_in_set(#{userDept},ancestors))
|
||||
when #{deptId} is not null then dept_id = #{deptId} and org_claim_status in ('0','1')
|
||||
else 1=1 end
|
||||
</select>
|
||||
|
||||
<select id="getAllUserNum" resultType="java.lang.String">
|
||||
select distinct user_id from sys_campaign_group_customer where group_id = #{groupId} and campaign_id = #{campaignId}
|
||||
and case when #{deptId} is null then org_claim_status not in ('0','1')
|
||||
and dept_id in (select dept_id from sys_dept where dept_id = #{userDept} or find_in_set(#{userDept},ancestors))
|
||||
when #{deptId} is not null then dept_id = #{deptId} and org_claim_status in ('0','1')
|
||||
else 1=1 end
|
||||
</select>
|
||||
|
||||
<select id="getReceiveUserNumOutlet" resultType="java.lang.String">
|
||||
select distinct user_id from sys_campaign_group_customer where group_id = #{groupId} and campaign_id = #{campaignId} and cust_claim_status = '1'
|
||||
and outlets_id =#{userDept}
|
||||
</select>
|
||||
|
||||
<select id="getAllUserNumOutlet" resultType="java.lang.String">
|
||||
select distinct user_id from sys_campaign_group_customer where group_id = #{groupId} and campaign_id = #{campaignId}
|
||||
and outlets_id =#{userDept}
|
||||
</select>
|
||||
|
||||
<select id="getUserInfoList" parameterType="ListSelectForUser">
|
||||
select distinct b.nick_name from sys_campaign_group_customer a ,sys_user b where a.group_id = #{groupId} and a.cust_id = #{custId} and a.user_id=b.user_id
|
||||
</select>
|
||||
|
||||
<select id="getGroupCustIdByGroupId">
|
||||
select distinct cust_id from sys_campaign_group_customer where group_id = #{groupId}
|
||||
and case when #{deptId} is null then user_id is not null else (dept_id = #{deptId} and user_id is null) end
|
||||
</select>
|
||||
|
||||
<select id="selectSysCampaignGroupCustomerListUnsuccess" parameterType="SysCampaignGroupCustomer"
|
||||
resultMap="SysCampaignGroupCustomerResult">
|
||||
<include refid="selectSysCampaignGroupCustomerVo"/>
|
||||
<where>
|
||||
user_id is null
|
||||
<if test="custId != null and custId != ''">and cust_id = #{custId}</if>
|
||||
<if test="campaignId != null and campaignId != ''">and campaign_id = #{campaignId}</if>
|
||||
<if test="groupId != null and groupId != ''">and group_id = #{groupId}</if>
|
||||
<if test="deptId != null ">and dept_id = #{deptId}</if>
|
||||
<if test="outletsId != null ">and outlets_id = #{outletsId}</if>
|
||||
<if test="userId != null ">and user_id = #{userId}</if>
|
||||
<if test="createRole != null and createRole != ''">and create_role = #{createRole}</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
1411
ibs/src/main/resources/mapper/list/SysCampaignMapper.xml
Normal file
1411
ibs/src/main/resources/mapper/list/SysCampaignMapper.xml
Normal file
File diff suppressed because it is too large
Load Diff
150
ibs/src/main/resources/mapper/list/SysGroupBusinessMapper.xml
Normal file
150
ibs/src/main/resources/mapper/list/SysGroupBusinessMapper.xml
Normal file
@@ -0,0 +1,150 @@
|
||||
<?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.ibs.list.mapper.SysGroupBusinessMapper">
|
||||
|
||||
<resultMap type="SysGroupBusiness" id="SysGroupBusinessResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="groupId" column="group_id" />
|
||||
<result property="custId" column="cust_id" />
|
||||
<result property="custName" column="cust_name" />
|
||||
<result property="custIdc" column="cust_idc" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<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="delFlag" column="del_flag" />
|
||||
<result property="pushStatus" column="push_status" />
|
||||
<result property="custPhone" column="cust_phone" />
|
||||
<result property="gridName1" column="grid_name1" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="custIsn" column="cust_isn" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="gridName2" column="grid_name2" />
|
||||
<result property="lpName" column="lp_name" />
|
||||
<result property="socialCreditCode" column="social_credit_code" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysGroupBusinessVo">
|
||||
select id, group_id, cust_id, cust_name, cust_idc, dept_id, user_id, create_by, create_time, update_by, update_time, remark, del_flag, push_status, cust_phone, grid_name1, user_name, cust_isn, dept_name, grid_name2, lp_name, social_credit_code from sys_group_business
|
||||
</sql>
|
||||
|
||||
<select id="selectSysGroupBusinessList" parameterType="SysGroupBusiness" resultMap="SysGroupBusinessResult">
|
||||
<include refid="selectSysGroupBusinessVo"/>
|
||||
<where>
|
||||
<if test="groupId != null and groupId != ''"> and group_id = #{groupId}</if>
|
||||
<if test="custId != null and custId != ''"> and cust_id = #{custId}</if>
|
||||
<if test="custName != null and custName != ''"> and cust_name like concat('%', #{custName}, '%')</if>
|
||||
<if test="custIdc != null and custIdc != ''"> and cust_idc = #{custIdc}</if>
|
||||
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="pushStatus != null and pushStatus != ''"> and push_status = #{pushStatus}</if>
|
||||
<if test="custPhone != null and custPhone != ''"> and cust_phone = #{custPhone}</if>
|
||||
<if test="gridName1 != null and gridName1 != ''"> and grid_name1 = #{gridName1}</if>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="custIsn != null and custIsn != ''"> and cust_isn = #{custIsn}</if>
|
||||
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
|
||||
<if test="gridName2 != null and gridName2 != ''"> and grid_name2 = #{gridName2}</if>
|
||||
<if test="lpName != null and lpName != ''"> and lp_name like concat('%', #{lpName}, '%')</if>
|
||||
<if test="socialCreditCode != null and socialCreditCode != ''"> and social_credit_code = #{socialCreditCode}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysGroupBusinessById" parameterType="Long" resultMap="SysGroupBusinessResult">
|
||||
<include refid="selectSysGroupBusinessVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysGroupBusiness" parameterType="SysGroupBusiness" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_group_business
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="groupId != null">group_id,</if>
|
||||
<if test="custId != null">cust_id,</if>
|
||||
<if test="custName != null">cust_name,</if>
|
||||
<if test="custIdc != null">cust_idc,</if>
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="userId != null">user_id,</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="delFlag != null">del_flag,</if>
|
||||
<if test="pushStatus != null">push_status,</if>
|
||||
<if test="custPhone != null">cust_phone,</if>
|
||||
<if test="gridName1 != null">grid_name1,</if>
|
||||
<if test="userName != null">user_name,</if>
|
||||
<if test="custIsn != null">cust_isn,</if>
|
||||
<if test="deptName != null">dept_name,</if>
|
||||
<if test="gridName2 != null">grid_name2,</if>
|
||||
<if test="lpName != null">lp_name,</if>
|
||||
<if test="socialCreditCode != null">social_credit_code,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="groupId != null">#{groupId},</if>
|
||||
<if test="custId != null">#{custId},</if>
|
||||
<if test="custName != null">#{custName},</if>
|
||||
<if test="custIdc != null">#{custIdc},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="userId != null">#{userId},</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="delFlag != null">#{delFlag},</if>
|
||||
<if test="pushStatus != null">#{pushStatus},</if>
|
||||
<if test="custPhone != null">#{custPhone},</if>
|
||||
<if test="gridName1 != null">#{gridName1},</if>
|
||||
<if test="userName != null">#{userName},</if>
|
||||
<if test="custIsn != null">#{custIsn},</if>
|
||||
<if test="deptName != null">#{deptName},</if>
|
||||
<if test="gridName2 != null">#{gridName2},</if>
|
||||
<if test="lpName != null">#{lpName},</if>
|
||||
<if test="socialCreditCode != null">#{socialCreditCode},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysGroupBusiness" parameterType="SysGroupBusiness">
|
||||
update sys_group_business
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="groupId != null">group_id = #{groupId},</if>
|
||||
<if test="custId != null">cust_id = #{custId},</if>
|
||||
<if test="custName != null">cust_name = #{custName},</if>
|
||||
<if test="custIdc != null">cust_idc = #{custIdc},</if>
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="userId != null">user_id = #{userId},</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="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="pushStatus != null">push_status = #{pushStatus},</if>
|
||||
<if test="custPhone != null">cust_phone = #{custPhone},</if>
|
||||
<if test="gridName1 != null">grid_name1 = #{gridName1},</if>
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="custIsn != null">cust_isn = #{custIsn},</if>
|
||||
<if test="deptName != null">dept_name = #{deptName},</if>
|
||||
<if test="gridName2 != null">grid_name2 = #{gridName2},</if>
|
||||
<if test="lpName != null">lp_name = #{lpName},</if>
|
||||
<if test="socialCreditCode != null">social_credit_code = #{socialCreditCode},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysGroupBusinessById" parameterType="Long">
|
||||
delete from sys_group_business where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysGroupBusinessByIds" parameterType="String">
|
||||
delete from sys_group_business where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
465
ibs/src/main/resources/mapper/list/SysGroupCustomerMapper.xml
Normal file
465
ibs/src/main/resources/mapper/list/SysGroupCustomerMapper.xml
Normal file
@@ -0,0 +1,465 @@
|
||||
<?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.ibs.list.mapper.SysGroupCustomerMapper">
|
||||
|
||||
<resultMap type="SysGroupCustomer" id="SysGroupCustomerResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="groupId" column="group_id" />
|
||||
<result property="custId" column="cust_id" />
|
||||
<result property="custName" column="cust_name" />
|
||||
<result property="custIdc" column="cust_idc" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<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="delFlag" column="del_flag" />
|
||||
<result property="gridId" column="grid_id" />
|
||||
<result property="pushStatus" column="push_status" />
|
||||
<result property="custPhone" column="cust_phone" />
|
||||
<result property="gridName" column="grid_name" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="custIsn" column="cust_isn" />
|
||||
<result property="deptName" column="deptName" />
|
||||
<result property="tellerId" column="teller_id" />
|
||||
<result property="gridName2" column="grid_name2" />
|
||||
<result property="idType" column="id_type" />
|
||||
<result property="outlets" column="outlets" />
|
||||
<result property="lpName" column="lp_name" />
|
||||
<result property="socialCreditCode" column="social_credit_code" />
|
||||
<result property="socialCreditCodeType" column="social_credit_code_type" />
|
||||
<result property="custType" column="cust_type" />
|
||||
<result property="outletsId" column="outlets_id" />
|
||||
|
||||
</resultMap>
|
||||
|
||||
|
||||
<resultMap type="CustomerList" id="CustomerList">
|
||||
<result property="groupName" column="group_name" />
|
||||
<result property="custId" column="cust_id" />
|
||||
<result property="custIdc" column="cust_idc" />
|
||||
<result property="custIsn" column="cust_isn" />
|
||||
<result property="custName" column="cust_name" />
|
||||
<result property="custPhone" column="cust_phone" />
|
||||
<result property="pushStatus" column="push_status" />
|
||||
<result property="gridName" column="grid_name" />
|
||||
<result property="gridName2" column="grid_name2" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="groupId" column="group_id" />
|
||||
<result property="outlets" column="outlets" />
|
||||
<result property="tellerId" column="teller_id" />
|
||||
<result property="lpName" column="lp_name" />
|
||||
<result property="socialCreditCode" column="social_credit_code" />
|
||||
<result property="idType" column="id_type" />
|
||||
<result property="custType" column="cust_type" />
|
||||
<result property="socialCreditCodeType" column="social_credit_code_type" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="custLb" column="cust_lb" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysGroupCustomerVo">
|
||||
select id, group_id, cust_id, cust_name, cust_idc, dept_id, user_id, create_by, create_time, update_by, update_time, remark, del_flag, grid_id,
|
||||
push_status, cust_phone, grid_name, user_name,cust_isn,dept_name,teller_id,grid_name2,id_type,outlets,lp_name,social_credit_code,social_credit_code_type,cust_type,outlets_id
|
||||
from sys_group_customer
|
||||
</sql>
|
||||
|
||||
<select id="selectSysGroupCustomerList" parameterType="SysGroupCustomer" resultMap="SysGroupCustomerResult">
|
||||
<include refid="selectSysGroupCustomerVo"/>
|
||||
<where>
|
||||
<if test="groupId != null and groupId != ''"> and group_id = #{groupId}</if>
|
||||
<if test="custId != null and custId != ''"> and cust_id = #{custId}</if>
|
||||
<if test="custName != null and custName != ''"> and cust_name like concat('%', #{custName}, '%')</if>
|
||||
<if test="custIdc != null and custIdc != ''"> and cust_idc = #{custIdc}</if>
|
||||
<if test="deptId != null "> and dept_id in
|
||||
(select dept_id from sys_dept where dept_id = #{deptId} or find_in_set(#{deptId},ancestors))</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="gridId != null "> and grid_id = #{gridId}</if>
|
||||
<if test="pushStatus != null and pushStatus != ''"> and push_status = #{pushStatus}</if>
|
||||
<if test="custPhone != null and custPhone != ''"> and cust_phone = #{custPhone}</if>
|
||||
<if test="gridName != null and gridName != ''"> and grid_name like concat('%', #{gridName}, '%')</if>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysGroupCustomerListIds" resultMap="SysGroupCustomerResult">
|
||||
select distinct sgc.cust_id, sgc.cust_name, sgc.cust_idc, sgc.dept_id, su.user_id as user_id, sgc.del_flag, sgc.grid_id,
|
||||
sgc.push_status, sgc.cust_phone, sgc.grid_name, sgc.user_name,sgc.cust_isn,sgc.dept_name,
|
||||
sgc.teller_id,sgc.grid_name2,sgc.id_type,sgc.outlets,sgc.lp_name,sgc.social_credit_code,
|
||||
sgc.social_credit_code_type,sgc.cust_type, sgc.outlets_id
|
||||
from sys_group_customer sgc
|
||||
left join sys_campaign_group scg on scg.group_id = sgc.group_id
|
||||
left join sys_campaign_group_customer scgc on scg.campaign_id = scgc.campaign_id
|
||||
left join sys_user su on sgc.teller_id = su.user_name
|
||||
<where>
|
||||
sgc.push_status = '1' and
|
||||
sgc.group_id in
|
||||
<foreach collection="groupIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
<if test="custFlag != null and custFlag !='' ">
|
||||
and sgc.cust_id in
|
||||
<foreach collection="custIds" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="filter != null and filter != ''"> and scgc.user_id is null </if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysGroupCustomerList2" parameterType="SysGroupCustomer" resultMap="SysGroupCustomerResult">
|
||||
<include refid="selectSysGroupCustomerVo"/>
|
||||
<where>
|
||||
<if test="groupId != null and groupId != ''"> and group_id = #{groupId}</if>
|
||||
<if test="custId != null and custId != ''"> and cust_id = #{custId}</if>
|
||||
<if test="custName != null and custName != ''"> and cust_name like concat('%', #{custName}, '%')</if>
|
||||
<if test="custIdc != null and custIdc != ''"> and cust_idc = #{custIdc}</if>
|
||||
<if test="deptId != null "> and dept_id in
|
||||
(select dept_id from sys_dept where dept_id = #{deptId} or find_in_set(#{deptId},ancestors))</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="gridId != null "> and grid_id = #{gridId}</if>
|
||||
<if test="pushStatus != null and pushStatus != ''"> and push_status = #{pushStatus}</if>
|
||||
<if test="custPhone != null and custPhone != ''"> and cust_phone = #{custPhone}</if>
|
||||
<if test="gridName != null and gridName != ''"> and grid_name like concat('%', #{gridName}, '%')</if>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysGroupCustomerListExport" resultMap="CustomerList">
|
||||
select
|
||||
sg.group_id,sg.group_name,
|
||||
sgc.cust_name,
|
||||
sgc.cust_phone,
|
||||
sgc.cust_id,
|
||||
sgc.cust_idc,sgc.cust_isn,
|
||||
sgc.push_status,
|
||||
sgc.grid_name ,
|
||||
sgc.grid_name2 ,
|
||||
sgc.user_name,
|
||||
sgc.dept_name,
|
||||
sgc.teller_id,sgc.outlets,sgc.id_type,sg.cust_type,sgc.lp_name,sgc.social_credit_code
|
||||
from
|
||||
sys_group_customer sgc
|
||||
inner join sys_group sg on
|
||||
sgc.group_id = sg.group_id
|
||||
<where>
|
||||
1 = 1
|
||||
<if test="groupId != null and groupId != ''">
|
||||
and sgc.group_id = #{groupId}
|
||||
</if>
|
||||
<if test="pushStatus != null and pushStatus != ''">
|
||||
and sgc.push_status = #{pushStatus}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysGroupCustomerListExportByCustIds" resultMap="CustomerList">
|
||||
select
|
||||
sg.group_id,sg.group_name,
|
||||
sgc.cust_name,
|
||||
sgc.cust_phone,
|
||||
sgc.cust_id,
|
||||
sgc.cust_idc,sgc.cust_isn,
|
||||
sgc.push_status,
|
||||
sgc.grid_name ,
|
||||
sgc.grid_name2 ,
|
||||
sgc.user_name,
|
||||
sgc.dept_name,
|
||||
sgc.teller_id,sgc.outlets,sgc.id_type,sg.cust_type,sgc.lp_name,sgc.social_credit_code,sgc.create_time,sgc.dept_id,sgc.social_credit_code_type,
|
||||
CASE sgc.cust_lb
|
||||
WHEN 0 THEN '是'
|
||||
WHEN 1 THEN '否'
|
||||
END AS cust_lb
|
||||
from
|
||||
sys_group_customer sgc
|
||||
inner join sys_group sg on
|
||||
sgc.group_id = sg.group_id
|
||||
<where>
|
||||
<if test="groupId != null and groupId != ''">
|
||||
sgc.group_id = #{groupId}
|
||||
</if>
|
||||
and sgc.cust_id in <foreach collection="custIds" index="index" item="item" open="(" separator="," close=")">#{item}</foreach>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectSysGroupCustomerById" parameterType="Long" resultMap="SysGroupCustomerResult">
|
||||
<include refid="selectSysGroupCustomerVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysGroupCustomer" parameterType="SysGroupCustomer" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_group_customer
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="groupId != null">group_id,</if>
|
||||
<if test="custId != null">cust_id,</if>
|
||||
<if test="custName != null">cust_name,</if>
|
||||
<if test="custIdc != null">cust_idc,</if>
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="userId != null">user_id,</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="delFlag != null">del_flag,</if>
|
||||
<if test="gridId != null">grid_id,</if>
|
||||
<if test="pushStatus != null">push_status,</if>
|
||||
<if test="custPhone != null">cust_phone,</if>
|
||||
<if test="gridName != null">grid_name,</if>
|
||||
<if test="userName != null">user_name,</if>
|
||||
<if test="custIsn != null">cust_isn,</if>
|
||||
<if test="deptName != null">dept_name,</if>
|
||||
<if test="tellerId != null">teller_id,</if>
|
||||
<if test="gridName2 != null">grid_name2,</if>
|
||||
<if test="idType != null">id_type,</if>
|
||||
<if test="outlets != null">outlets,</if>
|
||||
<if test="lpName != null">lp_name,</if>
|
||||
<if test="socialCreditCode != null">social_credit_code,</if>
|
||||
<if test="socialCreditCodeType != null">social_credit_code_type,</if>
|
||||
<if test="custType != null">cust_type,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="groupId != null">#{groupId},</if>
|
||||
<if test="custId != null">#{custId},</if>
|
||||
<if test="custName != null">#{custName},</if>
|
||||
<if test="custIdc != null">#{custIdc},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="userId != null">#{userId},</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="delFlag != null">#{delFlag},</if>
|
||||
<if test="gridId != null">#{gridId},</if>
|
||||
<if test="pushStatus != null">#{pushStatus},</if>
|
||||
<if test="custPhone != null">#{custPhone},</if>
|
||||
<if test="gridName != null">#{gridName},</if>
|
||||
<if test="userName != null">#{userName},</if>
|
||||
<if test="custIsn != null">#{custIsn},</if>
|
||||
<if test="deptName != null">#{deptName},</if>
|
||||
<if test="tellerId != null">#{tellerId},</if>
|
||||
<if test="gridName2 != null">#{gridName2},</if>
|
||||
<if test="idType != null">#{idType},</if>
|
||||
<if test="outlets != null">#{outlets},</if>
|
||||
<if test="lpName != null">#{lpName},</if>
|
||||
<if test="socialCreditCode != null">#{socialCreditCode},</if>
|
||||
<if test="socialCreditCodeType != null">#{socialCreditCodeType},</if>
|
||||
<if test="custType != null">#{custType},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysGroupCustomer" parameterType="SysGroupCustomer">
|
||||
update sys_group_customer
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="groupId != null">group_id = #{groupId},</if>
|
||||
<if test="custId != null">cust_id = #{custId},</if>
|
||||
<if test="custName != null">cust_name = #{custName},</if>
|
||||
<if test="custIdc != null">cust_idc = #{custIdc},</if>
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="userId != null">user_id = #{userId},</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="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="gridId != null">grid_id = #{gridId},</if>
|
||||
<if test="pushStatus != null">push_status = #{pushStatus},</if>
|
||||
<if test="custPhone != null">cust_phone = #{custPhone},</if>
|
||||
<if test="gridName != null">grid_name = #{gridName},</if>
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="custIsn != null">cust_isn = #{custIsn},</if>
|
||||
<if test="deptName != null">dept_name = #{deptName},</if>
|
||||
<if test="tellerId != null">teller_id = #{tellerId},</if>
|
||||
<if test="gridName2 != null">grid_name2 = #{gridName2},</if>
|
||||
<if test="idType != null">id_type = #{idType},</if>
|
||||
<if test="outlets != null">outlets = #{outlets},</if>
|
||||
<if test="lpName != null">lp_name = #{lpName},</if>
|
||||
<if test="socialCreditCode != null">social_credit_code = #{socialCreditCode},</if>
|
||||
<if test="socialCreditCodeType != null">social_credit_code_type = #{socialCreditCodeType},</if>
|
||||
<if test="custType != null">cust_type = #{custType},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysGroupCustomerById" parameterType="Long">
|
||||
delete from sys_group_customer where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysGroupCustomerByIds" parameterType="String">
|
||||
delete from sys_group_customer where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getCustNumByGroupId" parameterType="String">
|
||||
select count(*) from sys_group_customer where group_id = #{groupId};
|
||||
</select>
|
||||
|
||||
<select id="getUserInfoList" parameterType="ListSelectForUser">
|
||||
select user_name from sys_group_customer where group_id = #{groupId} and cust_id = #{custId}
|
||||
</select>
|
||||
|
||||
<select id="getGridInfoList" parameterType="ListSelectForUser">
|
||||
select grid_name from sys_group_customer where group_id = #{groupId} and cust_id = #{custId}
|
||||
</select>
|
||||
|
||||
<update id="updateOutletsIdAndUserIdByUsername" parameterType="String">
|
||||
update sys_group_customer sgc set sgc.user_id = (select u.user_id from sys_user u where u.user_name = sgc.teller_id ),sgc.outlets_id = (select u.dept_id from sys_user u inner join sys_dept sd on u.dept_id = sd.dept_id where u.user_name = sgc.teller_id and sd.dept_type = 'outlet' ),sgc.outlets = (select sd.dept_name from sys_user u inner join sys_dept sd on u.dept_id = sd.dept_id where u.user_name = sgc.teller_id and sd.dept_type = 'outlet' ) where group_id = #{groupId}
|
||||
</update>
|
||||
|
||||
<update id="updateCustIdAndCustIsn" parameterType="String">
|
||||
<if test="custType == 0">
|
||||
update sys_group_customer sgc set sgc.cust_id = (select cust_id from cust_info_retail c where c.cust_idc = sgc.cust_idc limit 1 ),sgc.cust_isn = (select cust_isn from cust_info_retail c where c.cust_idc = sgc.cust_idc limit 1) where group_id = #{groupId} and cust_idc in
|
||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="custType == 1">
|
||||
update sys_group_customer sgc set sgc.cust_id = (select cust_id from cust_info_merchant c where c.cust_idc = sgc.cust_idc limit 1),sgc.cust_isn = (select cust_isn from cust_info_merchant c where c.cust_idc = sgc.cust_idc limit 1) where group_id = #{groupId} and cust_idc in
|
||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="custType == 2">
|
||||
update sys_group_customer sgc set sgc.cust_id = (select cust_id from cust_info_business c where c.cust_idc = sgc.cust_idc limit 1),sgc.cust_isn = (select cust_isn from cust_info_business c where c.cust_idc = sgc.cust_idc limit 1) where group_id = #{groupId} and cust_idc in
|
||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
</update>
|
||||
|
||||
|
||||
<select id="selectCustIds" parameterType="String" resultType="String">
|
||||
<if test="custType == 0">
|
||||
select cust_id from cust_info_retail c where c.cust_id in
|
||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="custType == 1">
|
||||
select cust_id from cust_info_merchant c where c.cust_id in
|
||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="custType == 2">
|
||||
select cust_id from cust_info_business c where c.cust_id in
|
||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
<update id="updateCustIdAndCustIsnBySocialCreditCode" parameterType="String">
|
||||
<if test="custType == 1">
|
||||
update sys_group_customer sgc set sgc.cust_id = (select cust_id from cust_info_merchant c where c.social_credit_code = sgc.social_credit_code limit 1),sgc.cust_isn = (select cust_isn from cust_info_merchant c where c.social_credit_code = sgc.social_credit_code limit 1) where group_id = #{groupId} and social_credit_code in
|
||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="custType == 2">
|
||||
update sys_group_customer sgc set sgc.cust_id = (select cust_id from cust_info_business c where c.social_credit_code = sgc.social_credit_code limit 1),sgc.cust_isn = (select cust_isn from cust_info_business c where c.social_credit_code = sgc.social_credit_code limit 1) where group_id = #{groupId} and social_credit_code in
|
||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
</update>
|
||||
|
||||
|
||||
<insert id="insertSysGroupCustomerBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_group_customer
|
||||
(group_id,cust_id,cust_name,cust_idc,dept_id,user_id,create_by,create_time,update_by,
|
||||
update_time,remark,del_flag,grid_id,push_status,cust_phone,grid_name,user_name,cust_isn,
|
||||
dept_name,teller_id,grid_name2,id_type,outlets,lp_name,social_credit_code,social_credit_code_type,cust_type,cust_lb,outlets_id)
|
||||
values
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
|
||||
(#{item.groupId},#{item.custId},#{item.custName},#{item.custIdc},#{item.deptId},#{item.userId},#{item.createBy},#{item.createTime},
|
||||
#{item.updateBy},#{item.updateTime},#{item.remark},#{item.delFlag},#{item.gridId},#{item.pushStatus},#{item.custPhone},#{item.gridName},
|
||||
#{item.userName},#{item.custIsn},#{item.deptName},#{item.tellerId},#{item.gridName2},#{item.idType},#{item.outlets},#{item.lpName},
|
||||
#{item.socialCreditCode},#{item.socialCreditCodeType},#{item.custType},#{item.custLb},#{item.outletsId})
|
||||
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysGroupCustomerBatch">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
update sys_group_customer
|
||||
<set>
|
||||
<if test="item.groupId != null">group_id = #{item.groupId},</if>
|
||||
<if test="item.custId != null">cust_id = #{item.custId},</if>
|
||||
<if test="item.custName != null">cust_name = #{item.custName},</if>
|
||||
<if test="item.custIdc != null">cust_idc = #{item.custIdc},</if>
|
||||
<if test="item.deptId != null">dept_id = #{item.deptId},</if>
|
||||
<if test="item.userId != null">user_id = #{item.userId},</if>
|
||||
<if test="item.createBy != null">create_by = #{item.createBy},</if>
|
||||
<if test="item.createTime != null">create_time = #{item.createTime},</if>
|
||||
<if test="item.updateBy != null">update_by = #{item.updateBy},</if>
|
||||
<if test="item.updateTime != null">update_time = #{item.updateTime},</if>
|
||||
<if test="item.remark != null">remark = #{item.remark},</if>
|
||||
<if test="item.delFlag != null">del_flag = #{item.delFlag},</if>
|
||||
<if test="item.gridId != null">grid_id = #{item.gridId},</if>
|
||||
<if test="item.pushStatus != null">push_status = #{item.pushStatus},</if>
|
||||
<if test="item.custPhone != null">cust_phone = #{item.custPhone},</if>
|
||||
<if test="item.gridName != null">grid_name = #{item.gridName},</if>
|
||||
<if test="item.userName != null">user_name = #{item.userName},</if>
|
||||
<if test="item.custIsn != null">cust_isn = #{item.custIsn},</if>
|
||||
<if test="item.deptName != null">dept_name = #{item.deptName},</if>
|
||||
<if test="item.tellerId != null">teller_id = #{item.tellerId},</if>
|
||||
<if test="item.gridName2 != null">grid_name2 = #{item.gridName2},</if>
|
||||
<if test="item.idType != null">id_type = #{item.idType},</if>
|
||||
<if test="item.outlets != null">outlets = #{item.outlets},</if>
|
||||
<if test="item.lpName != null">lp_name = #{item.lpName},</if>
|
||||
<if test="item.socialCreditCode != null">social_credit_code = #{item.socialCreditCode},</if>
|
||||
<if test="item.socialCreditCodeType != null">social_credit_code_type = #{item.socialCreditCodeType},</if>
|
||||
<if test="item.custType != null">cust_type = #{item.custType},</if>
|
||||
</set>
|
||||
|
||||
<where>
|
||||
id = #{item.id}
|
||||
</where>
|
||||
|
||||
</foreach>
|
||||
|
||||
</update>
|
||||
|
||||
<select id="selectCustIdcBySocialCreditCode" parameterType="String" resultType="java.lang.String">
|
||||
<if test="custType == 1">
|
||||
select cust_idc from cust_info_merchant c where c.social_credit_code = #{socialCreditCode} limit 1
|
||||
</if>
|
||||
<if test="custType == 2">
|
||||
select cust_idc from cust_info_business c where c.social_credit_code = #{socialCreditCode} limit 1
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectCustIdcList" resultMap="SysGroupCustomerResult">
|
||||
<if test="custType == 0">
|
||||
select group_id,cust_id,cust_idc,push_status from sys_group_customer where group_id = #{groupId} and cust_id in
|
||||
</if>
|
||||
<if test="custType == 1 or custType == 2">
|
||||
select group_id,cust_id,social_credit_code,push_status from sys_group_customer where group_id = #{groupId} and cust_id in
|
||||
</if>
|
||||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<delete id="deleteSysGroupCustomerByCustId" parameterType="String">
|
||||
delete from sys_group_customer where group_id = #{groupId} and cust_id = #{custId} and push_status = "2"
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
645
ibs/src/main/resources/mapper/list/SysGroupMapper.xml
Normal file
645
ibs/src/main/resources/mapper/list/SysGroupMapper.xml
Normal file
@@ -0,0 +1,645 @@
|
||||
<?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.ibs.list.mapper.SysGroupMapper">
|
||||
|
||||
<resultMap type="SysGroup" id="SysGroupResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="groupName" column="group_name" />
|
||||
<result property="createType" column="create_type" />
|
||||
<result property="customerNum" column="customer_num" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<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="updateType" column="update_type" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="groupType" column="group_type" />
|
||||
<result property="groupId" column="group_id" />
|
||||
<result property="custType" column="cust_Type" />
|
||||
<result property="createRole" column="create_role" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="SysGroupVo" id="SysGroupVoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="groupName" column="group_name" />
|
||||
<result property="createType" column="create_type" />
|
||||
<result property="customerNum" column="customer_num" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<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="updateType" column="update_type" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="groupType" column="group_type" />
|
||||
<result property="groupId" column="group_id" />
|
||||
<result property="custType" column="cust_Type" />
|
||||
<result property="createRole" column="create_role" />
|
||||
<result property="campaignId" column="campaign_id" />
|
||||
<result property="labelIds" column="label_ids"/>
|
||||
<result property="labelSql" column="label_sql"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="SysGroupRec" id="SysGroupRecResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="groupName" column="group_name" />
|
||||
<result property="createType" column="create_type" />
|
||||
<result property="customerNum" column="customer_num" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<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="updateType" column="update_type" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="groupId" column="group_id" />
|
||||
<result property="custType" column="cust_Type" />
|
||||
<result property="custId" column="cust_id" />
|
||||
<result property="custIdc" column="cust_idc" />
|
||||
<result property="custName" column="cust_name" />
|
||||
<result property="custPhone" column="cust_phone" />
|
||||
<result property="pushStatus" column="push_status" />
|
||||
<result property="gridName" column="grid_name" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="campaignId" column="campaign_id" />
|
||||
<result property="secondPushStatus" column="second_push_status" />
|
||||
<result property="gridName2" column="grid_name2" />
|
||||
<result property="lpName" column="lp_name" />
|
||||
<result property="tellerId" column="teller_id" />
|
||||
<result property="labelIds" column="label_ids"/>
|
||||
<result property="labelSql" column="label_sql"/>
|
||||
<result property="description" column="description"/>
|
||||
<result property="updateTypeRelateTime" column="update_type_relate_time"/>
|
||||
<result property="relateGroupId" column="relate_group_id"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="CustomerList" id="CustomerList">
|
||||
<result property="groupName" column="group_name" />
|
||||
<result property="custId" column="cust_id" />
|
||||
<result property="custIdc" column="cust_idc" />
|
||||
<result property="custIsn" column="cust_isn" />
|
||||
<result property="custName" column="cust_name" />
|
||||
<result property="custPhone" column="cust_phone" />
|
||||
<result property="pushStatus" column="push_status" />
|
||||
<result property="gridName" column="grid_name" />
|
||||
<result property="gridName2" column="grid_name2" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="groupId" column="group_id" />
|
||||
<result property="outlets" column="outlets" />
|
||||
<result property="tellerId" column="teller_id" />
|
||||
<result property="lpName" column="lp_name" />
|
||||
<result property="socialCreditCode" column="social_credit_code" />
|
||||
<result property="socialCreditCodeType" column="social_credit_code_type" />
|
||||
<result property="idType" column="id_type" />
|
||||
<result property="custType" column="cust_type" />
|
||||
<result property="tellerNameWithId" column="teller_name_with_id" />
|
||||
<result property="branchId" column="branch_id" />
|
||||
<result property="branchName" column="branch_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysGroup">
|
||||
select id,group_id, group_name, create_type, customer_num, dept_id, user_id, create_by, create_time, update_by, update_time, update_type, status, remark, del_flag,group_type,cust_type,create_role , label_ids,label_sql, description, update_type_relate_time, relate_group_id from sys_group
|
||||
</sql>
|
||||
<sql id="selectSysGroupVo">
|
||||
select sg.id,sg.group_id, sg.group_name, sg.create_type, sg.customer_num, sg.dept_id, sg.user_id, concat(su.nick_name,'-',sg.create_by) as create_by, sg.create_time, sg.update_by, sg.update_time, sg.update_type, sg.status, sg.remark, sg.del_flag,sg.group_type,sg.cust_type,sg.create_role
|
||||
from sys_group sg left join sys_user su on sg.create_by = su.user_name
|
||||
</sql>
|
||||
|
||||
<select id="selectSysGroupList" parameterType="String" resultMap="SysGroupVoResult">
|
||||
<include refid="selectSysGroupVo"/>
|
||||
<where>
|
||||
sg.del_flag = '0'
|
||||
<if test="groupName != null and groupName != ''"> and sg.group_name like concat('%', #{groupName}, '%')</if>
|
||||
<if test="deptId != null "> and sg.dept_id div 1000 = #{deptId}</if>
|
||||
<if test="createBy != null "> and sg.create_by = #{createBy}</if>
|
||||
<if test="type == 0 "> and sg.cust_type = '2' </if>
|
||||
<if test="type == 1 "> and sg.cust_type != '2' </if>
|
||||
</where>
|
||||
order by sg.create_time desc
|
||||
<if test="updateTimeSort == null "> ,update_time desc</if>
|
||||
<if test="updateTimeSort == 0 "> ,update_time asc</if>
|
||||
<if test="updateTimeSort == 1 "> , update_time desc</if>
|
||||
|
||||
<if test="customerNumSort == 0 "> , customer_num asc</if>
|
||||
<if test="customerNumSort == 1 "> , customer_num desc</if>
|
||||
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectSysGroupList1" parameterType="String" resultMap="SysGroupVoResult">
|
||||
select sg.id,sg.group_id, sg.group_name, sg.create_type, sg.customer_num, sg.dept_id, sg.user_id, concat(su.nick_name,'-',sg.create_by) as create_by, sg.create_time, sg.update_by, sg.update_time, sg.update_type, sg.status, sg.remark, sg.del_flag,sg.group_type,sg.cust_type,sg.create_role
|
||||
from sys_group sg left join sys_user su on sg.create_by = su.user_name
|
||||
<where>
|
||||
sg.del_flag = '0'
|
||||
<if test="groupName != null and groupName != ''"> and sg.group_name like concat('%', #{groupName}, '%')</if>
|
||||
<if test="deptId != null "> and sg.dept_id = #{deptId}</if>
|
||||
<if test="createBy != null "> and sg.create_by = #{createBy}</if>
|
||||
</where>
|
||||
order by sg.create_time desc
|
||||
<if test="updateTimeSort == null "> , update_time desc</if>
|
||||
<if test="updateTimeSort == 0 "> , update_time asc</if>
|
||||
<if test="updateTimeSort == 1 "> ,update_time desc</if>
|
||||
<if test="customerNumSort == 0 "> , customer_num asc</if>
|
||||
<if test="customerNumSort == 1 "> , customer_num desc</if>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectSysGroupList5" parameterType="String" resultMap="CustomerList">
|
||||
select scgc.group_id,sg.group_name,
|
||||
sgc.cust_name,sgc.cust_phone ,scgc.cust_id,sgc.cust_idc,sgc.cust_isn,
|
||||
scgc.push_status ,scgc.grid_name,scgc.grid_name2,
|
||||
su.nick_name as user_name,sd.dept_name,su.user_name as teller_id,scgc.outlets,sgc.id_type,sg.cust_type,sgc.lp_name,sgc.social_credit_code,sgc.social_credit_code_type
|
||||
from sys_campaign_group_customer scgc inner join sys_group_customer sgc on
|
||||
scgc.group_id = sgc.group_id and scgc.cust_id = sgc.cust_id
|
||||
inner join sys_group sg on scgc.group_id = sg.group_id inner join sys_dept sd on scgc.dept_id = sd.dept_id left join sys_user su on scgc.user_id = su.user_id
|
||||
<where>
|
||||
<if test="groupId != null and groupId != ''"> and scgc.group_id = #{groupId}</if>
|
||||
<if test="deptId != null "> and scgc.dept_id = #{deptId}</if>
|
||||
<if test="custId != null and custId != ''"> and scgc.cust_id like concat('%', #{custId}, '%') </if>
|
||||
<if test="custIdc != null and custIdc != ''"> and sgc.cust_idc like concat('%', #{custIdc}, '%') </if>
|
||||
<if test="custIsn != null and custIsn != ''"> and sgc.cust_isn like concat('%', #{custIsn}, '%') </if>
|
||||
<if test="gridName != null and gridName != ''"> and scgc.grid_name like concat('%', #{gridName}, '%')</if>
|
||||
<if test="gridName2 != null and gridName2 != ''"> and scgc.grid_name2 like concat('%', #{gridName2}, '%')</if>
|
||||
<if test="custName != null and custName != ''"> and sgc.cust_name like concat('%', #{custName}, '%')</if>
|
||||
<if test="deptName != null and deptName != ''"> and sd.dept_name like concat('%', #{deptName}, '%')</if>
|
||||
<if test="outlets != null and outlets != ''"> and scgc.outlets like concat('%', #{outlets}, '%')</if>
|
||||
<if test="username != null and username != ''"> and su.nick_name like concat('%', #{username}, '%')</if>
|
||||
<if test="socialCreditCode != null and socialCreditCode != ''"> and sgc.social_credit_code like concat('%', #{socialCreditCode}, '%')</if>
|
||||
<if test="pushStatus != null and pushStatus != ''"> and scgc.push_status = #{pushStatus}</if>
|
||||
</where>
|
||||
|
||||
union all
|
||||
|
||||
select
|
||||
sg.group_id,sg.group_name,
|
||||
sgc.cust_name,
|
||||
sgc.cust_phone,
|
||||
sgc.cust_id,
|
||||
sgc.cust_idc,sgc.cust_isn,
|
||||
sgc.push_status,
|
||||
sgc.grid_name ,
|
||||
sgc.grid_name2 ,
|
||||
sgc.user_name,
|
||||
sgc.dept_name,
|
||||
sgc.teller_id,sgc.outlets,sgc.id_type,sg.cust_type,sgc.lp_name,sgc.social_credit_code,sgc.social_credit_code_type
|
||||
from
|
||||
sys_group_customer sgc
|
||||
inner join sys_group sg on
|
||||
sgc.group_id = sg.group_id
|
||||
left join sys_campaign sc on
|
||||
sc.group_id = sgc.group_id
|
||||
<where>
|
||||
<if test="groupId != null and groupId != ''">
|
||||
sgc.group_id = #{groupId}
|
||||
</if>
|
||||
<if test="deptId != null "> and sgc.dept_id = #{deptId}</if>
|
||||
<if test="custId != null and custId != ''">
|
||||
and sgc.cust_id like concat('%', #{custId}, '%')
|
||||
</if>
|
||||
<if test="custIdc != null and custIdc != ''"> and sgc.cust_idc like concat('%', #{custIdc}, '%')</if>
|
||||
<if test="custIsn != null and custIsn != ''"> and sgc.cust_isn like concat('%', #{custIsn}, '%') </if>
|
||||
<if test="gridName != null and gridName != ''"> and sgc.grid_name like concat('%', #{gridName}, '%')</if>
|
||||
<if test="gridName2 != null and gridName2 != ''"> and sgc.grid_name2 like concat('%', #{gridName2}, '%')</if>
|
||||
<if test="custName != null and custName != ''"> and sgc.cust_name like concat('%', #{custName}, '%')</if>
|
||||
<if test="deptName != null and deptName != ''"> and sgc.dept_name like concat('%', #{deptName}, '%')</if>
|
||||
<if test="outlets != null and outlets != ''"> and sgc.outlets like concat('%', #{outlets}, '%')</if>
|
||||
<if test="username != null and username != ''"> and sgc.user_name like concat('%', #{username}, '%')</if>
|
||||
<if test="socialCreditCode != null and socialCreditCode != ''"> and sgc.social_credit_code like concat('%', #{socialCreditCode}, '%')</if>
|
||||
<if test="pushStatus == null or pushStatus ==''">
|
||||
and (sgc.push_status = '0' or sgc.push_status = '2')
|
||||
</if>
|
||||
<if test="pushStatus != null and pushStatus != '' and pushStatus=='1'.toString()">
|
||||
and sgc.push_status = '3'
|
||||
</if>
|
||||
<if test="pushStatus != null and pushStatus != '' and pushStatus!='1'.toString()">
|
||||
and sgc.push_status = #{pushStatus}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectSysGroupListImport" parameterType="String" resultMap="CustomerList">
|
||||
select
|
||||
sg.group_id,sg.group_name,
|
||||
sgc.cust_name,
|
||||
sgc.cust_phone,
|
||||
sgc.cust_id,
|
||||
sgc.cust_idc,sgc.cust_isn,
|
||||
sgc.push_status,
|
||||
sgc.grid_name ,
|
||||
sgc.grid_name2 ,
|
||||
sgc.user_name,
|
||||
sgc.dept_name,
|
||||
sgc.dept_id,
|
||||
sgc.teller_id,sgc.outlets,sgc.id_type,sg.cust_type,sgc.lp_name,sgc.social_credit_code,sgc.social_credit_code_type,sgc.create_time, sgc.cust_lb, sgc.outlets_id,
|
||||
sgc.remark,
|
||||
CONCAT(su.nick_name, '-', su.user_name) as teller_name_with_id, dep.parent_id as branch_id, dep.parent_name as branch_name
|
||||
from
|
||||
sys_group_customer sgc
|
||||
inner join sys_group sg on
|
||||
sgc.group_id = sg.group_id
|
||||
left join sys_user su on sgc.teller_id = su.user_name
|
||||
left join
|
||||
(SELECT
|
||||
sd.dept_id,
|
||||
sd.dept_name,
|
||||
sd.parent_id,
|
||||
sd_parent.dept_name AS parent_name
|
||||
FROM sys_dept sd
|
||||
LEFT JOIN sys_dept sd_parent ON sd.parent_id = sd_parent.dept_id
|
||||
)dep on sgc.outlets_id = dep.dept_id
|
||||
<where>
|
||||
<if test="groupId != null and groupId != ''">
|
||||
sgc.group_id = #{groupId}
|
||||
</if>
|
||||
<if test="deptId != null "> and sgc.dept_id = #{deptId}</if>
|
||||
<if test="custId != null and custId != ''">
|
||||
and sgc.cust_id like concat('%', #{custId}, '%')
|
||||
</if>
|
||||
<if test="custIdc != null and custIdc != ''"> and sgc.cust_idc like concat('%', #{custIdc}, '%')</if>
|
||||
<if test="custName != null and custName != ''"> and sgc.cust_name like concat('%', #{custName}, '%')</if>
|
||||
<if test="socialCreditCode != null and socialCreditCode != ''"> and sgc.social_credit_code like concat('%', #{socialCreditCode}, '%')</if>
|
||||
<if test="tellerId != null and tellerId != ''"> and sgc.teller_id like concat('%', #{tellerId}, '%')</if>
|
||||
<if test="pushStatus != null and pushStatus != ''"> and sgc.push_status = #{pushStatus}</if>
|
||||
</where>
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectSysGroupList3" parameterType="String" resultMap="CustomerList">
|
||||
select scgc.group_id,sg.group_name,
|
||||
sgc.cust_name,sgc.cust_phone ,scgc.cust_id,sgc.cust_idc,sgc.cust_isn,
|
||||
scgc.push_status ,scgc.grid_name,scgc.grid_name2,
|
||||
su.nick_name as user_name,sd.dept_name,su.user_name as teller_id,scgc.outlets,sgc.id_type,sg.cust_type,sgc.lp_name,sgc.social_credit_code,sgc.social_credit_code_type
|
||||
from sys_campaign_group_customer scgc inner join sys_group_customer sgc on
|
||||
scgc.group_id = sgc.group_id and scgc.cust_id = sgc.cust_id
|
||||
inner join sys_group sg on scgc.group_id = sg.group_id inner join sys_dept sd on scgc.dept_id = sd.dept_id left join sys_user su on scgc.user_id = su.user_id
|
||||
<where>
|
||||
<if test="groupId != null and groupId != ''"> and scgc.group_id = #{groupId}</if>
|
||||
<if test="custId != null and custId != ''"> and scgc.cust_id like concat('%', #{custId}, '%') </if>
|
||||
<if test="custIdc != null and custIdc != ''"> and sgc.cust_idc like concat('%', #{custIdc}, '%') </if>
|
||||
<if test="custIsn != null and custIsn != ''"> and sgc.cust_isn like concat('%', #{custIsn}, '%') </if>
|
||||
<if test="gridName != null and gridName != ''"> and scgc.grid_name like concat('%', #{gridName}, '%')</if>
|
||||
<if test="gridName2 != null and gridName2 != ''"> and scgc.grid_name2 like concat('%', #{gridName2}, '%')</if>
|
||||
<if test="custName != null and custName != ''"> and sgc.cust_name like concat('%', #{custName}, '%')</if>
|
||||
<if test="deptName != null and deptName != ''"> and sd.dept_name like concat('%', #{deptName}, '%')</if>
|
||||
<if test="outlets != null and outlets != ''"> and scgc.outlets like concat('%', #{outlets}, '%')</if>
|
||||
<if test="username != null and username != ''"> and su.nick_name like concat('%', #{username}, '%')</if>
|
||||
<if test="socialCreditCode != null and socialCreditCode != ''"> and sgc.social_credit_code like concat('%', #{socialCreditCode}, '%')</if>
|
||||
<if test="pushStatus != null and pushStatus != ''"> and scgc.push_status = #{pushStatus}</if>
|
||||
<if test="deptId != null and deptId != ''"> and scgc.dept_id in
|
||||
(select dept_id from sys_dept where dept_id = #{deptId} or find_in_set(#{deptId},ancestors))
|
||||
</if>
|
||||
</where>
|
||||
|
||||
union all
|
||||
|
||||
select
|
||||
sg.group_id,sg.group_name,
|
||||
sgc.cust_name,
|
||||
sgc.cust_phone,
|
||||
sgc.cust_id,
|
||||
sgc.cust_idc,sgc.cust_isn,
|
||||
sgc.push_status,
|
||||
sgc.grid_name ,
|
||||
sgc.grid_name2 ,
|
||||
sgc.user_name,
|
||||
sgc.dept_name,
|
||||
sgc.teller_id,sgc.outlets,sgc.id_type,sg.cust_type,sgc.lp_name,sgc.social_credit_code,sgc.social_credit_code_type
|
||||
from
|
||||
sys_group_customer sgc
|
||||
inner join sys_group sg on
|
||||
sgc.group_id = sg.group_id
|
||||
left join sys_campaign sc on
|
||||
sc.group_id = sgc.group_id
|
||||
<where>
|
||||
<if test="groupId != null and groupId != ''">
|
||||
sgc.group_id = #{groupId}
|
||||
</if>
|
||||
<if test="custId != null and custId != ''">
|
||||
and sgc.cust_id like concat('%', #{custId}, '%')
|
||||
</if>
|
||||
<if test="custIdc != null and custIdc != ''"> and sgc.cust_idc like concat('%', #{custIdc}, '%')</if>
|
||||
<if test="custIsn != null and custIsn != ''"> and sgc.cust_isn like concat('%', #{custIsn}, '%') </if>
|
||||
<if test="gridName != null and gridName != ''"> and sgc.grid_name like concat('%', #{gridName}, '%')</if>
|
||||
<if test="gridName2 != null and gridName2 != ''"> and sgc.grid_name2 like concat('%', #{gridName2}, '%')</if>
|
||||
<if test="custName != null and custName != ''"> and sgc.cust_name like concat('%', #{custName}, '%')</if>
|
||||
<if test="deptName != null and deptName != ''"> and sgc.dept_name like concat('%', #{deptName}, '%')</if>
|
||||
<if test="outlets != null and outlets != ''"> and sgc.outlets like concat('%', #{outlets}, '%')</if>
|
||||
<if test="username != null and username != ''"> and sgc.user_name like concat('%', #{username}, '%')</if>
|
||||
<if test="socialCreditCode != null and socialCreditCode != ''"> and sgc.social_credit_code like concat('%', #{socialCreditCode}, '%')</if>
|
||||
<if test="pushStatus == null or pushStatus ==''">
|
||||
and (sgc.push_status = '0' or sgc.push_status = '2')
|
||||
</if>
|
||||
<if test="pushStatus != null and pushStatus != '' and pushStatus=='1'.toString()">
|
||||
and sgc.push_status = '3'
|
||||
</if>
|
||||
<if test="pushStatus != null and pushStatus != '' and pushStatus!='1'.toString()">
|
||||
and sgc.push_status = #{pushStatus}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectSysGroupList2" parameterType="String" resultMap="CustomerList">
|
||||
select scgc.group_id,sg.group_name,
|
||||
sgc.cust_name,sgc.cust_phone ,scgc.cust_id,sgc.cust_idc,sgc.cust_isn,
|
||||
sgc.remark,
|
||||
scgc.push_status ,scgc.grid_name,scgc.grid_name2,
|
||||
su.nick_name as user_name,sd.dept_name,su.user_name as teller_id,scgc.outlets,sgc.id_type,sg.cust_type,sgc.lp_name,sgc.social_credit_code,sgc.social_credit_code_type, sgc.create_time, sgc.cust_lb
|
||||
from sys_campaign_group_customer scgc inner join sys_group_customer sgc on
|
||||
scgc.group_id = sgc.group_id and scgc.cust_id = sgc.cust_id
|
||||
inner join sys_group sg on scgc.group_id = sg.group_id inner join sys_dept sd on scgc.dept_id = sd.dept_id left join sys_user su on scgc.user_id = su.user_id
|
||||
<where>
|
||||
scgc.org_claim_status in ('0','1')
|
||||
<if test="groupId != null and groupId != ''"> and scgc.group_id = #{groupId}</if>
|
||||
<if test="custId != null and custId != ''"> and scgc.cust_id like concat('%', #{custId}, '%') </if>
|
||||
<if test="custIdc != null and custIdc != ''"> and sgc.cust_idc like concat('%', #{custIdc}, '%') </if>
|
||||
<if test="custIsn != null and custIsn != ''"> and sgc.cust_isn like concat('%', #{custIsn}, '%') </if>
|
||||
<if test="gridName != null and gridName != ''"> and scgc.grid_name like concat('%', #{gridName}, '%')</if>
|
||||
<if test="gridName2 != null and gridName2 != ''"> and scgc.grid_name2 like concat('%', #{gridName2}, '%')</if>
|
||||
<if test="custName != null and custName != ''"> and sgc.cust_name like concat('%', #{custName}, '%')</if>
|
||||
<if test="deptName != null and deptName != ''"> and sd.dept_name like concat('%', #{deptName}, '%')</if>
|
||||
<if test="outlets != null and outlets != ''"> and scgc.outlets like concat('%', #{outlets}, '%')</if>
|
||||
<if test="username != null and username != ''"> and su.nick_name like concat('%', #{username}, '%')</if>
|
||||
<if test="socialCreditCode != null and socialCreditCode != ''"> and sgc.social_credit_code like concat('%', #{socialCreditCode}, '%')</if>
|
||||
<if test="pushStatus != null and pushStatus != ''"> and scgc.push_status = #{pushStatus}</if>
|
||||
<if test="deptId != null and deptId != ''"> and scgc.dept_id in
|
||||
(select dept_id from sys_dept where dept_id = #{deptId} or find_in_set(#{deptId},ancestors))
|
||||
</if>
|
||||
|
||||
</where>
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectCustomerList" parameterType="String" resultMap="CustomerList">
|
||||
select
|
||||
sg.group_id,sg.group_name,
|
||||
sgc.cust_name,
|
||||
sgc.cust_phone,
|
||||
sgc.cust_id,
|
||||
sgc.cust_idc,sgc.cust_isn,
|
||||
sgc.push_status,
|
||||
sgc.grid_name ,
|
||||
sgc.grid_name2 ,
|
||||
sgc.user_name,
|
||||
sgc.dept_name,
|
||||
sgc.dept_id,
|
||||
sgc.teller_id,sgc.outlets,sgc.id_type,sg.cust_type,sgc.lp_name,sgc.social_credit_code,sgc.social_credit_code_type
|
||||
from
|
||||
sys_group_customer sgc
|
||||
inner join sys_group sg on
|
||||
sgc.group_id = sg.group_id
|
||||
<where>
|
||||
<if test="groupId != null and groupId != ''">
|
||||
sgc.group_id = #{groupId}
|
||||
</if>
|
||||
<if test="custId != null and custId != ''">
|
||||
and sgc.cust_id like concat('%', #{custId}, '%')
|
||||
</if>
|
||||
<if test="custIdc != null and custIdc != ''"> and sgc.cust_idc like concat('%', #{custIdc}, '%')</if>
|
||||
<if test="custIsn != null and custIsn != ''"> and sgc.cust_isn like concat('%', #{custIsn}, '%') </if>
|
||||
<if test="gridName != null and gridName != ''"> and sgc.grid_name like concat('%', #{gridName}, '%')</if>
|
||||
<if test="gridName2 != null and gridName2 != ''"> and sgc.grid_name2 like concat('%', #{gridName2}, '%')</if>
|
||||
<if test="custName != null and custName != ''"> and sgc.cust_name like concat('%', #{custName}, '%')</if>
|
||||
<if test="deptName != null and deptName != ''"> and sgc.dept_name like concat('%', #{deptName}, '%')</if>
|
||||
<if test="outlets != null and outlets != ''"> and sgc.outlets like concat('%', #{outlets}, '%')</if>
|
||||
<if test="username != null and username != ''"> and sgc.user_name like concat('%', #{username}, '%')</if>
|
||||
<if test="socialCreditCode != null and socialCreditCode != ''"> and sgc.social_credit_code like concat('%', #{socialCreditCode}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectUnsuccessCustomerList" parameterType="String" resultMap="CustomerList">
|
||||
select
|
||||
sg.group_id,sg.group_name,
|
||||
sgc.cust_name,
|
||||
sgc.cust_phone,
|
||||
sgc.cust_id,
|
||||
sgc.cust_idc,
|
||||
sgc.push_status,
|
||||
sgc.grid_name ,
|
||||
sgc.grid_name2 ,
|
||||
sgc.user_name,
|
||||
sgc.dept_name,
|
||||
sgc.teller_id
|
||||
from
|
||||
sys_group_customer sgc
|
||||
inner join sys_group sg on
|
||||
sgc.group_id = sg.group_id
|
||||
left join sys_campaign sc on
|
||||
sc.group_id = sgc.group_id
|
||||
<where>
|
||||
<if test="groupId != null and groupId != ''">
|
||||
sgc.group_id = #{groupId}
|
||||
</if>
|
||||
<if test="custId != null and custId != ''">
|
||||
and sgc.cust_id like concat('%', #{custId}, '%')
|
||||
</if>
|
||||
<if test="custName != null and custName != ''">
|
||||
and sgc.cust_name like concat('%', #{custName}, '%')
|
||||
</if>
|
||||
<if test="pushStatus != null and pushStatus != ''">
|
||||
and sgc.push_status = #{pushStatus}
|
||||
</if>
|
||||
<if test="pushStatus == null or pushStatus ==''">
|
||||
and (sgc.push_status = '0' or sgc.push_status = '2')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="selectSysGroupById" parameterType="Long" resultMap="SysGroupResult">
|
||||
<include refid="selectSysGroupVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectSysGroupByGroupId" parameterType="String" resultMap="SysGroupResult">
|
||||
<include refid="selectSysGroup"/>
|
||||
where group_id = #{groupId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectSysGroupNameByGroupId" parameterType="String" >
|
||||
select group_name from sys_group
|
||||
where group_id = #{groupId}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="selectSysGroupBydeptId" parameterType="Long" resultMap="SysGroupResult">
|
||||
<include refid="selectSysGroup"/>
|
||||
|
||||
<where>
|
||||
del_flag = '0'
|
||||
<if test="deptId != null">and left(dept_id,3) = left(#{deptId},3)</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectSysGroupBydeptId1" parameterType="Long" resultMap="SysGroupResult">
|
||||
<include refid="selectSysGroup"/>
|
||||
<where>
|
||||
del_flag = '0'
|
||||
<if test="deptId != null">and dept_id = #{deptId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysGroupBydeptIdAndUserId" parameterType="Long" resultMap="SysGroupResult">
|
||||
<include refid="selectSysGroup"/>
|
||||
<where>
|
||||
del_flag = '0'
|
||||
<if test="deptId != null">and dept_id = #{deptId}</if>
|
||||
<if test="userName != null">and create_by = #{userName}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="isHead" parameterType="String" resultType="String">
|
||||
select r.role_key from sys_role r left join sys_user_role sur on r.role_id = sur.role_id left join sys_user u on sur.user_id = u.user_id where u.user_name = #{username}
|
||||
|
||||
</select>
|
||||
|
||||
<insert id="insertSysGroup" parameterType="SysGroup" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_group
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="groupName != null">group_name,</if>
|
||||
<if test="createType != null">create_type,</if>
|
||||
<if test="customerNum != null">customer_num,</if>
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="userId != null">user_id,</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="updateType != null">update_type,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="groupType != null">group_type,</if>
|
||||
<if test="groupId != null">group_id,</if>
|
||||
<if test="custType != null">cust_type,</if>
|
||||
<if test="createRole != null">create_role,</if>
|
||||
<if test="labelIds != null">label_ids,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="updateTypeRelateTime != null">update_type_relate_time,</if>
|
||||
<if test="relateGroupId != null">relate_group_id,</if>
|
||||
<if test="labelSql != null">label_sql,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="groupName != null">#{groupName},</if>
|
||||
<if test="createType != null">#{createType},</if>
|
||||
<if test="customerNum != null">#{customerNum},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="userId != null">#{userId},</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="updateType != null">#{updateType},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="groupType != null">#{groupType},</if>
|
||||
<if test="groupId != null">#{groupId},</if>
|
||||
<if test="custType != null">#{custType},</if>
|
||||
<if test="createRole != null">#{createRole},</if>
|
||||
<if test="labelIds != null">#{labelIds},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="updateTypeRelateTime != null">#{updateTypeRelateTime},</if>
|
||||
<if test="relateGroupId != null">#{relateGroupId},</if>
|
||||
<if test="labelSql != null">#{labelSql},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysGroup" parameterType="SysGroup">
|
||||
update sys_group
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="groupName != null">group_name = #{groupName},</if>
|
||||
<if test="createType != null">create_type = #{createType},</if>
|
||||
<if test="customerNum != null">customer_num = #{customerNum},</if>
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="userId != null">user_id = #{userId},</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="updateType != null">update_type = #{updateType},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="groupType != null">group_type = #{groupType},</if>
|
||||
<if test="createRole != null">create_role = #{createRole},</if>
|
||||
<if test="labelIds != null">label_ids = #{labelIds},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="updateTypeRelateTime != null">update_type_relate_time = #{updateTypeRelateTime},</if>
|
||||
<if test="relateGroupId != null">relate_group_id = #{relateGroupId},</if>
|
||||
<if test="labelSql != null">label_sql = #{labelSql},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateSysGroupByIdc" parameterType="SysGroup">
|
||||
update sys_group
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="customerNum != null">customer_num = #{customerNum},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where group_id = #{groupId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysGroupById" parameterType="Long">
|
||||
delete from sys_group where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysGroupByIds" parameterType="String">
|
||||
delete from sys_group where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectListNameByBank" parameterType="Long">
|
||||
select distinct a.group_id,a.group_name,a.create_role from sys_group a,sys_campaign_group_customer b where a.group_id = b.group_id and b.dept_id div 10 = #{countDept}
|
||||
</select>
|
||||
|
||||
<select id="selectListNameByUser" parameterType="Long">
|
||||
select * from sys_group where user_id = #{UserId}
|
||||
</select>
|
||||
|
||||
<select id="selectCountByGroupName" parameterType="String" resultType="integer">
|
||||
select count(*) from sys_group sg
|
||||
where del_flag = '0'
|
||||
<if test="groupName != null">and group_name = #{groupName}</if>
|
||||
<if test="headId != null">and dept_id like concat(#{headId},'%')</if>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
842
ibs/src/main/resources/mapper/list/SysListMapper.xml
Normal file
842
ibs/src/main/resources/mapper/list/SysListMapper.xml
Normal file
@@ -0,0 +1,842 @@
|
||||
<?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.ibs.list.mapper.SysListMapper">
|
||||
|
||||
<resultMap type="MarketingList" id="MarketingList">
|
||||
<id property="listType" column="list_type" />
|
||||
<result property="groupName" column="group_name" />
|
||||
<result property="customerNum" column="customer_num" />
|
||||
<result property="campaignName" column="campaign_name" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="campaignDegree" column="campaign_degree" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endTime" column="end_time" />
|
||||
<result property="custId" column="cust_id" />
|
||||
<result property="custIdc" column="cust_idc" />
|
||||
<result property="custName" column="cust_name" />
|
||||
<result property="custPhone" column="cust_phone" />
|
||||
<result property="groupId" column="group_id" />
|
||||
<result property="campaignId" column="campaign_id" />
|
||||
<result property="claimType" column="claim_type" />
|
||||
<result property="orgClaimStatus" column="org_claim_status" />
|
||||
<result property="orgDistributeStatus" column="org_distribute_status" />
|
||||
<result property="custClaimStatus" column="cust_claim_status" />
|
||||
<result property="claimEndTime" column="claim_end_time" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="ListSelectByUser" id="ListSelectByUser">
|
||||
<id property="groupId" column="group_id" />
|
||||
<result property="createRole" column="create_role" />
|
||||
<result property="groupType" column="group_type" />
|
||||
<result property="groupName" column="group_name" />
|
||||
<result property="campaignId" column="campaign_id" />
|
||||
<result property="campaignName" column="campaign_name" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endTime" column="end_time" />
|
||||
<result property="campaignDegree" column="campaign_degree" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="claimEndTime" column="claim_end_time" />
|
||||
<result property="claimType" column="claim_type" />
|
||||
<result property="orgClaimStatus" column="org_claim_status" />
|
||||
<result property="orgDistributeStatus" column="org_distribute_status" />
|
||||
<result property="customerNum" column="customer_num" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="secondPushStatus" column="second_push_status" />
|
||||
<result property="executer" column="executer" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="belongDept" column="dept_name" />
|
||||
<result property="sendDept" column="send_dept" />
|
||||
<result property="checkTarget" column="check_target" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="ListSelectForUser" id="ListSelectForUser">
|
||||
<id property="custId" column="cust_id" />
|
||||
<result property="createRole" column="create_role" />
|
||||
<result property="groupId" column="group_id" />
|
||||
<result property="groupName" column="group_name" />
|
||||
<result property="custPattern" column="cust_type" />
|
||||
<result property="campaignId" column="campaign_id" />
|
||||
<result property="campaignName" column="campaign_name" />
|
||||
<result property="custIdc" column="cust_idc" />
|
||||
<result property="socialCreditCode" column="social_credit_code" />
|
||||
<result property="custName" column="cust_name" />
|
||||
<result property="custPhone" column="cust_phone" />
|
||||
<result property="custIsn" column="cust_isn" />
|
||||
<result property="lpName" column="lp_name" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endTime" column="end_time" />
|
||||
<result property="campaignDegree" column="campaign_degree" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="claimType" column="claim_type" />
|
||||
<result property="orgClaimStatus" column="org_claim_status" />
|
||||
<result property="orgDistributeStatus" column="org_distribute_status" />
|
||||
<result property="custClaimStatus" column="cust_claim_status" />
|
||||
<result property="topGridName" column="grid_name" />
|
||||
<result property="secGridName" column="grid_name2" />
|
||||
<result property="outlets" column="outlets" />
|
||||
<result property="userName" column="nick_name" />
|
||||
<result property="belongDept" column="dept_name" />
|
||||
<result property="checkTarget" column="check_target" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
<select id="selectMarketingList" parameterType="String" resultMap="MarketingList">
|
||||
select
|
||||
scgc.list_type,
|
||||
scgc.group_id,
|
||||
scgc.campaign_id,
|
||||
sg.group_name,
|
||||
sg.customer_num,
|
||||
sc.campaign_name,
|
||||
sc.create_time ,
|
||||
sc.campaign_degree,
|
||||
sc.start_time,
|
||||
sc.end_time,
|
||||
sc.claim_end_time,
|
||||
scgc.cust_id,
|
||||
scgc.org_claim_status,
|
||||
scgc.org_distribute_status,
|
||||
scgc.cust_claim_status,
|
||||
sc.claim_type
|
||||
|
||||
from
|
||||
sys_campaign_group_customer scgc
|
||||
inner join sys_campaign sc on
|
||||
scgc.campaign_id = sc.campaign_id
|
||||
inner join sys_group sg on
|
||||
scgc.group_id = sg.group_id
|
||||
<where>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
and sg.group_name like concat('%', #{keyword}, '%') or sc.campaign_name like concat('%', #{keyword}, '%')
|
||||
</if>
|
||||
<if test="deptId != null ">
|
||||
and scgc.dept_id div 1000 = #{deptId}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectMarketingList2" parameterType="String" resultMap="MarketingList">
|
||||
select
|
||||
scgc.list_type,
|
||||
scgc.group_id,
|
||||
scgc.campaign_id,
|
||||
sg.group_name,
|
||||
sg.customer_num,
|
||||
sc.campaign_name,
|
||||
sc.create_time ,
|
||||
sc.campaign_degree,
|
||||
sc.start_time,
|
||||
sc.end_time,
|
||||
sc.claim_end_time,
|
||||
scgc.cust_id,
|
||||
scgc.org_claim_status,
|
||||
scgc.org_distribute_status,
|
||||
scgc.cust_claim_status,
|
||||
sc.claim_type
|
||||
|
||||
from
|
||||
sys_campaign_group_customer scgc
|
||||
inner join sys_campaign sc on
|
||||
scgc.campaign_id = sc.campaign_id
|
||||
inner join sys_group sg on
|
||||
scgc.group_id = sg.group_id
|
||||
<where>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
and sg.group_name like concat('%', #{keyword}, '%') or sc.campaign_name like concat('%', #{keyword}, '%')
|
||||
</if>
|
||||
<if test="deptId != null ">
|
||||
and scgc.dept_id = #{deptId}
|
||||
</if>
|
||||
<if test="userId != null ">
|
||||
and scgc.user_id = #{userId}
|
||||
</if>
|
||||
<if test="createRole != null ">
|
||||
and scgc.create_role = #{createRole}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectMarketingCustomerList" parameterType="String" resultMap="MarketingList">
|
||||
select
|
||||
scgc.list_type,
|
||||
scgc.group_id,
|
||||
scgc.campaign_id,
|
||||
sg.group_name,
|
||||
sg.customer_num,
|
||||
sc.campaign_name,
|
||||
sc.create_time ,
|
||||
sc.campaign_degree,
|
||||
sc.start_time,
|
||||
sc.end_time,
|
||||
sc.claim_end_time,
|
||||
sgc.cust_name,
|
||||
sgc.cust_phone,
|
||||
sgc.cust_id,
|
||||
sgc.cust_idc,
|
||||
scgc.org_claim_status,
|
||||
scgc.org_distribute_status,
|
||||
scgc.cust_claim_status,
|
||||
sc.claim_type
|
||||
from
|
||||
sys_campaign_group_customer scgc
|
||||
inner join sys_campaign sc on
|
||||
scgc.campaign_id = sc.campaign_id
|
||||
inner join sys_group sg on
|
||||
scgc.group_id = sg.group_id
|
||||
inner join sys_group_customer sgc on
|
||||
scgc.cust_id = sgc.cust_id and scgc.group_id = sgc.group_id
|
||||
<where>
|
||||
<if test="groupId != null and groupId != ''">
|
||||
and scgc.group_id = #{groupId}
|
||||
</if>
|
||||
<if test="campaignId != null and campaignId != ''">
|
||||
and scgc.campaign_id = #{campaignId}
|
||||
</if>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
and (sgc.cust_idc like concat('%', #{keyword}, '%') or sgc.cust_name like concat('%', #{keyword}, '%') or sgc.cust_phone like concat('%', #{keyword}, '%'))
|
||||
</if>
|
||||
<if test="deptId != null ">
|
||||
and scgc.dept_id div 1000 = #{deptId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectMarketingCustomerList2" parameterType="String" resultMap="MarketingList">
|
||||
select
|
||||
scgc.list_type,
|
||||
scgc.group_id,
|
||||
scgc.campaign_id,
|
||||
sg.group_name,
|
||||
sg.customer_num,
|
||||
sc.campaign_name,
|
||||
sc.create_time ,
|
||||
sc.campaign_degree,
|
||||
sc.start_time,
|
||||
sc.end_time,
|
||||
sc.claim_end_time,
|
||||
sgc.cust_name,
|
||||
sgc.cust_phone,
|
||||
sgc.cust_id,
|
||||
sgc.cust_idc,
|
||||
scgc.org_claim_status,
|
||||
scgc.org_distribute_status,
|
||||
scgc.cust_claim_status,
|
||||
sc.claim_type
|
||||
from
|
||||
sys_campaign_group_customer scgc
|
||||
inner join sys_campaign sc on
|
||||
scgc.campaign_id = sc.campaign_id
|
||||
inner join sys_group sg on
|
||||
scgc.group_id = sg.group_id
|
||||
inner join sys_group_customer sgc on
|
||||
scgc.cust_id = sgc.cust_id and scgc.group_id = sgc.group_id
|
||||
<where>
|
||||
<if test="groupId != null and groupId != ''">
|
||||
and scgc.group_id = #{groupId}
|
||||
</if>
|
||||
<if test="campaignId != null and campaignId != ''">
|
||||
and scgc.campaign_id = #{campaignId}
|
||||
</if>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
and (sgc.cust_idc like concat('%', #{keyword}, '%') or sgc.cust_name like concat('%', #{keyword}, '%') or sgc.cust_phone like concat('%', #{keyword}, '%'))
|
||||
</if>
|
||||
<if test="deptId != null ">
|
||||
and scgc.dept_id = #{deptId}
|
||||
</if>
|
||||
<if test="userId != null ">
|
||||
and scgc.user_id = #{userId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectMarketingListByBank" parameterType="ListSelectByUser" resultMap="ListSelectByUser">
|
||||
select distinct sg.group_id,
|
||||
any_value(sg.create_role) as create_role,
|
||||
any_value(sg.group_type) as group_type,
|
||||
any_value(sg.group_name) as group_name,
|
||||
any_value(sc.campaign_id) as campaign_id,
|
||||
any_value(sc.campaign_name) as campaign_name,
|
||||
any_value(sc.start_time) as start_time,
|
||||
any_value(sc.end_time) as end_time,
|
||||
any_value(sc.campaign_degree) as campaign_degree,
|
||||
any_value(scgc.dept_id) as dept_id,
|
||||
any_value(sc.claim_end_time) as claim_end_time,
|
||||
any_value(sc.claim_type) as claim_type,
|
||||
any_value(sc.check_target) as check_target,
|
||||
any_value(scgc.org_claim_status) as org_claim_status,
|
||||
any_value(scgc.org_distribute_status) as org_distribute_status,
|
||||
any_value(sg.update_time) as update_time,
|
||||
any_value(scgc.second_push_status) as second_push_status,
|
||||
any_value(sc.executer) as executer,
|
||||
any_value(sc.create_time) as create_time,
|
||||
any_value(sd.dept_name) as dept_name,
|
||||
any_value(sd2.dept_name) as send_dept,
|
||||
count(distinct scgc.cust_id) as customer_num
|
||||
from
|
||||
sys_campaign_group_customer scgc
|
||||
inner join (select distinct campaign_id,campaign_name,start_time,end_time,campaign_degree,claim_end_time,claim_type,check_target,executer,create_time,dept_id from sys_campaign) sc on
|
||||
scgc.campaign_id = sc.campaign_id
|
||||
inner join (select distinct group_id,cust_type,create_role,group_type,group_name,update_time from sys_group where cust_type = #{custPattern}) sg on
|
||||
scgc.group_id = sg.group_id
|
||||
inner join (select distinct dept_id,dept_name from sys_dept) sd on
|
||||
scgc.dept_id = sd.dept_id
|
||||
inner join (select distinct dept_id,dept_name from sys_dept) sd2 on
|
||||
sc.dept_id = sd2.dept_id
|
||||
where scgc.del_flag = '0' and scgc.org_claim_status in ('0','1') and scgc.push_status = '1'
|
||||
<if test="userDept != null and userDept != ''">
|
||||
and scgc.dept_id in
|
||||
(select dept_id from sys_dept where dept_id = #{userDept} or find_in_set(#{userDept},ancestors))
|
||||
</if>
|
||||
<if test="groupName != null and groupName != ''">
|
||||
and (sg.group_name like concat('%', #{groupName}, '%') or sc.campaign_name like concat('%', #{groupName}, '%'))
|
||||
</if>
|
||||
<if test="campaignName != null and campaignName != ''">
|
||||
and sc.campaign_name like concat('%', #{campaignName}, '%')
|
||||
</if>
|
||||
<if test="orgClaimStatus != null and orgClaimStatus != ''">
|
||||
and scgc.org_claim_status = #{orgClaimStatus}
|
||||
</if>
|
||||
<if test="orgDistributeStatus != null and orgDistributeStatus != ''">
|
||||
and scgc.org_distribute_status = #{orgDistributeStatus}
|
||||
</if>
|
||||
<if test="groupType != null and groupType != ''">
|
||||
and sg.create_role = #{groupType}
|
||||
</if>
|
||||
<if test="userId != null and userId != ''">
|
||||
and scgc.user_id = #{userId}
|
||||
</if>
|
||||
<if test="startTime != null ">
|
||||
and DATE_FORMAT(sc.start_time,'%Y-%m-%d') = DATE_FORMAT(#{startTime},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="endTime != null ">
|
||||
and DATE_FORMAT(sc.end_time,'%Y-%m-%d') = DATE_FORMAT(#{endTime},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="campaignDegree != null and campaignDegree != ''">
|
||||
and sc.campaign_degree = #{campaignDegree}
|
||||
</if>
|
||||
<if test="belongDept != null and belongDept != ''">
|
||||
and scgc.dept_id = #{belongDept}
|
||||
</if>
|
||||
<if test="claimEndTime != null ">
|
||||
and DATE_FORMAT(sc.claim_end_time,'%Y-%m-%d') = DATE_FORMAT(#{claimEndTime},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="claimType != null and claimType != ''">
|
||||
and sc.claim_type = #{claimType}
|
||||
</if>
|
||||
<if test="orgClaimStatus != null and orgClaimStatus != ''">
|
||||
and scgc.org_claim_status = #{orgClaimStatus}
|
||||
</if>
|
||||
<if test="orgDistributeStatus != null and orgDistributeStatus != ''">
|
||||
and scgc.org_distribute_status = #{orgDistributeStatus}
|
||||
</if>
|
||||
<if test="actionStatus != null and actionStatus != ''">
|
||||
and case when #{actionStatus} = '待开始' then sc.start_time > #{nowTime}
|
||||
when #{actionStatus} = '进行中' then sc.end_time >= #{nowTime} and #{nowTime} >= sc.start_time
|
||||
when #{actionStatus} = '已结束' then #{nowTime} > sc.end_time
|
||||
else 1=1 end
|
||||
</if>
|
||||
group by scgc.campaign_id,left(scgc.dept_id,5),sg.group_id
|
||||
union all
|
||||
select distinct
|
||||
sg.group_id,
|
||||
any_value(sg.create_role) as create_role,
|
||||
any_value(sg.group_type) as group_type,
|
||||
any_value(sg.group_name) as group_name,
|
||||
any_value(sc.campaign_id) as campaign_id,
|
||||
any_value(sc.campaign_name) as campaign_name,
|
||||
any_value(sc.start_time) as start_time,
|
||||
any_value(sc.end_time) as end_time,
|
||||
any_value(sc.campaign_degree) as campaign_degree,
|
||||
null as dept_id,
|
||||
any_value(sc.claim_end_time) as claim_end_time,
|
||||
any_value(sc.claim_type) as claim_type,
|
||||
any_value(sc.check_target) as check_target,
|
||||
any_value(scgc.org_claim_status) as org_claim_status,
|
||||
any_value(scgc.org_distribute_status) as org_distribute_status,
|
||||
any_value(sg.update_time) as update_time,
|
||||
any_value(scgc.second_push_status) as second_push_status,
|
||||
any_value(sc.executer) as executer,
|
||||
any_value(sc.create_time) as create_time,
|
||||
null as dept_name,
|
||||
any_value(sd2.dept_name) as send_dept,
|
||||
count(distinct scgc.cust_id) as customer_num
|
||||
from
|
||||
sys_campaign_group_customer scgc
|
||||
inner join (select distinct campaign_id,campaign_name,start_time,end_time,campaign_degree,claim_end_time,claim_type,check_target,executer,create_time,dept_id from sys_campaign) sc on
|
||||
scgc.campaign_id = sc.campaign_id
|
||||
inner join (select distinct group_id,cust_type,create_role,group_type,group_name,update_time from sys_group where cust_type = #{custPattern} ) sg on
|
||||
scgc.group_id = sg.group_id
|
||||
inner join (select distinct dept_id,dept_name from sys_dept) sd on
|
||||
scgc.dept_id = sd.dept_id
|
||||
inner join (select distinct dept_id,dept_name from sys_dept) sd2 on
|
||||
sc.dept_id = sd2.dept_id
|
||||
where scgc.del_flag = '0' and scgc.org_claim_status not in ('0','1') and scgc.push_status = '1'
|
||||
<if test="userDept != null and userDept != ''">
|
||||
and scgc.dept_id in
|
||||
(select dept_id from sys_dept where dept_id = #{userDept} or find_in_set(#{userDept},ancestors))
|
||||
</if>
|
||||
<if test="groupName != null and groupName != ''">
|
||||
and (sg.group_name like concat('%', #{groupName}, '%') or sc.campaign_name like concat('%', #{groupName}, '%'))
|
||||
</if>
|
||||
<if test="campaignName != null and campaignName != ''">
|
||||
and sc.campaign_name like concat('%', #{campaignName}, '%')
|
||||
</if>
|
||||
<if test="orgClaimStatus != null and orgClaimStatus != ''">
|
||||
and scgc.org_claim_status = #{orgClaimStatus}
|
||||
</if>
|
||||
<if test="orgDistributeStatus != null and orgDistributeStatus != ''">
|
||||
and scgc.org_distribute_status = #{orgDistributeStatus}
|
||||
</if>
|
||||
<if test="groupType != null and groupType != ''">
|
||||
and sg.create_role = #{groupType}
|
||||
</if>
|
||||
<if test="userId != null and userId != ''">
|
||||
and scgc.user_id = #{userId}
|
||||
</if>
|
||||
<if test="startTime != null ">
|
||||
and DATE_FORMAT(sc.start_time,'%Y-%m-%d') = DATE_FORMAT(#{startTime},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="endTime != null ">
|
||||
and DATE_FORMAT(sc.end_time,'%Y-%m-%d') = DATE_FORMAT(#{endTime},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="campaignDegree != null and campaignDegree != ''">
|
||||
and sc.campaign_degree = #{campaignDegree}
|
||||
</if>
|
||||
<if test="belongDept != null and belongDept != ''">
|
||||
and scgc.dept_id = #{belongDept}
|
||||
</if>
|
||||
<if test="claimEndTime != null ">
|
||||
and DATE_FORMAT(sc.claim_end_time,'%Y-%m-%d') = DATE_FORMAT(#{claimEndTime},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="claimType != null and claimType != ''">
|
||||
and sc.claim_type = #{claimType}
|
||||
</if>
|
||||
<if test="orgClaimStatus != null and orgClaimStatus != ''">
|
||||
and scgc.org_claim_status = #{orgClaimStatus}
|
||||
</if>
|
||||
<if test="orgDistributeStatus != null and orgDistributeStatus != ''">
|
||||
and scgc.org_distribute_status = #{orgDistributeStatus}
|
||||
</if>
|
||||
<if test="actionStatus != null and actionStatus != ''">
|
||||
and case when #{actionStatus} = '待开始' then sc.start_time > #{nowTime}
|
||||
when #{actionStatus} = '进行中' then sc.end_time > #{nowTime} and #{nowTime} > sc.start_time
|
||||
when #{actionStatus} = '已结束' then #{nowTime} > sc.end_time
|
||||
else 1=1 end
|
||||
</if>
|
||||
group by scgc.campaign_id,sg.group_id
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectMarketingListByOutlet" parameterType="ListSelectByUser" resultMap="ListSelectByUser">
|
||||
select distinct sg.group_id,
|
||||
any_value(sg.create_role) as create_role,
|
||||
any_value(sg.group_type) as group_type,
|
||||
any_value(sg.group_name) as group_name,
|
||||
any_value(sc.campaign_id) as campaign_id,
|
||||
any_value(sc.campaign_name) as campaign_name,
|
||||
any_value(sc.start_time) as start_time,
|
||||
any_value(sc.end_time) as end_time,
|
||||
any_value(sc.campaign_degree) as campaign_degree,
|
||||
any_value(scgc.dept_id) as dept_id,
|
||||
any_value(sc.claim_end_time) as claim_end_time,
|
||||
any_value(sc.claim_type) as claim_type,
|
||||
any_value(sc.check_target) as check_target,
|
||||
any_value(scgc.org_claim_status) as org_claim_status,
|
||||
any_value(scgc.org_distribute_status) as org_distribute_status,
|
||||
any_value(sg.update_time) as update_time,
|
||||
any_value(scgc.second_push_status) as second_push_status,
|
||||
any_value(sc.executer) as executer,
|
||||
any_value(sc.create_time) as create_time,
|
||||
any_value(sd.dept_name) as dept_name,
|
||||
any_value(sd2.dept_name) as send_dept,
|
||||
count(distinct scgc.cust_id) as customer_num
|
||||
from
|
||||
sys_campaign_group_customer scgc
|
||||
inner join (select distinct campaign_id,campaign_name,start_time,end_time,campaign_degree,claim_end_time,claim_type,check_target,executer,create_time,dept_id from sys_campaign) sc on
|
||||
scgc.campaign_id = sc.campaign_id
|
||||
inner join (select distinct group_id,cust_type,create_role,group_type,group_name,update_time from sys_group where cust_type = #{custPattern}) sg on
|
||||
scgc.group_id = sg.group_id
|
||||
inner join (select distinct dept_id,dept_name from sys_dept) sd on
|
||||
scgc.dept_id = sd.dept_id
|
||||
inner join (select distinct dept_id,dept_name from sys_dept) sd2 on
|
||||
sc.dept_id = sd2.dept_id
|
||||
where scgc.del_flag = '0' and scgc.push_status = '1'
|
||||
<if test="userDept != null and userDept != ''">
|
||||
and scgc.dept_id in
|
||||
(select dept_id from sys_dept where dept_id = #{userDept} or find_in_set(#{userDept},ancestors))
|
||||
</if>
|
||||
<if test="groupName != null and groupName != ''">
|
||||
and (sg.group_name like concat('%', #{groupName}, '%') or sc.campaign_name like concat('%', #{groupName}, '%'))
|
||||
</if>
|
||||
<if test="campaignName != null and campaignName != ''">
|
||||
and sc.campaign_name like concat('%', #{campaignName}, '%')
|
||||
</if>
|
||||
<if test="orgClaimStatus != null and orgClaimStatus != ''">
|
||||
and scgc.org_claim_status = #{orgClaimStatus}
|
||||
</if>
|
||||
<if test="orgDistributeStatus != null and orgDistributeStatus != ''">
|
||||
and scgc.org_distribute_status = #{orgDistributeStatus}
|
||||
</if>
|
||||
<if test="groupType != null and groupType != ''">
|
||||
and sg.create_role = #{groupType}
|
||||
</if>
|
||||
<if test="userId != null and userId != ''">
|
||||
and scgc.user_id = #{userId}
|
||||
</if>
|
||||
<if test="startTime != null ">
|
||||
and DATE_FORMAT(sc.start_time,'%Y-%m-%d') = DATE_FORMAT(#{startTime},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="endTime != null ">
|
||||
and DATE_FORMAT(sc.end_time,'%Y-%m-%d') = DATE_FORMAT(#{endTime},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="campaignDegree != null and campaignDegree != ''">
|
||||
and sc.campaign_degree = #{campaignDegree}
|
||||
</if>
|
||||
<if test="belongDept != null and belongDept != ''">
|
||||
and scgc.dept_id = #{belongDept}
|
||||
</if>
|
||||
<if test="belongOutlet != null and belongOutlet != ''">
|
||||
and scgc.outlets_id = #{belongOutlet}
|
||||
</if>
|
||||
<if test="claimEndTime != null ">
|
||||
and DATE_FORMAT(sc.claim_end_time,'%Y-%m-%d') = DATE_FORMAT(#{claimEndTime},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="claimType != null and claimType != ''">
|
||||
and sc.claim_type = #{claimType}
|
||||
</if>
|
||||
<if test="orgClaimStatus != null and orgClaimStatus != ''">
|
||||
and scgc.org_claim_status = #{orgClaimStatus}
|
||||
</if>
|
||||
<if test="orgDistributeStatus != null and orgDistributeStatus != ''">
|
||||
and scgc.org_distribute_status = #{orgDistributeStatus}
|
||||
</if>
|
||||
<if test="actionStatus != null and actionStatus != ''">
|
||||
and case when #{actionStatus} = '待开始' then sc.start_time > #{nowTime}
|
||||
when #{actionStatus} = '进行中' then sc.end_time >= #{nowTime} and #{nowTime} >= sc.start_time
|
||||
when #{actionStatus} = '已结束' then #{nowTime} > sc.end_time
|
||||
else 1=1 end
|
||||
</if>
|
||||
group by scgc.campaign_id,left(scgc.dept_id,5),sg.group_id
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectCustListByBankRetail" parameterType="ListSelectForUser" resultMap="ListSelectForUser">
|
||||
select
|
||||
sgc.cust_id,
|
||||
sg.create_role,
|
||||
sg.group_id,
|
||||
sg.group_name,
|
||||
sc.campaign_id,
|
||||
sc.campaign_name,
|
||||
scgc.cust_idc,
|
||||
sgc.cust_name,
|
||||
scgc.cust_phone,
|
||||
sgc.cust_isn,
|
||||
sc.start_time,
|
||||
sc.end_time,
|
||||
sc.campaign_degree,
|
||||
sc.check_target,
|
||||
scgc.dept_id,
|
||||
sc.claim_type,
|
||||
scgc.org_claim_status,
|
||||
scgc.org_distribute_status,
|
||||
scgc.cust_claim_status,
|
||||
scgc.grid_name,
|
||||
scgc.grid_name2,
|
||||
scgc.outlets,
|
||||
su.nick_name as nick_name,
|
||||
sd.dept_name as dept_name
|
||||
from
|
||||
sys_campaign_group_customer scgc
|
||||
inner join sys_campaign sc on
|
||||
scgc.campaign_id = sc.campaign_id
|
||||
inner join sys_group sg on
|
||||
scgc.group_id = sg.group_id
|
||||
inner join cust_info_retail sgc on
|
||||
scgc.cust_id = sgc.cust_id
|
||||
left join sys_user su on
|
||||
scgc.user_id = su.user_id
|
||||
left join sys_dept sd on
|
||||
scgc.dept_id = sd.dept_id
|
||||
where sg.cust_type = #{custPattern} and scgc.del_flag = '0' and scgc.push_status = '1'
|
||||
<if test="isOutlet == 0">
|
||||
and case when #{deptId} is null then scgc.org_claim_status not in ('0','1')
|
||||
else (scgc.dept_id in (select dept_id from sys_dept where dept_id = #{deptId} or find_in_set(#{deptId},ancestors)) and scgc.org_claim_status in ('0','1')) end
|
||||
</if>
|
||||
<if test="isOutlet == 1">
|
||||
and scgc.outlets_id = #{userDept}
|
||||
</if>
|
||||
<if test="userDept != null and userDept != '' and isOutlet == 0">
|
||||
and scgc.dept_id in
|
||||
(select dept_id from sys_dept where dept_id = #{userDept} or find_in_set(#{userDept},ancestors))
|
||||
</if>
|
||||
<if test="groupId != null and groupId != ''">
|
||||
and sg.group_id = #{groupId}
|
||||
</if>
|
||||
<if test="campaignId != null and campaignId != ''">
|
||||
and scgc.campaign_id = #{campaignId}
|
||||
</if>
|
||||
<if test="custName != null and custName != ''">
|
||||
and (sgc.cust_name like concat('%', #{custName}, '%') or sgc.cust_id like concat('%', #{custName}, '%') or scgc.cust_idc like concat('%', #{custName}, '%') or sgc.cust_phone like concat('%', #{custName}, '%') )
|
||||
</if>
|
||||
<if test="custClaimStatus != null and custClaimStatus != ''">
|
||||
and scgc.cust_claim_status = #{custClaimStatus}
|
||||
</if>
|
||||
<if test="userId != null and userId != ''">
|
||||
and scgc.user_id = #{userId}
|
||||
</if>
|
||||
<if test="custClaimStatus != null and custClaimStatus != ''">
|
||||
and scgc.cust_claim_status = #{custClaimStatus}
|
||||
</if>
|
||||
<if test="topGridName!= null and topGridName != ''">
|
||||
and scgc.grid_name like concat('%', #{topGridName}, '%')
|
||||
</if>
|
||||
<if test="secGridName != null and secGridName != ''">
|
||||
and scgc.grid_name2 like concat('%', #{secGridName}, '%')
|
||||
</if>
|
||||
<if test="belongDept != null and belongDept != ''">
|
||||
and sd.dept_name like concat('%', #{belongDept}, '%') and sd.dept_type ='branch'
|
||||
</if>
|
||||
<if test="outlets != null and outlets != ''">
|
||||
and scgc.outlets like concat('%', #{outlets}, '%')
|
||||
</if>
|
||||
<if test="userName != null and userName != ''">
|
||||
and su.nick_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectCustListByBankMerchant" parameterType="ListSelectForUser" resultMap="ListSelectForUser">
|
||||
select
|
||||
sgc.cust_id,
|
||||
sg.create_role,
|
||||
sg.group_id,
|
||||
sg.group_name,
|
||||
sc.campaign_id,
|
||||
sc.campaign_name,
|
||||
scgc.cust_idc,
|
||||
sgc.cust_name,
|
||||
scgc.cust_phone,
|
||||
sgc.cust_isn,
|
||||
sgc.social_credit_code,
|
||||
sgc.lp_name,
|
||||
sc.start_time,
|
||||
sc.end_time,
|
||||
sc.campaign_degree,
|
||||
sc.check_target,
|
||||
scgc.dept_id,
|
||||
sc.claim_type,
|
||||
scgc.org_claim_status,
|
||||
scgc.org_distribute_status,
|
||||
scgc.cust_claim_status,
|
||||
scgc.grid_name,
|
||||
scgc.grid_name2,
|
||||
scgc.outlets,
|
||||
su.nick_name as nick_name,
|
||||
sd.dept_name as dept_name
|
||||
from
|
||||
sys_campaign_group_customer scgc
|
||||
inner join sys_campaign sc on
|
||||
scgc.campaign_id = sc.campaign_id
|
||||
inner join sys_group sg on
|
||||
scgc.group_id = sg.group_id
|
||||
inner join cust_info_merchant sgc on
|
||||
scgc.cust_id = sgc.cust_id
|
||||
left join sys_user su on
|
||||
scgc.user_id = su.user_id
|
||||
left join sys_dept sd on
|
||||
scgc.dept_id = sd.dept_id
|
||||
where sg.cust_type = #{custPattern} and scgc.del_flag = '0' and scgc.push_status = '1'
|
||||
<if test="isOutlet == 0">
|
||||
and case when #{deptId} is null then scgc.org_claim_status not in ('0','1')
|
||||
else (scgc.dept_id in (select dept_id from sys_dept where dept_id = #{deptId} or find_in_set(#{deptId},ancestors)) and scgc.org_claim_status in ('0','1')) end
|
||||
</if>
|
||||
<if test="isOutlet == 1">
|
||||
and scgc.outlets_id = #{userDept}
|
||||
</if>
|
||||
<if test="userDept != null and userDept != '' and isOutlet == 0">
|
||||
and scgc.dept_id in
|
||||
(select dept_id from sys_dept where dept_id = #{userDept} or find_in_set(#{userDept},ancestors))
|
||||
</if>
|
||||
<if test="groupId != null and groupId != ''">
|
||||
and sg.group_id = #{groupId}
|
||||
</if>
|
||||
<if test="campaignId != null and campaignId != ''">
|
||||
and scgc.campaign_id = #{campaignId}
|
||||
</if>
|
||||
<if test="custName != null and custName != ''">
|
||||
and (sgc.cust_name like concat('%', #{custName}, '%') or sgc.cust_id like concat('%', #{custName}, '%') or scgc.cust_idc like concat('%', #{custName}, '%') or sgc.cust_phone like concat('%', #{custName}, '%'))
|
||||
</if>
|
||||
<if test="custClaimStatus != null and custClaimStatus != ''">
|
||||
and scgc.cust_claim_status = #{custClaimStatus}
|
||||
</if>
|
||||
<if test="userId != null and userId != ''">
|
||||
and scgc.user_id = #{userId}
|
||||
</if>
|
||||
<if test="custClaimStatus != null and custClaimStatus != ''">
|
||||
and scgc.cust_claim_status = #{custClaimStatus}
|
||||
</if>
|
||||
<if test="topGridName!= null and topGridName != ''">
|
||||
and scgc.grid_name like concat('%', #{topGridName}, '%')
|
||||
</if>
|
||||
<if test="secGridName != null and secGridName != ''">
|
||||
and scgc.grid_name2 like concat('%', #{secGridName}, '%')
|
||||
</if>
|
||||
<if test="belongDept != null and belongDept != ''">
|
||||
and sd.dept_name like concat('%', #{belongDept}, '%') and sd.dept_type ='branch'
|
||||
</if>
|
||||
<if test="outlets != null and outlets != ''">
|
||||
and scgc.outlets like concat('%', #{outlets}, '%')
|
||||
</if>
|
||||
<if test="userName != null and userName != ''">
|
||||
and su.nick_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectCustListByBankBusiness" parameterType="ListSelectForUser" resultMap="ListSelectForUser">
|
||||
select
|
||||
sgc.cust_id,
|
||||
sg.create_role,
|
||||
sg.group_id,
|
||||
sg.group_name,
|
||||
sc.campaign_id,
|
||||
sc.campaign_name,
|
||||
scgc.cust_idc,
|
||||
sgc.cust_name,
|
||||
scgc.cust_phone,
|
||||
sgc.cust_isn,
|
||||
sgc.social_credit_code,
|
||||
sgc.lp_name,
|
||||
sc.start_time,
|
||||
sc.end_time,
|
||||
sc.campaign_degree,
|
||||
sc.check_target,
|
||||
scgc.dept_id,
|
||||
sc.claim_type,
|
||||
scgc.org_claim_status,
|
||||
scgc.org_distribute_status,
|
||||
scgc.cust_claim_status,
|
||||
scgc.grid_name,
|
||||
scgc.grid_name2,
|
||||
scgc.outlets,
|
||||
su.nick_name as nick_name,
|
||||
sd.dept_name as dept_name
|
||||
from
|
||||
sys_campaign_group_customer scgc
|
||||
inner join sys_campaign sc on
|
||||
scgc.campaign_id = sc.campaign_id
|
||||
inner join sys_group sg on
|
||||
scgc.group_id = sg.group_id
|
||||
inner join cust_info_business sgc on
|
||||
scgc.cust_id = sgc.cust_id
|
||||
left join sys_user su on
|
||||
scgc.user_id = su.user_id
|
||||
left join sys_dept sd on
|
||||
scgc.dept_id = sd.dept_id
|
||||
where sg.cust_type = #{custPattern} and scgc.del_flag = '0' and scgc.push_status = '1'
|
||||
<if test="isOutlet == 0">
|
||||
and case when #{deptId} is null then scgc.org_claim_status not in ('0','1')
|
||||
else (scgc.dept_id in (select dept_id from sys_dept where dept_id = #{deptId} or find_in_set(#{deptId},ancestors)) and scgc.org_claim_status in ('0','1')) end
|
||||
</if>
|
||||
<if test="isOutlet == 1">
|
||||
and scgc.outlets_id = #{userDept}
|
||||
</if>
|
||||
<if test="userDept != null and userDept != '' and isOutlet == 0">
|
||||
and scgc.dept_id in
|
||||
(select dept_id from sys_dept where dept_id = #{userDept} or find_in_set(#{userDept},ancestors))
|
||||
</if>
|
||||
<if test="groupId != null and groupId != ''">
|
||||
and sg.group_id = #{groupId}
|
||||
</if>
|
||||
<if test="campaignId != null and campaignId != ''">
|
||||
and scgc.campaign_id = #{campaignId}
|
||||
</if>
|
||||
<if test="custName != null and custName != ''">
|
||||
and (sgc.cust_name like concat('%', #{custName}, '%') or sgc.cust_id like concat('%', #{custName}, '%') or scgc.cust_idc like concat('%', #{custName}, '%') or sgc.cust_phone like concat('%', #{custName}, '%') )
|
||||
</if>
|
||||
<if test="custClaimStatus != null and custClaimStatus != ''">
|
||||
and scgc.cust_claim_status = #{custClaimStatus}
|
||||
</if>
|
||||
<if test="userId != null and userId != ''">
|
||||
and scgc.user_id = #{userId}
|
||||
</if>
|
||||
<if test="custClaimStatus != null and custClaimStatus != ''">
|
||||
and scgc.cust_claim_status = #{custClaimStatus}
|
||||
</if>
|
||||
<if test="topGridName!= null and topGridName != ''">
|
||||
and scgc.grid_name like concat('%', #{topGridName}, '%')
|
||||
</if>
|
||||
<if test="secGridName != null and secGridName != ''">
|
||||
and scgc.grid_name2 like concat('%', #{secGridName}, '%')
|
||||
</if>
|
||||
<if test="belongDept != null and belongDept != ''">
|
||||
and sd.dept_name like concat('%', #{belongDept}, '%') and sd.dept_type ='branch'
|
||||
</if>
|
||||
<if test="outlets != null and outlets != ''">
|
||||
and scgc.outlets like concat('%', #{outlets}, '%')
|
||||
</if>
|
||||
<if test="userName != null and userName != ''">
|
||||
and su.nick_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectCustListForExcel" resultMap="ListSelectForUser">
|
||||
select
|
||||
sgc.cust_id,
|
||||
sg.create_role,
|
||||
sg.group_id,
|
||||
sg.group_name,
|
||||
sg.cust_type,
|
||||
sc.campaign_id,
|
||||
sc.campaign_name ,
|
||||
sgc.cust_idc,
|
||||
sgc.cust_name,
|
||||
sgc.cust_phone,
|
||||
sgc.cust_isn,
|
||||
sgc.social_credit_code,
|
||||
sc.start_time,
|
||||
sc.end_time,
|
||||
sc.campaign_degree,
|
||||
scgc.dept_id,
|
||||
sc.claim_type,
|
||||
scgc.org_claim_status,
|
||||
scgc.org_distribute_status,
|
||||
scgc.cust_claim_status,
|
||||
scgc.grid_name,
|
||||
scgc.grid_name2,
|
||||
scgc.outlets,
|
||||
su.nick_name as nick_name,
|
||||
sd.dept_name as dept_name
|
||||
from
|
||||
sys_campaign_group_customer scgc
|
||||
inner join sys_campaign sc on
|
||||
scgc.campaign_id = sc.campaign_id
|
||||
inner join sys_group sg on
|
||||
scgc.group_id = sg.group_id
|
||||
inner join sys_group_customer sgc on
|
||||
scgc.cust_id = sgc.cust_id and scgc.group_id = sgc.group_id
|
||||
left join sys_user su on
|
||||
scgc.user_id = su.user_id
|
||||
left join sys_dept sd on
|
||||
scgc.dept_id = sd.dept_id
|
||||
<where>
|
||||
case when #{deptId} is null then scgc.org_claim_status not in ('0','1')
|
||||
else (scgc.dept_id in
|
||||
(select dept_id from sys_dept where dept_id = #{deptId} or find_in_set(#{deptId},ancestors)) and scgc.org_claim_status in ('0','1')) end
|
||||
<if test="groupId != null and groupId != ''"> and sgc.group_id = #{groupId}</if>
|
||||
and sgc.cust_id in <foreach collection="custIds" index="index" item="item" open="(" separator="," close=")">#{item}</foreach>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user