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.
142 lines
6.6 KiB
142 lines
6.6 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.LatestActInfoDao">
|
|
|
|
<resultMap type="com.epmet.entity.LatestActInfoEntity" id="latestActInfoMap">
|
|
<result property="id" column="ID"/>
|
|
<result property="customerId" column="CUSTOMER_ID"/>
|
|
<result property="title" column="TITLE"/>
|
|
<result property="coverPic" column="COVER_PIC"/>
|
|
<result property="signUpStartTime" column="SIGN_UP_START_TIME"/>
|
|
<result property="signUpEndTime" column="SIGN_UP_END_TIME"/>
|
|
<result property="requirement" column="REQUIREMENT"/>
|
|
<result property="actStartTime" column="ACT_START_TIME"/>
|
|
<result property="actEndTime" column="ACT_END_TIME"/>
|
|
<result property="actAddress" column="ACT_ADDRESS"/>
|
|
<result property="actLongitude" column="ACT_LONGITUDE"/>
|
|
<result property="actLatitude" column="ACT_LATITUDE"/>
|
|
<result property="signInStartTime" column="SIGN_IN_START_TIME"/>
|
|
<result property="signInEndTime" column="SIGN_IN_END_TIME"/>
|
|
<result property="signInAddress" column="SIGN_IN_ADDRESS"/>
|
|
<result property="signInLongitude" column="SIGN_IN_LONGITUDE"/>
|
|
<result property="signInLatitude" column="SIGN_IN_LATITUDE"/>
|
|
<result property="signInRadius" column="SIGN_IN_RADIUS"/>
|
|
<result property="actQuotaCategory" column="ACT_QUOTA_CATEGORY"/>
|
|
<result property="actQuota" column="ACT_QUOTA"/>
|
|
<result property="sponsorContacts" column="SPONSOR_CONTACTS"/>
|
|
<result property="sponsorTel" column="SPONSOR_TEL"/>
|
|
<result property="sponsorType" column="SPONSOR_TYPE"/>
|
|
<result property="sponsorId" column="SPONSOR_ID"/>
|
|
<result property="sponsorName" column="SPONSOR_NAME"/>
|
|
<result property="pid" column="PID"/>
|
|
<result property="reward" column="REWARD"/>
|
|
<result property="volunteerLimit" column="VOLUNTEER_LIMIT"/>
|
|
<result property="auditSwitch" column="AUDIT_SWITCH"/>
|
|
<result property="revision" column="REVISION"/>
|
|
<result property="createdBy" column="CREATED_BY"/>
|
|
<result property="createdTime" column="CREATED_TIME"/>
|
|
<result property="updatedBy" column="UPDATED_BY"/>
|
|
<result property="updatedTime" column="UPDATED_TIME"/>
|
|
<result property="delFlag" column="DEL_FLAG"/>
|
|
<result property="actInfoId" column="ACT_INFO_ID"/>
|
|
</resultMap>
|
|
|
|
<!-- 查询当前用户保留的活动记录 -->
|
|
<select id="countByUserId" parameterType="java.lang.String" resultType="java.lang.Integer">
|
|
SELECT
|
|
count( 1 ) as totalNum
|
|
FROM
|
|
latest_act_info lai
|
|
WHERE
|
|
lai.DEL_FLAG = '0'
|
|
AND lai.CREATED_BY = #{userId}
|
|
AND (lai.act_info_id is null or trim(lai.act_info_id) ='')
|
|
</select>
|
|
|
|
<resultMap type="com.epmet.dto.result.work.LatestDraftActInfoResultDTO" id="LatestDraftActInfoResultMap">
|
|
<result property="actDraftId" column="ID"/>
|
|
<result property="customerId" column="CUSTOMER_ID"/>
|
|
<result property="title" column="TITLE"/>
|
|
<result property="coverPic" column="COVER_PIC"/>
|
|
<result property="signUpStartTime" column="SIGN_UP_START_TIME"/>
|
|
<result property="signUpEndTime" column="SIGN_UP_END_TIME"/>
|
|
<result property="requirement" column="REQUIREMENT"/>
|
|
<result property="actStartTime" column="ACT_START_TIME"/>
|
|
<result property="actEndTime" column="ACT_END_TIME"/>
|
|
<result property="actAddress" column="ACT_ADDRESS"/>
|
|
<result property="actLongitude" column="ACT_LONGITUDE"/>
|
|
<result property="actLatitude" column="ACT_LATITUDE"/>
|
|
<result property="signInStartTime" column="SIGN_IN_START_TIME"/>
|
|
<result property="signInEndTime" column="SIGN_IN_END_TIME"/>
|
|
<result property="signInAddress" column="SIGN_IN_ADDRESS"/>
|
|
<result property="signInLongitude" column="SIGN_IN_LONGITUDE"/>
|
|
<result property="signInLatitude" column="SIGN_IN_LATITUDE"/>
|
|
<result property="signInRadius" column="SIGN_IN_RADIUS"/>
|
|
<result property="actQuotaCategory" column="ACT_QUOTA_CATEGORY"/>
|
|
<result property="actQuota" column="ACT_QUOTA"/>
|
|
<result property="sponsorContacts" column="SPONSOR_CONTACTS"/>
|
|
<result property="sponsorTel" column="SPONSOR_TEL"/>
|
|
<result property="sponsorType" column="SPONSOR_TYPE"/>
|
|
<result property="sponsorId" column="SPONSOR_ID"/>
|
|
<result property="sponsorName" column="SPONSOR_NAME"/>
|
|
<result property="reward" column="REWARD"/>
|
|
<result property="volunteerLimit" column="VOLUNTEER_LIMIT"/>
|
|
<result property="auditSwitch" column="AUDIT_SWITCH"/>
|
|
</resultMap>
|
|
<!-- 获取用户最近一次编辑的活动信息 -->
|
|
<select id="selectLatestActDraft" parameterType="java.lang.String" resultMap="LatestDraftActInfoResultMap">
|
|
SELECT
|
|
lai.*
|
|
FROM
|
|
latest_act_info lai
|
|
WHERE
|
|
lai.DEL_FLAG = '0'
|
|
AND lai.CREATED_BY = #{userId}
|
|
ORDER BY
|
|
lai.CREATED_TIME DESC
|
|
LIMIT 1
|
|
</select>
|
|
|
|
<!-- 预览-查看活动详情 -->
|
|
<select id="previewActInfo" parameterType="java.lang.String" resultType="com.epmet.dto.result.work.ActPreviewResultDTO">
|
|
SELECT
|
|
lai.id AS actDraftId,
|
|
lai.title AS title,
|
|
lai.ACT_QUOTA AS actQuota,
|
|
lai.ACT_QUOTA_CATEGORY AS actQuotaCategory,
|
|
lai.REWARD AS reward,
|
|
lai.ACT_START_TIME AS actStartTime,
|
|
lai.ACT_END_TIME AS actEndTime,
|
|
lai.ACT_ADDRESS AS actAddress,
|
|
lai.SIGN_UP_END_TIME AS signUpEndTime,
|
|
lai.REQUIREMENT AS requirement,
|
|
lai.SPONSOR_NAME AS sponsorName,
|
|
lai.SPONSOR_CONTACTS AS sponsorContacts,
|
|
lai.SPONSOR_TEL AS sponsorTel,
|
|
lai.SPONSOR_TYPE,
|
|
lai.SPONSOR_ID,
|
|
lai.PID,
|
|
lai.ACT_TYPE,
|
|
lai.UNIT_ID,
|
|
lai.SERVICE_MATTER,
|
|
lai.TARGET
|
|
FROM
|
|
latest_act_info lai
|
|
WHERE
|
|
lai.DEL_FLAG = '0'
|
|
AND lai.ID = #{actDraftId}
|
|
</select>
|
|
|
|
<!-- -->
|
|
<update id="updateToDelById" parameterType="java.lang.String">
|
|
update latest_act_info set DEL_FLAG='1' where id=#{id}
|
|
</update>
|
|
|
|
<!-- 发布活动成功后,更新草稿表里的活动id -->
|
|
<update id="updateActInfoId" parameterType="map">
|
|
UPDATE latest_act_info
|
|
SET ACT_INFO_ID = #{actInfoId}
|
|
WHERE id = #{actDraftId}
|
|
</update>
|
|
</mapper>
|