|  |  |  | 
|---|
|  |  |  | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <mapper namespace="com.matrix.system.activity.dao.ActivitySignReceiveRecordDao"> | 
|---|
|  |  |  | <!-- 定义ActivitySignReceiveRecord 的复杂关联map --> | 
|---|
|  |  |  | <resultMap type="com.matrix.system.activity.entity.ActivitySignReceiveRecord" id="ActivitySignReceiveRecordMap"> | 
|---|
|  |  |  | <id property="id" column="id" /> | 
|---|
|  |  |  | <result property="createBy" column="create_by" /> | 
|---|
|  |  |  | <result property="createTime" column="create_time" /> | 
|---|
|  |  |  | <result property="updateBy" column="update_by" /> | 
|---|
|  |  |  | <result property="updateTime" column="update_time" /> | 
|---|
|  |  |  | <result property="openId" column="open_id" /> | 
|---|
|  |  |  | <result property="receiveTime" column="receive_time" /> | 
|---|
|  |  |  | <result property="remark" column="remark" /> | 
|---|
|  |  |  | <result property="awardId" column="award_id" /> | 
|---|
|  |  |  | <result property="state" column="state" /> | 
|---|
|  |  |  | <result property="writeOffCode" column="write_off_code" /> | 
|---|
|  |  |  | <result property="activityId" column="activity_id" /> | 
|---|
|  |  |  | <result property="companyId" column="company_id" /> | 
|---|
|  |  |  | </resultMap> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 定义ActivitySignReceiveRecord 的简单map  ,本map不添加其他的关联属性 --> | 
|---|
|  |  |  | <resultMap type="com.matrix.system.activity.entity.ActivitySignReceiveRecord" id="ActivitySignReceiveRecordSimpleMap"> | 
|---|
|  |  |  | <id property="id" column="id" /> | 
|---|
|  |  |  | <result property="createBy" column="create_by" /> | 
|---|
|  |  |  | <result property="createTime" column="create_time" /> | 
|---|
|  |  |  | <result property="updateBy" column="update_by" /> | 
|---|
|  |  |  | <result property="updateTime" column="update_time" /> | 
|---|
|  |  |  | <result property="openId" column="open_id" /> | 
|---|
|  |  |  | <result property="receiveTime" column="receive_time" /> | 
|---|
|  |  |  | <result property="remark" column="remark" /> | 
|---|
|  |  |  | <result property="awardId" column="award_id" /> | 
|---|
|  |  |  | <result property="state" column="state" /> | 
|---|
|  |  |  | <result property="writeOffCode" column="write_off_code" /> | 
|---|
|  |  |  | <result property="activityId" column="activity_id" /> | 
|---|
|  |  |  | <result property="companyId" column="company_id" /> | 
|---|
|  |  |  | </resultMap> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <select id="findSignReceiveList" resultType="com.matrix.system.activity.vo.SignReceiveListVo"> | 
|---|
|  |  |  | SELECT | 
|---|
|  |  |  | a.id id, | 
|---|
|  |  |  | b.nick_name nickName, | 
|---|
|  |  |  | a.receive_time reciveTime, | 
|---|
|  |  |  | a.state, | 
|---|
|  |  |  | c.cumulative_day cumulativeDay, | 
|---|
|  |  |  | c.award_type awardType, | 
|---|
|  |  |  | c.award_name awardName | 
|---|
|  |  |  | c.award_name awardName, | 
|---|
|  |  |  | c.award_rule awardRule | 
|---|
|  |  |  | FROM | 
|---|
|  |  |  | activity_sign_receive_record a | 
|---|
|  |  |  | LEFT JOIN biz_user b ON a.open_id = b.open_id | 
|---|
|  |  |  | LEFT JOIN biz_user b ON a.user_id = b.user_id | 
|---|
|  |  |  | LEFT JOIN activity_sign_award_set c ON a.award_id = c.id | 
|---|
|  |  |  | <where> | 
|---|
|  |  |  | a.company_id = #{record.companyId} | 
|---|
|  |  |  | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <select id="getSignAwardReceiveCount" resultType="int"> | 
|---|
|  |  |  | SELECT | 
|---|
|  |  |  | count(a.id) | 
|---|
|  |  |  | FROM | 
|---|
|  |  |  | activity_sign_receive_record a | 
|---|
|  |  |  | LEFT JOIN activity_sign_award_set b ON a.award_id = b.id | 
|---|
|  |  |  | where | 
|---|
|  |  |  | b.award_type = 1 | 
|---|
|  |  |  | and a.state = 1 | 
|---|
|  |  |  | and a.company_id = #{companyId} | 
|---|
|  |  |  | and a.user_id = #{userId} | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <select id="selectSignAwardList" resultType="com.matrix.system.shopXcx.api.vo.SignAwardListVo"> | 
|---|
|  |  |  | SELECT | 
|---|
|  |  |  | a.id id, | 
|---|
|  |  |  | a.state state, | 
|---|
|  |  |  | 1 total, | 
|---|
|  |  |  | a.receive_time receiveTime, | 
|---|
|  |  |  | b.award_way awardWay, | 
|---|
|  |  |  | b.introduce_img introduceImg, | 
|---|
|  |  |  | b.award_name awardName | 
|---|
|  |  |  |  | 
|---|
|  |  |  | FROM | 
|---|
|  |  |  | activity_sign_receive_record a | 
|---|
|  |  |  | LEFT JOIN activity_sign_award_set b ON a.award_id = b.id | 
|---|
|  |  |  | WHERE | 
|---|
|  |  |  | b.award_type = 1 | 
|---|
|  |  |  | AND a.state = 1 | 
|---|
|  |  |  | and a.company_id = #{record.companyId} | 
|---|
|  |  |  | and a.user_id = #{record.userId} | 
|---|
|  |  |  | <if test="record.sort !=null"> | 
|---|
|  |  |  | order by | 
|---|
|  |  |  | a.${record.sort} ${record.order} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <select id="selectSeeAwardTextVOById" resultType="com.matrix.system.shopXcx.api.vo.SeeAwardTextVo"> | 
|---|
|  |  |  | SELECT | 
|---|
|  |  |  | a.id id, | 
|---|
|  |  |  | a.state state, | 
|---|
|  |  |  | a.receive_time receiveTime, | 
|---|
|  |  |  | a.write_off_code writeOffCode, | 
|---|
|  |  |  | 1 total, | 
|---|
|  |  |  | b.wechat_img wechatImg, | 
|---|
|  |  |  | b.prize_address prizeAddress, | 
|---|
|  |  |  | b.operation_tip operationTip, | 
|---|
|  |  |  | b.prize_end_time prizeEndTime, | 
|---|
|  |  |  | b.prize_start_time prizeStartTime, | 
|---|
|  |  |  | b.award_way awardWay, | 
|---|
|  |  |  | b.introduce_img introduceImg, | 
|---|
|  |  |  | b.award_name awardName | 
|---|
|  |  |  | FROM | 
|---|
|  |  |  | activity_sign_receive_record a | 
|---|
|  |  |  | LEFT JOIN activity_sign_award_set b ON a.award_id = b.id | 
|---|
|  |  |  | WHERE | 
|---|
|  |  |  | a.id = #{record.awardId} | 
|---|
|  |  |  | and a.company_id = #{record.companyId} | 
|---|
|  |  |  | and a.user_id = #{record.userId} | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </mapper> | 
|---|