B端 部分接口

This commit is contained in:
苏竹红
2023-06-13 09:47:07 +08:00
parent a2d58d3dcc
commit 5a6cd73113
38 changed files with 1938 additions and 47 deletions

View File

@@ -27,6 +27,49 @@
reject_real_reason, certify_file, deleted, create_time, update_time, close_time,
close_user_id
</sql>
<select id="selectByPrimaryKeySelective" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
from hy_partner_line_info
where id = #{id}
</select>
<insert id="batchInsert">
insert into
hy_partner_line_info
(
partner_id,
workflow_stage,
workflow_status,
line_status,
investment_manager
)
values
<foreach collection="recordList" item="record" separator=",">
(#{record.partnerId},
#{record.workflowStage},
#{record.workflowStatus},
#{record.lineStatus},
#{record.investmentManager})
</foreach>
</insert>
<update id="batchDeleted">
update hy_partner_line_info
set deleted = 1
<where>
<if test="lineIdList!=null and lineIdList.size>0">
<foreach collection="lineIdList" open="and id in (" close=")" separator="," item="lineId">
#{lineId}
</foreach>
</if>
</where>
</update>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_partner_line_info
<trim prefix="(" suffix=")" suffixOverrides=",">
@@ -193,4 +236,104 @@
</set>
where id = #{record.id}
</update>
<select id="getAdventLineCount" resultType="java.lang.Integer">
select count(1) from hy_partner_line_info
<where>
<if test="userId!=null and userId!=''">
and investment_manager = #{userId}
</if>
<if test="currentDate!=null and currentDate!=''">
and deadline = #{currentDate}
</if>
and
(
(workflow_stage = 1 and workflow_status = 0) or
(workflow_stage = 2 and workflow_status = 0) or
(workflow_stage = 3 and workflow_status = 4)
)
</where>
</select>
<select id="selectStagePendingCount" resultType="com.cool.store.dto.partner.StageCountDTO">
select
IFNULL(sum(if(workflow_stage=1 and workflow_status = 1,1,0)),0) as intentApplyApproveCount,
IFNULL(sum(if(workflow_stage=3 and workflow_status = 3,1,0)),0) as qualifiedInterviewCount
from hy_partner_line_info
<where>
<if test="userId!=null and userId!=''">
and investment_manager = #{userId}
</if>
</where>
</select>
<select id="selectStageFollowCount" resultType="com.cool.store.dto.partner.StageCountDTO">
select
IFNULL(sum(if(workflow_stage=1 and workflow_status = 1,1,0)),0) as intentApplyApproveCount,
IFNULL(sum(if(workflow_stage=2 and workflow_status = 0,1,0)),0) as reservationInterviewCount,
IFNULL(sum(if(workflow_stage=3 and workflow_status = 4,1,0)),0) as qualifiedInterviewCount
from hy_partner_line_info
<where>
<if test="userId!=null and userId!=''">
and investment_manager = #{userId}
</if>
</where>
</select>
<select id="selectPartnerLineInfoAndBaseInfo" resultType="com.cool.store.dto.partner.PartnerLineInfoAndBaseInfoDTO">
select
a.id as id,
a.partner_id as partnerId,
a.workflow_stage as workflowStage,
a.workflow_status as workflowStatus,
a.partner_id as partnerUserId,
a.investment_manager as investmentManager,
b.user_portrait as user_portrait
from hy_partner_line_info a inner join hy_partner_base_info b
on a.id = b.partner_line_id
<where>
<if test="lineId!=null">
and a.id = #{id}
</if>
</where>
</select>
<select id="lastMonthCloseLine" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
from hy_partner_line_info
<where>
<if test="userId">
and investment_manager = #{userId}
</if>
<if test="lastMonthTodayDate!=null">
and close_time > #{lastMonthTodayDate} and close_time <![CDATA[<]]> now
</if>
</where>
</select>
<update id="updateInvestmentManager">
update hy_partner_line_info
set investment_manager = #{userId}
<if test="lineIdList!=null and lineIdList.size>0">
<foreach collection="lineIdList" open="where id in (" close=")" separator="," item="lineId">
#{lineId}
</foreach>
</if>
</update>
<select id="getLineListByLineIds" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List"></include>
from hy_partner_line_info
where deleted = 0
<if test="lineIdList!=null and lineIdList.size>0">
<foreach collection="lineIdList" open="and id in (" close=")" separator="," item="lineId">
#{lineId}
</foreach>
</if>
</select>
</mapper>