| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- <?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.ym.mec.biz.dal.dao.TempLittleArtistTrainingCampDao">
- <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.TempLittleArtistTrainingCamp">
- <id column="id_" jdbcType="INTEGER" property="id"/>
- <result column="name_" jdbcType="VARCHAR" property="name"/>
- <result column="num_" jdbcType="INTEGER" property="num"/>
- <result column="apply_start_date_" jdbcType="TIMESTAMP" property="applyStartDate"/>
- <result column="apply_end_date_" jdbcType="TIMESTAMP" property="applyEndDate"/>
- <result column="train_start_date_" jdbcType="TIMESTAMP" property="trainStartDate"/>
- <result column="train_end_date_" jdbcType="TIMESTAMP" property="trainEndDate"/>
- <result column="state_" jdbcType="VARCHAR" property="state"/>
- <result column="im_group_ids_" jdbcType="VARCHAR" property="imGroupIds"/>
- <result column="del_flag_" jdbcType="INTEGER" property="delFlag"/>
- <result column="create_by_" jdbcType="INTEGER" property="createBy"/>
- <result column="create_time_" jdbcType="TIMESTAMP" property="createTime"/>
- <result column="update_by_" jdbcType="INTEGER" property="updateBy"/>
- <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime"/>
- </resultMap>
- <sql id="Base_Column_List">
- id_
- , name_, num_, apply_start_date_, apply_end_date_, train_start_date_, train_end_date_, state_, im_group_ids_, create_by_, create_time_, update_by_, update_time_
- </sql>
- <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
- parameterType="com.ym.mec.biz.dal.entity.TempLittleArtistTrainingCamp">
- insert into temp_little_artist_training_camp(name_, num_, apply_start_date_, apply_end_date_, train_start_date_,
- train_end_date_, state_, im_group_ids_, del_flag_,create_by_, create_time_, update_by_, update_time_)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.name}, #{entity.num}, #{entity.applyStartDate}, #{entity.applyEndDate}, #{entity.trainStartDate},
- #{entity.trainEndDate}, #{entity.state}, #{entity.imGroupIds}, #{entity.delFlag},#{entity.createBy}, #{entity.createTime},
- #{entity.updateBy}, #{entity.updateTime})
- </foreach>
- </insert>
- <select id="queryUserTrainingTime" resultType="com.ym.mec.biz.dal.vo.TempUserTrainingTimeDetailVo" parameterType="java.util.Map">
- SELECT
- a.user_id_ AS userId,
- a.create_time_ AS trainingDate,
- sum(a.play_time_) AS playTime
- FROM
- ( SELECT
- user_id_,
- ifnull(play_time_, 0) AS play_time_,
- date_format(create_time_, '%Y-%m-%d') AS create_time_
- FROM sys_music_compare_record
- <where>
- <if test="param.startTime != null">
- AND create_time_ >= #{param.startTime}
- </if>
- <if test="param.endTime != null">
- AND create_time_ <= #{param.endTime}
- </if>
- <if test="param.userId != null">
- AND user_id_ = #{param.userId}
- </if>
- <if test="param.userIdList !=null and param.userIdList.size()>0">
- AND user_id_ IN
- <foreach collection="param.userIdList" item="userId" open="(" close=")" separator=",">
- #{userId}
- </foreach>
- </if>
- </where>
- ) AS a
- GROUP BY a.user_id_, a.create_time_
- </select>
- <select id="queryAllUserId" resultType="java.lang.Integer">
- SELECT
- distinct user_id_
- FROM
- temp_little_artist_training_camp_user_relation
- </select>
- <select id="queryCampUser" resultType="com.ym.mec.biz.dal.vo.TempCampUserVo">
- select
- b.id_ as id,
- b.username_ as username,
- b.phone_ as phone,
- a.state_ as state,
- c.name_ as campName
- from temp_little_artist_training_camp_user_relation as a
- left join sys_user as b on a.user_id_ = b.id_
- left join temp_little_artist_training_camp as c on a.activity_id_ = c.id_
- <where>
- <if test="param.state != null ">
- AND a.state_ = #{param.state}
- </if>
- <if test="param.search != null ">
- AND (
- b.`id_` LIKE CONCAT('%', #{param.search},'%')
- OR b.`name_` LIKE CONCAT('%', #{param.search},'%')
- OR b.`phone_` LIKE CONCAT('%', #{param.search},'%')
- )
- </if>
- </where>
- </select>
- </mapper>
|