ActivityJoinInfoMapper.java
package cn.jmfen.sport.activitycenter.mapper;import cn.jmfen.sport.activitycenter.bo.ActivityJoinBo;import cn.jmfen.sport.activitycenter.vo.ActivityJoinVo;import com.baomidou.mybatisplus.extension.plugins.pagination.Page;import org.apache.ibatis.annotations.Mapper;import org.apache.ibatis.annotations.Param;/*** @Author: Luoma* @Description: 活动流水* @Date: 2020/2/18 15:59*/@Mapperpublic interface ActivityJoinInfoMapper {/*** 查询活动流水列表分页* @param page* @param activityJoinBo* @return*/Page<ActivityJoinVo> queryJoinInfoListByPage(@Param("page") Page page, @Param("joinBo") ActivityJoinBo activityJoinBo);}
ActivityJoinInfoMapper.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="cn.jmfen.sport.activitycenter.mapper.ActivityJoinInfoMapper"><select id="queryJoinInfoListByPage" resultType="cn.jmfen.sport.activitycenter.vo.ActivityJoinVo">SELECTj.id,j.activity_id,b.activity_name,j.user_id,c.user_nickname username,c.lottery_code_status drawStatus,GROUP_CONCAT(c.lottery_code) lotteryCodeStr,(SELECT DISTINCT r.winner_lottery_codesFROM jmf_activity_round rWHERE r.activity_id = j.activity_id AND r.id = j.activity_round_id and r.round_num = j.round_num) winnerLotteryCodeStr,j.join_device,j.promotion_channel,j.join_timefrom jmf_activity_join jLEFT JOIN jmf_activity_base_info b on b.id = j.activity_idLEFT JOIN jmf_activity_lottery_code c on c.activity_join_id = j.id<where><if test="joinBo.activityName != null and joinBo.activityName != ''">and b.activity_name like concat('%',#{joinBo.activityName},'%')</if><if test="joinBo.promotionChannel != null and joinBo.promotionChannel != ''">and j.promotion_channel = #{joinBo.promotionChannel}</if><if test="joinBo.drawStatus != null and joinBo.drawStatus != '' or joinBo.drawStatus == 0 ">and c.lottery_code_status = #{joinBo.drawStatus}</if><if test="joinBo.userSearchText != null and joinBo.userSearchText.length > 0">and (j.user_id like concat('%',#{joinBo.userSearchText},'%') orc.user_nickname like concat('%',#{joinBo.userSearchText},'%'))</if><if test="joinBo.startJoinTime != null and joinBo.startJoinTime !=''"><![CDATA[ and j.join_time >=STR_TO_DATE(#{joinBo.startJoinTime}, '%Y-%m-%d %H:%i:%s') ]]></if><if test="joinBo.endJoinTime !=null and joinBo.endJoinTime !=''"><![CDATA[ and j.join_time <=STR_TO_DATE(#{joinBo.endJoinTime}, '%Y-%m-%d %H:%i:%s') ]]></if></where>GROUP BY j.idorder by j.join_time desc</select></mapper>
