317 lines
12 KiB
XML
317 lines
12 KiB
XML
<?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.cool.store.mapper.HyPartnerInterviewPlanMapper">
|
|
<resultMap id="BaseResultMap" type="com.cool.store.entity.HyPartnerInterviewPlanDO">
|
|
<id column="id" jdbcType="BIGINT" property="id" />
|
|
<result column="partner_line_id" jdbcType="BIGINT" property="partnerLineId" />
|
|
<result column="partner_id" jdbcType="VARCHAR" property="partnerId" />
|
|
<result column="interview_date" jdbcType="DATE" property="interviewDate" />
|
|
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
|
|
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
|
|
<result column="is_partner_interview" jdbcType="TINYINT" property="isPartnerInterview" />
|
|
<result column="actual_start_time" jdbcType="TIMESTAMP" property="actualStartTime" />
|
|
<result column="actual_end_time" jdbcType="TIMESTAMP" property="actualEndTime" />
|
|
<result column="room_id" jdbcType="VARCHAR" property="roomId" />
|
|
<result column="room_password" jdbcType="VARCHAR" property="roomPassword" />
|
|
<result column="interviewer" jdbcType="VARCHAR" property="interviewer" />
|
|
<result column="room_status" jdbcType="TINYINT" property="roomStatus" />
|
|
<result column="deleted" jdbcType="BIT" property="deleted" />
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
|
id, partner_line_id, partner_id, interview_date, start_time, end_time, is_partner_interview,
|
|
actual_start_time, actual_end_time, room_id, room_password, interviewer, room_status,
|
|
deleted, create_time, update_time
|
|
</sql>
|
|
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
|
|
insert into hy_partner_interview_plan
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="record.partnerLineId != null">
|
|
partner_line_id,
|
|
</if>
|
|
<if test="record.partnerId != null">
|
|
partner_id,
|
|
</if>
|
|
<if test="record.interviewDate != null">
|
|
interview_date,
|
|
</if>
|
|
<if test="record.startTime != null">
|
|
start_time,
|
|
</if>
|
|
<if test="record.endTime != null">
|
|
end_time,
|
|
</if>
|
|
<if test="record.isPartnerInterview != null">
|
|
is_partner_interview,
|
|
</if>
|
|
<if test="record.actualStartTime != null">
|
|
actual_start_time,
|
|
</if>
|
|
<if test="record.actualEndTime != null">
|
|
actual_end_time,
|
|
</if>
|
|
<if test="record.roomId != null">
|
|
room_id,
|
|
</if>
|
|
<if test="record.roomPassword != null">
|
|
room_password,
|
|
</if>
|
|
<if test="record.interviewer != null">
|
|
interviewer,
|
|
</if>
|
|
<if test="record.roomStatus != null">
|
|
room_status,
|
|
</if>
|
|
<if test="record.deleted != null">
|
|
deleted,
|
|
</if>
|
|
<if test="record.createTime != null">
|
|
create_time,
|
|
</if>
|
|
<if test="record.updateTime != null">
|
|
update_time,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="record.partnerLineId != null">
|
|
#{record.partnerLineId},
|
|
</if>
|
|
<if test="record.partnerId != null">
|
|
#{record.partnerId},
|
|
</if>
|
|
<if test="record.interviewDate != null">
|
|
#{record.interviewDate},
|
|
</if>
|
|
<if test="record.startTime != null">
|
|
#{record.startTime},
|
|
</if>
|
|
<if test="record.endTime != null">
|
|
#{record.endTime},
|
|
</if>
|
|
<if test="record.isPartnerInterview != null">
|
|
#{record.isPartnerInterview},
|
|
</if>
|
|
<if test="record.actualStartTime != null">
|
|
#{record.actualStartTime},
|
|
</if>
|
|
<if test="record.actualEndTime != null">
|
|
#{record.actualEndTime},
|
|
</if>
|
|
<if test="record.roomId != null">
|
|
#{record.roomId},
|
|
</if>
|
|
<if test="record.roomPassword != null">
|
|
#{record.roomPassword},
|
|
</if>
|
|
<if test="record.interviewer != null">
|
|
#{record.interviewer},
|
|
</if>
|
|
<if test="record.roomStatus != null">
|
|
#{record.roomStatus},
|
|
</if>
|
|
<if test="record.deleted != null">
|
|
#{record.deleted},
|
|
</if>
|
|
<if test="record.createTime != null">
|
|
#{record.createTime},
|
|
</if>
|
|
<if test="record.updateTime != null">
|
|
#{record.updateTime},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
<update id="updateByPrimaryKeySelective">
|
|
update hy_partner_interview_plan
|
|
<set>
|
|
<if test="record.partnerLineId != null">
|
|
partner_line_id = #{record.partnerLineId},
|
|
</if>
|
|
<if test="record.partnerId != null">
|
|
partner_id = #{record.partnerId},
|
|
</if>
|
|
<if test="record.interviewDate != null">
|
|
interview_date = #{record.interviewDate},
|
|
</if>
|
|
<if test="record.startTime != null">
|
|
start_time = #{record.startTime},
|
|
</if>
|
|
<if test="record.endTime != null">
|
|
end_time = #{record.endTime},
|
|
</if>
|
|
<if test="record.isPartnerInterview != null">
|
|
is_partner_interview = #{record.isPartnerInterview},
|
|
</if>
|
|
<if test="record.actualStartTime != null">
|
|
actual_start_time = #{record.actualStartTime},
|
|
</if>
|
|
<if test="record.actualEndTime != null">
|
|
actual_end_time = #{record.actualEndTime},
|
|
</if>
|
|
<if test="record.roomId != null">
|
|
room_id = #{record.roomId},
|
|
</if>
|
|
<if test="record.roomPassword != null">
|
|
room_password = #{record.roomPassword},
|
|
</if>
|
|
<if test="record.interviewer != null">
|
|
interviewer = #{record.interviewer},
|
|
</if>
|
|
<if test="record.roomStatus != null">
|
|
room_status = #{record.roomStatus},
|
|
</if>
|
|
<if test="record.deleted != null">
|
|
deleted = #{record.deleted},
|
|
</if>
|
|
<if test="record.createTime != null">
|
|
create_time = #{record.createTime},
|
|
</if>
|
|
<if test="record.updateTime != null">
|
|
update_time = #{record.updateTime},
|
|
</if>
|
|
</set>
|
|
where id = #{record.id}
|
|
</update>
|
|
|
|
<select id="getCurrentDateInterviewCount" resultType="java.lang.Integer">
|
|
select count(1) from hy_partner_interview_plan
|
|
<where>
|
|
<if test="userId!=null and userId!=''">
|
|
and interviewer = #{userId}
|
|
</if>
|
|
<if test="currentDate!=null and currentDate!=''">
|
|
and interview_date = #{currentDate}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
|
|
<select id="getInterviewCount" resultType="com.cool.store.dto.partner.SpecialDateRangeInterviewCountDTO">
|
|
select
|
|
sum(if(interview_date=#{currentDate},1,0)) as currentDayInterviewCount,
|
|
sum(if(start_time>#{startTime} and #{endTime},1,0)) as lastSevenDayInterviewCount
|
|
FROM hy_partner_interview_plan
|
|
where interviewer = #{userId}
|
|
</select>
|
|
|
|
<select id="getInterviewPlanList" resultMap="BaseResultMap">
|
|
select * from hy_partner_interview_plan
|
|
<where>
|
|
<if test="userId!=null and userId!=''">
|
|
and interviewer = #{userId}
|
|
</if>
|
|
<if test="currentDate!=null and currentDate!=''">
|
|
and interview_date = #{currentDate}
|
|
</if>
|
|
and (start_time>now() or (start_time<![CDATA[<]]>now() and room_status!=2))
|
|
order by start_time
|
|
</where>
|
|
</select>
|
|
|
|
<select id="getPartnerInterviewInfoList" resultType="com.cool.store.dto.partner.PartnerInterviewInfoDTO">
|
|
select
|
|
a.id as id,
|
|
a.deadline as deadline,
|
|
a.status as status,
|
|
a.auth_code as authCode,
|
|
a.approve_time as approveTime,
|
|
a.process_info as processInfo,
|
|
b.id as interviewId,
|
|
b.partner_line_id as partnerLineId,
|
|
b.partner_id as partnerId,
|
|
b.start_time as startTime,
|
|
b.end_time as endTime,
|
|
b.interviewer as interviewer,
|
|
b.create_time as createTime,
|
|
b.room_id as roomId
|
|
from hy_partner_interview a inner join hy_partner_interview_plan b on a.interview_plan_id = b.id
|
|
<where>
|
|
<if test="userId!=null and userId!=''">
|
|
and a.interviewer = #{userId}
|
|
</if>
|
|
<if test="workflowStage!=null and workflowStage!=''">
|
|
and a.workflow_stage= #{workflowStage}
|
|
</if>
|
|
<if test="workflowStatus!=null and workflowStatus!=''">
|
|
and a.workflow_status = #{workflowStatus}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="getInterviewList" resultType="com.cool.store.vo.interview.InterviewVO">
|
|
select hpip.id as interviewId,
|
|
hpui.username as partnerName,
|
|
hpui.mobile as partnerMobile,
|
|
hpip.room_id as roomId,
|
|
hpip.start_time as startTime,
|
|
hpui.username as interviewerName,
|
|
hpui.mobile as interviewerMobile,
|
|
hpip.room_status as roomStatus,
|
|
hpip.end_time as endTime
|
|
from hy_partner_interview_plan hpip
|
|
left join hy_partner_line_info hpll on hpip.partner_line_id = hpll.id
|
|
left join hy_partner_user_info hpui on hpui.partner_id = hpip.partner_id
|
|
<where>
|
|
<if test="record.partnerName !=null and record.partnerName!=''">
|
|
hpui.username like concat('%',#{record.partnerName},'%')
|
|
</if>
|
|
<if test="record.partnerMobile !=null and record.partnerMobile!=''">
|
|
hpui.mobile like concat('%',#{record.partnerMobile},'%')
|
|
</if>
|
|
<if test="record.roomId !=null and record.roomId!=''">
|
|
hpip.room_id = #{record.roomId}
|
|
</if>
|
|
<if test="record.interviewerName !=null and record.interviewerName!=''">
|
|
hpui.username like concat('%',#{record.interviewerName},'%')
|
|
</if>
|
|
<if test="record.interviewerMobile !=null and record.interviewerMobile!=''">
|
|
hpui.mobile like concat('%',#{record.interviewerMobile},'%')
|
|
</if>
|
|
<if test="record.roomStatus !=null and record.roomStatus!=''">
|
|
hpip.room_status = #{record.roomStatus}
|
|
</if>
|
|
<if test="record.startTime !=null and record.startTime!=''">
|
|
hpip.start_time <= #{record.startTime}
|
|
</if>
|
|
<if test="record.endTime !=null and record.endTime!=''">
|
|
hpip.end_time >= #{record.endTime}
|
|
</if>
|
|
</where>
|
|
|
|
</select>
|
|
<select id="getInterviewInfo" resultType="com.cool.store.vo.interview.InterviewVO">
|
|
select hpip.id as interviewId,
|
|
hpi.qualify_verify_id as qualifyVerifyId,
|
|
hpi.pass_time as passTime,
|
|
hpi.pass_reason as passReason,
|
|
hpi.recorder as recorderId,
|
|
hpi.record_time as recordTime,
|
|
hpi.summary as summary,
|
|
hpi.process_info as processInfo,
|
|
hpi.auth_code as processInfo,
|
|
hpi.expiry_date as expiryDate,
|
|
hpi.pass_pdf_url as passPdfUrl,
|
|
hpi.pass_image_url as passImageUrl,
|
|
hpui.username as partnerName,
|
|
hpui.mobile as partnerMobile,
|
|
hpip.room_id as roomId,
|
|
hpip.start_time as startTime,
|
|
hpip.room_status as roomStatus,
|
|
hpip.end_time as endTime,
|
|
hpip.partner_id as partnerId,
|
|
hpip.interviewer as interviewerId,
|
|
hpi.status as status
|
|
from hy_partner_interview_plan hpip
|
|
left join hy_partner_line_info hpll on hpip.partner_line_id = hpll.id
|
|
left join hy_partner_user_info hpui on hpui.partner_id = hpip.partner_id
|
|
left join hy_partner_interview hpi on hpip.id = hpi.interview_plan_id
|
|
where hpip.id = #{interviewId}
|
|
</select>
|
|
|
|
<!-- 查询用户基本信息 -->
|
|
<select id="getEnterpriseUserBaseInfo" resultType="com.cool.store.vo.EnterpriseUserBaseInfoVO">
|
|
select name, mobile
|
|
from enterprise_user
|
|
where user_id = #{userId}
|
|
</select>
|
|
</mapper> |