You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
86 lines
3.4 KiB
86 lines
3.4 KiB
<?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.epmet.dao.ActUserRelationDao">
|
|
|
|
<resultMap type="com.epmet.entity.ActUserRelationEntity" id="actUserRelationMap">
|
|
<result property="id" column="ID"/>
|
|
<result property="actId" column="ACT_ID"/>
|
|
<result property="userId" column="USER_ID"/>
|
|
<result property="status" column="STATUS"/>
|
|
<result property="passedType" column="PASSED_TYPE"/>
|
|
<result property="auditTime" column="AUDIT_TIME"/>
|
|
<result property="failureReason" column="FAILURE_REASON"/>
|
|
<result property="cancelTime" column="CANCEL_TIME"/>
|
|
<result property="cancelReason" column="CANCEL_REASON"/>
|
|
<result property="processFlag" column="PROCESS_FLAG"/>
|
|
<result property="signInFlag" column="SIGN_IN_FLAG"/>
|
|
<result property="rewardFlag" column="REWARD_FLAG"/>
|
|
<result property="denyRewardReason" column="DENY_REWARD_REASON"/>
|
|
<result property="revision" column="REVISION"/>
|
|
<result property="delFlag" column="DEL_FLAG"/>
|
|
<result property="createdBy" column="CREATED_BY"/>
|
|
<result property="createdTime" column="CREATED_TIME"/>
|
|
<result property="updatedBy" column="UPDATED_BY"/>
|
|
<result property="updatedTime" column="UPDATED_TIME"/>
|
|
</resultMap>
|
|
|
|
<!-- 根据活动id,当前状态(已报名/待审核auditing,审核通过passed,审核不通过refused取消报名canceld,)查询待审核人员关系记录 -->
|
|
<select id="selecUserList" resultType="com.epmet.dto.ActUserRelationDTO" parameterType="map">
|
|
SELECT
|
|
aur.*
|
|
FROM
|
|
act_user_relation aur
|
|
WHERE
|
|
aur.DEL_FLAG = '0'
|
|
AND aur.`STATUS` = #{status}
|
|
AND aur.ACT_ID = #{actId}
|
|
order by aur.CREATED_TIME desc
|
|
</select>
|
|
|
|
<!-- 根据活动id,当前状态(已报名/待审核auditing,审核通过passed,审核不通过refused取消报名canceld,)返回用户id集合 -->
|
|
<select id="selectUserIdList" resultType="java.lang.String" parameterType="map">
|
|
SELECT
|
|
distinct aur.USER_ID as userIds
|
|
FROM
|
|
act_user_relation aur
|
|
WHERE
|
|
aur.DEL_FLAG = '0'
|
|
AND aur.`STATUS` =#{status}
|
|
AND aur.ACT_ID = #{actId}
|
|
order by aur.CREATED_TIME desc
|
|
</select>
|
|
|
|
<select id="selectCountUser" resultType="java.lang.Integer" parameterType="map">
|
|
SELECT
|
|
COUNT(1) AS TOTAL
|
|
FROM
|
|
act_user_relation aur
|
|
WHERE
|
|
aur.DEL_FLAG = '0'
|
|
AND aur.`STATUS` =#{status}
|
|
AND aur.ACT_ID = #{actId}
|
|
</select>
|
|
|
|
<!-- 根据活动id,查询活动已报名的人数 -->
|
|
<select id="selectActSignupNum" parameterType="java.lang.String" resultType="java.lang.Integer">
|
|
SELECT
|
|
count(1) signupNum
|
|
FROM act_user_relation re
|
|
WHERE re.DEL_FLAG = '0'
|
|
AND re.ACT_ID = #{actId}
|
|
GROUP BY re.ACT_ID
|
|
</select>
|
|
|
|
<update id="updateUserStatusToCanceld" parameterType="com.epmet.dto.ActUserRelationDTO">
|
|
UPDATE act_user_relation
|
|
SET
|
|
STATUS = #{status},
|
|
CANCEL_TIME = NOW(),
|
|
CANCEL_REASON = #{cancelReason}
|
|
WHERE
|
|
DEL_FLAG = '0'
|
|
AND ACT_ID = #{actId}
|
|
AND USER_ID = #{userId}
|
|
</update>
|
|
</mapper>
|
|
|