|
|
|
<?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.zhiyuanzhe.mapper.ActivityUserMapper">
|
|
|
|
<resultMap type="BPersonTags" id="personTags">
|
|
|
|
<result property="id" column="id"/>
|
|
|
|
<result property="uId" column="u_id"/>
|
|
|
|
<result property="ageRange" column="age_range"/>
|
|
|
|
<result property="housingRange" column="housing_range"/>
|
|
|
|
<result property="educationRange" column="education_range"/>
|
|
|
|
<result property="interestRange" column="interest_range"/>
|
|
|
|
<result property="politicalRange" column="political_range"/>
|
|
|
|
<result property="sexRange" column="sex_range"/>
|
|
|
|
<result property="nationalityRange" column="nationality_range"/>
|
|
|
|
<result property="professionalRange" column="professional_range"/>
|
|
|
|
<result property="industryRange" column="industry_range"/>
|
|
|
|
<result property="schoolRange" column="school_range"/>
|
|
|
|
<result property="createId" column="create_id"/>
|
|
|
|
<result property="createBy" column="create_by"/>
|
|
|
|
<result property="createTime" column="create_time"/>
|
|
|
|
<result property="updateId" column="update_id"/>
|
|
|
|
<result property="updateBy" column="update_by"/>
|
|
|
|
<result property="updateTime" column="update_time"/>
|
|
|
|
<result property="remark" column="remark"/>
|
|
|
|
<result property="userId" column="user_id"/>
|
|
|
|
<result property="deptId" column="dept_id"/>
|
|
|
|
<result property="status" column="status"/>
|
|
|
|
<result property="degreeOfMatch" column="degree_of_match"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<resultMap type="BActivity" id="activityResult">
|
|
|
|
<result property="id" column="id"/>
|
|
|
|
<result property="name" column="name"/>
|
|
|
|
<result property="content" column="content"/>
|
|
|
|
<result property="publisher" column="publisher"/>
|
|
|
|
<result property="activityTime" column="activity_time"/>
|
|
|
|
<result property="address" column="address"/>
|
|
|
|
<result property="ageRange" column="age_range"/>
|
|
|
|
<result property="housingRange" column="housing_range"/>
|
|
|
|
<result property="educationRange" column="education_range"/>
|
|
|
|
<result property="interestRange" column="interest_range"/>
|
|
|
|
<result property="politicalRange" column="political_range"/>
|
|
|
|
<result property="sexRange" column="sex_range"/>
|
|
|
|
<result property="nationalityRange" column="nationality_range"/>
|
|
|
|
<result property="professionalRange" column="professional_range"/>
|
|
|
|
<result property="industryRange" column="industry_range"/>
|
|
|
|
<result property="schoolRange" column="school_range"/>
|
|
|
|
<result property="createId" column="create_id"/>
|
|
|
|
<result property="createBy" column="create_by"/>
|
|
|
|
<result property="createTime" column="create_time"/>
|
|
|
|
<result property="updateId" column="update_id"/>
|
|
|
|
<result property="updateBy" column="update_by"/>
|
|
|
|
<result property="updateTime" column="update_time"/>
|
|
|
|
<result property="remark" column="remark"/>
|
|
|
|
<result property="userId" column="user_id"/>
|
|
|
|
<result property="deptId" column="dept_id"/>
|
|
|
|
<result property="endTime" column="end_time"/>
|
|
|
|
<result property="status" column="status"/>
|
|
|
|
<result property="degreeOfMatch" column="degree_of_match"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<insert id="add" parameterType="BActivityUser" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
insert into b_activity_user
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="activityId != null">activity_id,</if>
|
|
|
|
<if test="uId != null">u_id,</if>
|
|
|
|
<if test="degreeOfMatch != null">degree_of_match,</if>
|
|
|
|
<if test="status != null">status,</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="activityId != null">#{activityId},</if>
|
|
|
|
<if test="uId != null">#{uId},</if>
|
|
|
|
<if test="degreeOfMatch != null">#{degreeOfMatch},</if>
|
|
|
|
<if test="status != null">#{status},</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
<update id="invite">
|
|
|
|
update b_activity_user
|
|
|
|
set status = 1
|
|
|
|
where u_id = #{req.userId}
|
|
|
|
and activity_id = #{req.activityId}
|
|
|
|
</update>
|
|
|
|
<update id="enroll">
|
|
|
|
update b_activity_user
|
|
|
|
set status = 2
|
|
|
|
where u_id = #{req.userId}
|
|
|
|
and activity_id = #{req.activityId}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
|
<delete id="delById" parameterType="Long">
|
|
|
|
delete
|
|
|
|
from b_activity_user
|
|
|
|
where id = #{id}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="delByActivityId" parameterType="Long">
|
|
|
|
delete
|
|
|
|
from b_activity_user
|
|
|
|
where activity_id = #{activityId}
|
|
|
|
</delete>
|
|
|
|
<select id="findUserByStatusAndActivityId" resultMap="personTags">
|
|
|
|
select bpt.*, bau.degree_of_match,bau.status
|
|
|
|
from b_activity_user bau
|
|
|
|
left join b_person_tags bpt on bau.u_id = bpt.u_id
|
|
|
|
where
|
|
|
|
<if test="status == 5">
|
|
|
|
bau.activity_id = #{activityId}
|
|
|
|
and bau.status != 2
|
|
|
|
</if>
|
|
|
|
<if test="status != 5">
|
|
|
|
bau.activity_id = #{activityId}
|
|
|
|
and bau.status = #{status}
|
|
|
|
</if>
|
|
|
|
order by bau.degree_of_match desc
|
|
|
|
</select>
|
|
|
|
<select id="eventRecommendations" resultMap="activityResult">
|
|
|
|
select bau.degree_of_match, bau.status, ba.*
|
|
|
|
from b_activity_user bau
|
|
|
|
left join b_activity ba on bau.activity_id = ba.id
|
|
|
|
where ba.status = 1 and bau.degree_of_match != 0
|
|
|
|
<if test="req.name != null and req.name != ''">
|
|
|
|
and ba.name like concat('%', #{req.name}, '%')
|
|
|
|
</if>
|
|
|
|
<if test="req.userId != null and req.userId != ''">
|
|
|
|
and bau.u_id = #{req.userId}
|
|
|
|
</if>
|
|
|
|
order by bau.degree_of_match desc
|
|
|
|
</select>
|
|
|
|
</mapper>
|