| | |
| | | import com.ks.lib.common.dao.MongodbBaseDao; |
| | | import com.ks.lucky.pojo.DO.LuckySponsorAd; |
| | | import com.ks.lucky.query.LuckySponsorAdQuery; |
| | | import com.ks.lucky.util.MongoDBQueryUtil; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.data.mongodb.core.query.Update; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | update(query, update); |
| | | } |
| | | |
| | | public List<LuckySponsorAd> list(LuckySponsorAdQuery query) { |
| | | private Criteria[] getWheres(LuckySponsorAdQuery query) { |
| | | List<Criteria> andWhere = new ArrayList<>(); |
| | | if (query.type != null) { |
| | | andWhere.add(Criteria.where("adType").is(query.type)); |
| | | } |
| | | if (query.sponsorId != null) { |
| | | andWhere.add(Criteria.where("sponsorId").is(query.sponsorId)); |
| | | } |
| | | |
| | | return null; |
| | | if (query.key != null) { |
| | | andWhere.add(Criteria.where("sponsorId").regex(query.key)); |
| | | } |
| | | |
| | | if (query.minCreateTime != null) { |
| | | andWhere.add(Criteria.where("createTime").gte(query.minCreateTime)); |
| | | } |
| | | |
| | | if (query.maxCreateTime != null) { |
| | | andWhere.add(Criteria.where("createTime").lt(query.maxCreateTime)); |
| | | } |
| | | |
| | | |
| | | Criteria[] wheres = new Criteria[andWhere.size()]; |
| | | andWhere.toArray(wheres); |
| | | return wheres; |
| | | } |
| | | |
| | | public List<LuckySponsorAd> list(LuckySponsorAdQuery query) { |
| | | Query dbQuery = new Query(); |
| | | dbQuery.addCriteria(new Criteria().andOperator(getWheres(query))); |
| | | dbQuery.skip(query.start); |
| | | dbQuery.limit(query.count); |
| | | |
| | | if (query.sortList != null && query.sortList.size() > 0) { |
| | | dbQuery.with(Sort.by(MongoDBQueryUtil.convertSQLSort(query.sortList))); |
| | | } |
| | | |
| | | return findList(dbQuery); |
| | | } |
| | | |
| | | public long count(LuckySponsorAdQuery query) { |
| | | return 0; |
| | | Query dbQuery = new Query(); |
| | | dbQuery.addCriteria(new Criteria().andOperator(getWheres(query))); |
| | | return count(dbQuery); |
| | | } |
| | | |
| | | |
| | | public List<LuckySponsorAd> list(List<String> ids) { |
| | | return null; |
| | | List<Criteria> andWhere = new ArrayList<>(); |
| | | for (String id : ids) { |
| | | andWhere.add(Criteria.where("id").is(id)); |
| | | } |
| | | Criteria[] wheres = new Criteria[andWhere.size()]; |
| | | andWhere.toArray(wheres); |
| | | Query dbQuery = new Query(); |
| | | dbQuery.addCriteria(new Criteria().orOperator(wheres)); |
| | | return findList(dbQuery); |
| | | } |
| | | } |
| | |
| | | import com.ks.lucky.query.ActivityAwardResultQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface LuckyActivityAwardResultMapper extends BaseMapper<LuckyActivityAwardResult> { |
| | |
| | | |
| | | LuckyActivityAwardResult selectByPrimaryKeyForUpdate(Long id); |
| | | |
| | | int setStateByActivityId(Long activityId,Integer state,String stateDesc); |
| | | int setStateByActivityId(@Param("activityId") Long activityId, @Param("state") Integer state, @Param("stateDesc") String stateDesc, @Param("updateTime") Date updateTime); |
| | | |
| | | |
| | | } |
| | |
| | | import com.ks.lib.common.dao.BaseMapper; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityJoinAssist; |
| | | import com.ks.lucky.query.ActivityJoinAssistQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface LuckyActivityJoinAssistMapper extends BaseMapper<LuckyActivityJoinAssist> { |
| | | |
| | | |
| | | List<LuckyActivityJoinAssist> list(ActivityJoinAssistQuery query); |
| | | List<LuckyActivityJoinAssist> list(@Param("query")ActivityJoinAssistQuery query); |
| | | |
| | | long count(ActivityJoinAssistQuery query); |
| | | long count(@Param("query")ActivityJoinAssistQuery query); |
| | | } |
| | |
| | | import com.ks.lib.common.dao.BaseMapper; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityJoinRecord; |
| | | import com.ks.lucky.query.ActivityJoinRecordQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface LuckyActivityJoinRecordMapper extends BaseMapper<LuckyActivityJoinRecord> { |
| | | |
| | | List<LuckyActivityJoinRecord> list(ActivityJoinRecordQuery query); |
| | | List<LuckyActivityJoinRecord> list(@Param("query")ActivityJoinRecordQuery query); |
| | | |
| | | long count(ActivityJoinRecordQuery query); |
| | | long count(@Param("query")ActivityJoinRecordQuery query); |
| | | |
| | | void addWeight(Long id, int weight); |
| | | void addWeight(@Param("id") Long id,@Param("weight") int weight); |
| | | |
| | | } |
| | |
| | | |
| | | LuckyActivity selectByPrimaryKeyForUpdate(Long id); |
| | | |
| | | int addJoinCount(Long activityId,int joinCount); |
| | | int addJoinCount(@Param("activityId") Long activityId,@Param("joinCount") int joinCount); |
| | | |
| | | } |
| | |
| | | import com.ks.lib.common.dao.BaseMapper; |
| | | import com.ks.lucky.pojo.DO.LuckyActivitySponsorInfo; |
| | | import com.ks.lucky.query.ActivitySponsorInfoQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface LuckyActivitySponsorInfoMapper extends BaseMapper<LuckyActivitySponsorInfo> { |
| | | |
| | | List<LuckyActivitySponsorInfo> list(ActivitySponsorInfoQuery query); |
| | | List<LuckyActivitySponsorInfo> list(@Param("query")ActivitySponsorInfoQuery query); |
| | | |
| | | long count(@Param("query")ActivitySponsorInfoQuery query); |
| | | |
| | | } |
| | |
| | | import com.ks.lib.common.dao.BaseMapper; |
| | | import com.ks.lucky.pojo.DO.LuckyMQ; |
| | | import com.ks.lucky.query.MQQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface LuckyMQMapper extends BaseMapper<LuckyMQ> { |
| | | |
| | | List<LuckyMQ> list(@Param("query")MQQuery query); |
| | | |
| | | long count(@Param("query")MQQuery query); |
| | | |
| | | LuckyMQ selectByTaskIdForUpdate(String taskId); |
| | | |
| | | LuckyMQ selectByTaskId(String taskId); |
| | | |
| | | List<LuckyMQ> list(MQQuery query); |
| | | |
| | | long count(MQQuery query); |
| | | } |
| | |
| | | import com.ks.lib.common.dao.BaseMapper; |
| | | import com.ks.lucky.pojo.DO.LuckySponsors; |
| | | import com.ks.lucky.query.LuckySponsorQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface LuckySponsorsMapper extends BaseMapper<LuckySponsors> { |
| | | |
| | | List<LuckySponsors> list(@Param("query") LuckySponsorQuery query); |
| | | |
| | | List<LuckySponsors> list(LuckySponsorQuery query); |
| | | long count(@Param("query") LuckySponsorQuery query); |
| | | |
| | | long count(LuckySponsorQuery query); |
| | | |
| | | |
| | | List<LuckySponsors> listDetail(List<Long> ids); |
| | | List<LuckySponsors> listDetail(@Param("ids") List<Long> ids); |
| | | } |
| | |
| | | public Long joinId; |
| | | public Long appId; |
| | | public String uid; |
| | | public String targetUid; |
| | | } |
| | |
| | | |
| | | public class ActivitySponsorInfoQuery extends BaseDaoQuery { |
| | | public Long activityId; |
| | | public Long appId; |
| | | public String uid; |
| | | public Long sponsorId; |
| | | } |
| | |
| | | package com.ks.lucky.query; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public class BaseDaoQuery { |
| | | |
| | |
| | | public int count; |
| | | public Date minCreateTime; |
| | | public Date maxCreateTime; |
| | | |
| | | /** |
| | | * 排序 |
| | | */ |
| | | public List<String> sortList; |
| | | |
| | | /** |
| | | * 查询的关键词 |
| | | */ |
| | |
| | | |
| | | import java.util.Date; |
| | | |
| | | public class MQQuery { |
| | | public class MQQuery extends BaseDaoQuery { |
| | | |
| | | //状态 |
| | | public Integer state; |
| | |
| | | public Date maxActualSendTime; |
| | | |
| | | public Date minActualSendTime; |
| | | |
| | | public long start; |
| | | |
| | | public int count; |
| | | |
| | | } |
| | |
| | | @Component |
| | | public class AppManager { |
| | | |
| | | @Reference(version = "1.0") |
| | | //,url = "dubbo://193.112.35.168:20882/com.ks.app.service.AppService" |
| | | @Reference(version = "1.0.0",url = "dubbo://193.112.35.168:20882/com.ks.app.service.AppService") |
| | | private AppService appService; |
| | | |
| | | public Long getAppId(String appKey) { |
| | |
| | | import java.io.InputStream; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | |
| | | |
| | | @Transactional |
| | | public void setResultShow(Long activityId) { |
| | | luckyActivityAwardResultMapper.setStateByActivityId(activityId, LuckyActivityAwardResult.STATE_NOT_RECIEVE, "等待领取"); |
| | | luckyActivityAwardResultMapper.setStateByActivityId(activityId, LuckyActivityAwardResult.STATE_NOT_RECIEVE, "等待领取", new Date()); |
| | | } |
| | | |
| | | } |
| | |
| | | query.joinId = record.getId(); |
| | | query.appId = appId; |
| | | query.uid = uid; |
| | | query.targetUid = targetUid; |
| | | query.start = 0; |
| | | query.count = 1; |
| | | List<LuckyActivityJoinAssist> list = luckyActivityJoinAssistMapper.list(query); |
New file |
| | |
| | | package com.ks.lucky.util; |
| | | |
| | | import org.springframework.data.domain.Sort; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | public class MongoDBQueryUtil { |
| | | |
| | | |
| | | /** |
| | | * 转换sql语句的排序 |
| | | * |
| | | * @param sortList |
| | | * @return |
| | | */ |
| | | public static Sort.Order[] convertSQLSort(List<String> sortList) { |
| | | List<Sort.Order> sList = new ArrayList<>(); |
| | | |
| | | for (String sort : sortList) { |
| | | String key = ""; |
| | | if (sort.trim().contains(" ")) { |
| | | key = sort.trim().split(" ")[0]; |
| | | } else { |
| | | key = sort.trim(); |
| | | } |
| | | |
| | | if (sort.toLowerCase().endsWith(" desc")) { |
| | | sList.add(Sort.Order.desc(key)); |
| | | } else { |
| | | sList.add(Sort.Order.asc(key)); |
| | | } |
| | | } |
| | | |
| | | Sort.Order[] sorts = new Sort.Order[sortList.size()]; |
| | | sList.toArray(sorts); |
| | | return sorts; |
| | | } |
| | | |
| | | } |
| | |
| | | server: |
| | | port: 8082 |
| | | port: 8080 |
| | | tomcat: |
| | | uri-encoding: UTF-8 |
| | | |
| | |
| | | database: 3 |
| | | |
| | | datasource: |
| | | url: jdbc:mysql://gz-cdb-r13d0yi9.sql.tencentcdb.com:62929/ks_goldcorn |
| | | url: jdbc:mysql://gz-cdb-r13d0yi9.sql.tencentcdb.com:62929/ks_lucky |
| | | username: root |
| | | password: Yeshi2016@ |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | |
| | | |
| | | dubbo: |
| | | application: |
| | | name: goldcorn-service |
| | | name: lucky-provider |
| | | registry: |
| | | protocol: zookeeper |
| | | address: zookeeper://134.175.68.214:2181 # 134.175.68.214 134.175.68.214:2181 |
| | |
| | | name: dubbo |
| | | port: 20882 |
| | | scan: |
| | | base-packages: com.ks.goldcorn.service.remote |
| | | base-packages: com.ks.lucky.service.impl.remote |
| | | provider: |
| | | timeout: 10000 |
| | | |
| | |
| | | </javaClientGenerator> |
| | | |
| | | <!--<table schema="" domainObjectName="LuckyActivity" tableName="lucky_activity" enableCountByExample="false" enableUpdateByExample="false"--> |
| | | <!--enableDeleteByExample="false" enableSelectByExample="false"--> |
| | | <!--selectByExampleQueryId="false"></table>--> |
| | | <!--enableDeleteByExample="false" enableSelectByExample="false"--> |
| | | <!--selectByExampleQueryId="false"></table>--> |
| | | |
| | | <!--<table schema="" domainObjectName="LuckyActivityOpenInfo" tableName="lucky_activity_open_info" enableCountByExample="false" enableUpdateByExample="false"--> |
| | | <!--enableDeleteByExample="false" enableSelectByExample="false"--> |
| | | <!--selectByExampleQueryId="false"></table>--> |
| | | <!--enableDeleteByExample="false" enableSelectByExample="false"--> |
| | | <!--selectByExampleQueryId="false"></table>--> |
| | | |
| | | <!--<table schema="" domainObjectName="LuckyActivityAwardResult" tableName="lucky_activity_award_result" enableCountByExample="false" enableUpdateByExample="false"--> |
| | | <!--enableDeleteByExample="false" enableSelectByExample="false"--> |
| | | <!--selectByExampleQueryId="false"></table>--> |
| | | <!--enableDeleteByExample="false" enableSelectByExample="false"--> |
| | | <!--selectByExampleQueryId="false"></table>--> |
| | | |
| | | <!--<table schema="" domainObjectName="LuckyActivityAwardResultExtra" tableName="lucky_activity_award_result_extra" enableCountByExample="false" enableUpdateByExample="false"--> |
| | | <!--enableDeleteByExample="false" enableSelectByExample="false"--> |
| | | <!--selectByExampleQueryId="false"></table>--> |
| | | <!--enableDeleteByExample="false" enableSelectByExample="false"--> |
| | | <!--selectByExampleQueryId="false"></table>--> |
| | | |
| | | |
| | | <!--<table schema="" domainObjectName="LuckyActivityAwards" tableName="lucky_activity_awards" enableCountByExample="false" enableUpdateByExample="false"--> |
| | | <!--enableDeleteByExample="false" enableSelectByExample="false"--> |
| | | <!--selectByExampleQueryId="false"></table>--> |
| | | <!--enableDeleteByExample="false" enableSelectByExample="false"--> |
| | | <!--selectByExampleQueryId="false"></table>--> |
| | | |
| | | <!--<table schema="" domainObjectName="LuckyActivityJoinAssist" tableName="lucky_activity_join_assist" enableCountByExample="false" enableUpdateByExample="false"--> |
| | | <!--enableDeleteByExample="false" enableSelectByExample="false"--> |
| | | <!--selectByExampleQueryId="false"></table>--> |
| | | <!--enableDeleteByExample="false" enableSelectByExample="false"--> |
| | | <!--selectByExampleQueryId="false"></table>--> |
| | | |
| | | |
| | | <!--<table schema="" domainObjectName="LuckyActivityJoinRecord" tableName="lucky_activity_join_record" enableCountByExample="false" enableUpdateByExample="false"--> |
| | | <!--enableDeleteByExample="false" enableSelectByExample="false"--> |
| | | <!--selectByExampleQueryId="false"></table>--> |
| | | <!--enableDeleteByExample="false" enableSelectByExample="false"--> |
| | | <!--selectByExampleQueryId="false"></table>--> |
| | | |
| | | |
| | | <!--<table schema="" domainObjectName="LuckyActivitySponsorInfo" tableName="lucky_activity_sponsor_info" enableCountByExample="false" enableUpdateByExample="false"--> |
| | | <!--enableDeleteByExample="false" enableSelectByExample="false"--> |
| | | <!--selectByExampleQueryId="false"></table>--> |
| | | <!--enableDeleteByExample="false" enableSelectByExample="false"--> |
| | | <!--selectByExampleQueryId="false"></table>--> |
| | | |
| | | <table schema="" domainObjectName="LuckyMQ" tableName="lucky_mq" enableCountByExample="false" enableUpdateByExample="false" |
| | | enableDeleteByExample="false" enableSelectByExample="false" |
| | | selectByExampleQueryId="false"></table> |
| | | <!--<table schema="" domainObjectName="LuckyMQ" tableName="lucky_mq" enableCountByExample="false" enableUpdateByExample="false"--> |
| | | <!--enableDeleteByExample="false" enableSelectByExample="false"--> |
| | | <!--selectByExampleQueryId="false"></table>--> |
| | | |
| | | <table schema="" domainObjectName="" tableName=""></table> |
| | | |
| | | |
| | | </context> |
| | |
| | | <result column="name" jdbcType="VARCHAR" property="name"/> |
| | | <result column="phone" jdbcType="VARCHAR" property="phone"/> |
| | | <result column="address" jdbcType="VARCHAR" property="address"/> |
| | | <result column="red_package" jdbcType="DICIMAL" property="redPackage"/> |
| | | <result column="red_package" jdbcType="DECIMAL" property="redPackage"/> |
| | | <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> |
| | | <result column="alipay_uid" property="alipyUid" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | |
| | | <include refid="Base_Column_List"/> |
| | | from lucky_activity_award_result_extra where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <select id="selectByAwardResultId" parameterType="java.lang.Long" resultMap="BaseResultMap">select |
| | | <include refid="Base_Column_List"/> |
| | | from lucky_activity_award_result_extra where award_result_id = #{0} |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" |
| | | parameterType="java.lang.Long">delete from lucky_activity_award_result_extra where id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" |
| | | <insert id="insert" useGeneratedKeys="true" keyProperty="id" |
| | | parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwardResultExtra">insert into lucky_activity_award_result_extra (id, award_result_id, name, phone, address, create_time,red_package,alipay_uid) values (#{id,jdbcType=BIGINT}, #{awardResultId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},#{redPackage,jdbcType=DECIMAL} ,#{alipyUid,jdbcType=VARCHAR})</insert> |
| | | <insert id="insertSelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwardResultExtra">insert into |
| | | <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" |
| | | parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwardResultExtra">insert into |
| | | lucky_activity_award_result_extra |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | <?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.ks.lucky.mapper.LuckyActivityAwardResultMapper"> |
| | | <resultMap id="BaseResultMap" type="com.ks.lucky.pojo.DO.LuckyActivityAwardResult"> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="activity_id" jdbcType="BIGINT" property="activityId" /> |
| | | <result column="app_id" jdbcType="BIGINT" property="appId" /> |
| | | <result column="uid" jdbcType="VARCHAR" property="uid" /> |
| | | <result column="award_id" jdbcType="BIGINT" property="awardId" /> |
| | | <result column="state" jdbcType="INTEGER" property="state" /> |
| | | <result column="state_desc" jdbcType="VARCHAR" property="stateDesc" /> |
| | | <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
| | | <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <resultMap id="BaseResultMap" type="com.ks.lucky.pojo.DO.LuckyActivityAwardResult"> |
| | | <id column="id" jdbcType="BIGINT" property="id"/> |
| | | <result column="activity_id" jdbcType="BIGINT" property="activityId"/> |
| | | <result column="app_id" jdbcType="BIGINT" property="appId"/> |
| | | <result column="uid" jdbcType="VARCHAR" property="uid"/> |
| | | <result column="award_id" jdbcType="BIGINT" property="awardId"/> |
| | | <result column="state" jdbcType="INTEGER" property="state"/> |
| | | <result column="state_desc" jdbcType="VARCHAR" property="stateDesc"/> |
| | | <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> |
| | | <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | id, activity_id, app_id, uid, award_id, state, state_desc, create_time, update_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from lucky_activity_award_result |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from lucky_activity_award_result |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <!-- 非模板--> |
| | | |
| | | |
| | | <sql id="listWhere"> |
| | | <if test="query.appId!=null"> |
| | | and app_id=#{query.appId} |
| | | </if> |
| | | <if test="query.uid!=null"> |
| | | and uid=#{query.uid} |
| | | </if> |
| | | <if test="query.activityId!=null"> |
| | | and activity_id=#{query.activityId} |
| | | </if> |
| | | <if test="query.awardId!=null"> |
| | | and award_id=#{query.awardId} |
| | | </if> |
| | | |
| | | <if test="query.minCreateTime!=null"> |
| | | and create_time>=#{query.minCreateTime} |
| | | </if> |
| | | |
| | | <if test="query.maxCreateTime!=null"> |
| | | and #{query.maxCreateTime}>create_time |
| | | </if> |
| | | |
| | | </sql> |
| | | |
| | | <select id="selectByPrimaryKeyForUpdate" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from lucky_activity_award_result |
| | | where id = #{0} for update |
| | | </select> |
| | | |
| | | <select id="list" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from lucky_activity_award_result |
| | | where 1=1 |
| | | <include refid="listWhere"></include> |
| | | |
| | | <if test="query.sortList!=null"> |
| | | <foreach collection="query.sortList" item="item" separator="," open=" order by "> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | limit #{query.start},#{query.count} |
| | | </select> |
| | | |
| | | <select id="count" resultType="java.lang.Long"> |
| | | select |
| | | count(*) |
| | | from lucky_activity_award_result |
| | | where 1=1 |
| | | <include refid="listWhere"></include> |
| | | </select> |
| | | |
| | | |
| | | <update id="setStateByActivityId"> |
| | | update lucky_activity_award_result |
| | | <set> |
| | | |
| | | <if test="state != null"> |
| | | state = #{state}, |
| | | </if> |
| | | <if test="stateDesc != null"> |
| | | state_desc = #{stateDesc,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </set> |
| | | where activity_id = #{activityId,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from lucky_activity_award_result |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwardResult"> |
| | | <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwardResult"> |
| | | insert into lucky_activity_award_result (id, activity_id, app_id, |
| | | uid, award_id, state, |
| | | state_desc, create_time, update_time |
| | |
| | | #{stateDesc,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwardResult"> |
| | | insert into lucky_activity_award_result |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="activityId != null"> |
| | | activity_id, |
| | | </if> |
| | | <if test="appId != null"> |
| | | app_id, |
| | | </if> |
| | | <if test="uid != null"> |
| | | uid, |
| | | </if> |
| | | <if test="awardId != null"> |
| | | award_id, |
| | | </if> |
| | | <if test="state != null"> |
| | | state, |
| | | </if> |
| | | <if test="stateDesc != null"> |
| | | state_desc, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | update_time, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="activityId != null"> |
| | | #{activityId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="appId != null"> |
| | | #{appId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="uid != null"> |
| | | #{uid,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="awardId != null"> |
| | | #{awardId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="state != null"> |
| | | #{state,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="stateDesc != null"> |
| | | #{stateDesc,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | #{updateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwardResult"> |
| | | update lucky_activity_award_result |
| | | <set> |
| | | <if test="activityId != null"> |
| | | activity_id = #{activityId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="appId != null"> |
| | | app_id = #{appId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="uid != null"> |
| | | uid = #{uid,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="awardId != null"> |
| | | award_id = #{awardId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="state != null"> |
| | | state = #{state,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="stateDesc != null"> |
| | | state_desc = #{stateDesc,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwardResult"> |
| | | <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwardResult"> |
| | | insert into lucky_activity_award_result |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="activityId != null"> |
| | | activity_id, |
| | | </if> |
| | | <if test="appId != null"> |
| | | app_id, |
| | | </if> |
| | | <if test="uid != null"> |
| | | uid, |
| | | </if> |
| | | <if test="awardId != null"> |
| | | award_id, |
| | | </if> |
| | | <if test="state != null"> |
| | | state, |
| | | </if> |
| | | <if test="stateDesc != null"> |
| | | state_desc, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | update_time, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="activityId != null"> |
| | | #{activityId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="appId != null"> |
| | | #{appId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="uid != null"> |
| | | #{uid,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="awardId != null"> |
| | | #{awardId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="state != null"> |
| | | #{state,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="stateDesc != null"> |
| | | #{stateDesc,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | #{updateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwardResult"> |
| | | update lucky_activity_award_result |
| | | <set> |
| | | <if test="activityId != null"> |
| | | activity_id = #{activityId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="appId != null"> |
| | | app_id = #{appId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="uid != null"> |
| | | uid = #{uid,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="awardId != null"> |
| | | award_id = #{awardId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="state != null"> |
| | | state = #{state,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="stateDesc != null"> |
| | | state_desc = #{stateDesc,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwardResult"> |
| | | update lucky_activity_award_result |
| | | set activity_id = #{activityId,jdbcType=BIGINT}, |
| | | app_id = #{appId,jdbcType=BIGINT}, |
| | |
| | | <?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.ks.lucky.mapper.LuckyActivityAwardsMapper"> |
| | | <resultMap id="BaseResultMap" type="com.ks.lucky.pojo.DO.LuckyActivityAwards"> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="activity_id" jdbcType="BIGINT" property="activityId" /> |
| | | <result column="level" jdbcType="INTEGER" property="level" /> |
| | | <result column="count" jdbcType="INTEGER" property="count" /> |
| | | <result column="award_way" jdbcType="INTEGER" property="awardWay" /> |
| | | <result column="award_params" jdbcType="VARCHAR" property="awardParams" /> |
| | | <result column="material_id" jdbcType="VARCHAR" property="materialId" /> |
| | | <result column="remarks" jdbcType="VARCHAR" property="remarks" /> |
| | | <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
| | | <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <resultMap id="BaseResultMap" type="com.ks.lucky.pojo.DO.LuckyActivityAwards"> |
| | | <id column="id" jdbcType="BIGINT" property="id"/> |
| | | <result column="activity_id" jdbcType="BIGINT" property="activityId"/> |
| | | <result column="level" jdbcType="INTEGER" property="level"/> |
| | | <result column="count" jdbcType="INTEGER" property="count"/> |
| | | <result column="award_way" jdbcType="INTEGER" property="awardWay"/> |
| | | <result column="award_params" jdbcType="VARCHAR" property="awardParams"/> |
| | | <result column="material_id" jdbcType="VARCHAR" property="materialId"/> |
| | | <result column="remarks" jdbcType="VARCHAR" property="remarks"/> |
| | | <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> |
| | | <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | id, activity_id, level, count, award_way, award_params, material_id, remarks, create_time, |
| | | update_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from lucky_activity_awards |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from lucky_activity_awards |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <!-- 非模板--> |
| | | |
| | | |
| | | <sql id="listWhere"> |
| | | <if test="query.activityId!=null"> |
| | | and activity_id=#{query.activityId} |
| | | </if> |
| | | |
| | | <if test="query.minCreateTime!=null"> |
| | | and create_time>=#{query.minCreateTime} |
| | | </if> |
| | | |
| | | <if test="query.maxCreateTime!=null"> |
| | | and #{query.maxCreateTime}>create_time |
| | | </if> |
| | | |
| | | </sql> |
| | | |
| | | |
| | | <select id="list" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from lucky_activity_awards |
| | | where 1=1 |
| | | <include refid="listWhere"> |
| | | |
| | | </include> |
| | | |
| | | |
| | | <if test="query.sortList!=null"> |
| | | <foreach collection="query.sortList" item="item" separator="," open=" order by "> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | limit #{query.start},#{query.count} |
| | | </select> |
| | | |
| | | <select id="count" resultType="java.lang.Long"> |
| | | select |
| | | count(*) |
| | | from lucky_activity_awards |
| | | where 1=1 |
| | | <include refid="listWhere"> |
| | | |
| | | </include> |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from lucky_activity_awards |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwards"> |
| | | <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwards"> |
| | | insert into lucky_activity_awards (id, activity_id, level, |
| | | count, award_way, award_params, |
| | | material_id, remarks, create_time, |
| | |
| | | #{materialId,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, |
| | | #{updateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwards"> |
| | | insert into lucky_activity_awards |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="activityId != null"> |
| | | activity_id, |
| | | </if> |
| | | <if test="level != null"> |
| | | level, |
| | | </if> |
| | | <if test="count != null"> |
| | | count, |
| | | </if> |
| | | <if test="awardWay != null"> |
| | | award_way, |
| | | </if> |
| | | <if test="awardParams != null"> |
| | | award_params, |
| | | </if> |
| | | <if test="materialId != null"> |
| | | material_id, |
| | | </if> |
| | | <if test="remarks != null"> |
| | | remarks, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | update_time, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="activityId != null"> |
| | | #{activityId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="level != null"> |
| | | #{level,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="count != null"> |
| | | #{count,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="awardWay != null"> |
| | | #{awardWay,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="awardParams != null"> |
| | | #{awardParams,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="materialId != null"> |
| | | #{materialId,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="remarks != null"> |
| | | #{remarks,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | #{updateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwards"> |
| | | update lucky_activity_awards |
| | | <set> |
| | | <if test="activityId != null"> |
| | | activity_id = #{activityId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="level != null"> |
| | | level = #{level,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="count != null"> |
| | | count = #{count,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="awardWay != null"> |
| | | award_way = #{awardWay,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="awardParams != null"> |
| | | award_params = #{awardParams,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="materialId != null"> |
| | | material_id = #{materialId,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="remarks != null"> |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwards"> |
| | | <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwards"> |
| | | insert into lucky_activity_awards |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="activityId != null"> |
| | | activity_id, |
| | | </if> |
| | | <if test="level != null"> |
| | | level, |
| | | </if> |
| | | <if test="count != null"> |
| | | count, |
| | | </if> |
| | | <if test="awardWay != null"> |
| | | award_way, |
| | | </if> |
| | | <if test="awardParams != null"> |
| | | award_params, |
| | | </if> |
| | | <if test="materialId != null"> |
| | | material_id, |
| | | </if> |
| | | <if test="remarks != null"> |
| | | remarks, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | update_time, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="activityId != null"> |
| | | #{activityId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="level != null"> |
| | | #{level,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="count != null"> |
| | | #{count,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="awardWay != null"> |
| | | #{awardWay,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="awardParams != null"> |
| | | #{awardParams,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="materialId != null"> |
| | | #{materialId,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="remarks != null"> |
| | | #{remarks,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | #{updateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwards"> |
| | | update lucky_activity_awards |
| | | <set> |
| | | <if test="activityId != null"> |
| | | activity_id = #{activityId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="level != null"> |
| | | level = #{level,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="count != null"> |
| | | count = #{count,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="awardWay != null"> |
| | | award_way = #{awardWay,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="awardParams != null"> |
| | | award_params = #{awardParams,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="materialId != null"> |
| | | material_id = #{materialId,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="remarks != null"> |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwards"> |
| | | update lucky_activity_awards |
| | | set activity_id = #{activityId,jdbcType=BIGINT}, |
| | | level = #{level,jdbcType=INTEGER}, |
| | |
| | | <?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.ks.lucky.mapper.LuckyActivityJoinAssistMapper"> |
| | | <resultMap id="BaseResultMap" type="com.ks.lucky.pojo.DO.LuckyActivityJoinAssist"> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="join_id" jdbcType="BIGINT" property="joinId" /> |
| | | <result column="app_id" jdbcType="BIGINT" property="appId" /> |
| | | <result column="uid" jdbcType="VARCHAR" property="uid" /> |
| | | <result column="weight" jdbcType="INTEGER" property="weight" /> |
| | | <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
| | | <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <resultMap id="BaseResultMap" type="com.ks.lucky.pojo.DO.LuckyActivityJoinAssist"> |
| | | <id column="id" jdbcType="BIGINT" property="id"/> |
| | | <result column="join_id" jdbcType="BIGINT" property="joinId"/> |
| | | <result column="app_id" jdbcType="BIGINT" property="appId"/> |
| | | <result column="uid" jdbcType="VARCHAR" property="uid"/> |
| | | <result column="weight" jdbcType="INTEGER" property="weight"/> |
| | | <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> |
| | | <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | id, join_id, app_id, uid, weight, create_time, update_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from lucky_activity_join_assist |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from lucky_activity_join_assist |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <!-- 非模板 --> |
| | | <sql id="listWhere"> |
| | | <if test="query.joinId!=null"> |
| | | and join_id=#{query.joinId} |
| | | </if> |
| | | <if test="query.appId!=null"> |
| | | and app_id=#{query.appId} |
| | | </if> |
| | | <if test="query.uid!=null"> |
| | | and uid=#{query.uid} |
| | | </if> |
| | | |
| | | <if test="query.minCreateTime!=null"> |
| | | and create_time>=#{query.minCreateTime} |
| | | </if> |
| | | |
| | | <if test="query.maxCreateTime!=null"> |
| | | and #{query.maxCreateTime}>create_time |
| | | </if> |
| | | |
| | | </sql> |
| | | |
| | | |
| | | <select id="list" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from lucky_activity_join_assist |
| | | where 1=1 |
| | | <include refid="listWhere"> |
| | | |
| | | </include> |
| | | |
| | | |
| | | <if test="query.sortList!=null"> |
| | | <foreach collection="query.sortList" item="item" separator="," open=" order by "> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | limit #{query.start},#{query.count} |
| | | </select> |
| | | |
| | | <select id="count" resultType="java.lang.Long"> |
| | | select |
| | | count(*) |
| | | from lucky_activity_join_assist |
| | | where 1=1 |
| | | <include refid="listWhere"> |
| | | |
| | | </include> |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from lucky_activity_join_assist |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.ks.lucky.pojo.DO.LuckyActivityJoinAssist"> |
| | | <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.ks.lucky.pojo.DO.LuckyActivityJoinAssist"> |
| | | insert into lucky_activity_join_assist (id, join_id, app_id, |
| | | uid, weight, create_time, |
| | | update_time) |
| | |
| | | #{uid,jdbcType=VARCHAR}, #{weight,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, |
| | | #{updateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivityJoinAssist"> |
| | | insert into lucky_activity_join_assist |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="joinId != null"> |
| | | join_id, |
| | | </if> |
| | | <if test="appId != null"> |
| | | app_id, |
| | | </if> |
| | | <if test="uid != null"> |
| | | uid, |
| | | </if> |
| | | <if test="weight != null"> |
| | | weight, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | update_time, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="joinId != null"> |
| | | #{joinId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="appId != null"> |
| | | #{appId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="uid != null"> |
| | | #{uid,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="weight != null"> |
| | | #{weight,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | #{updateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivityJoinAssist"> |
| | | update lucky_activity_join_assist |
| | | <set> |
| | | <if test="joinId != null"> |
| | | join_id = #{joinId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="appId != null"> |
| | | app_id = #{appId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="uid != null"> |
| | | uid = #{uid,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="weight != null"> |
| | | weight = #{weight,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.ks.lucky.pojo.DO.LuckyActivityJoinAssist"> |
| | | <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" parameterType="com.ks.lucky.pojo.DO.LuckyActivityJoinAssist"> |
| | | insert into lucky_activity_join_assist |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="joinId != null"> |
| | | join_id, |
| | | </if> |
| | | <if test="appId != null"> |
| | | app_id, |
| | | </if> |
| | | <if test="uid != null"> |
| | | uid, |
| | | </if> |
| | | <if test="weight != null"> |
| | | weight, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | update_time, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="joinId != null"> |
| | | #{joinId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="appId != null"> |
| | | #{appId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="uid != null"> |
| | | #{uid,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="weight != null"> |
| | | #{weight,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | #{updateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivityJoinAssist"> |
| | | update lucky_activity_join_assist |
| | | <set> |
| | | <if test="joinId != null"> |
| | | join_id = #{joinId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="appId != null"> |
| | | app_id = #{appId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="uid != null"> |
| | | uid = #{uid,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="weight != null"> |
| | | weight = #{weight,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.ks.lucky.pojo.DO.LuckyActivityJoinAssist"> |
| | | update lucky_activity_join_assist |
| | | set join_id = #{joinId,jdbcType=BIGINT}, |
| | | app_id = #{appId,jdbcType=BIGINT}, |
| | |
| | | <?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.ks.lucky.mapper.LuckyActivityJoinRecordMapper"> |
| | | <resultMap id="BaseResultMap" type="com.ks.lucky.pojo.DO.LuckyActivityJoinRecord"> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="activity_id" jdbcType="BIGINT" property="activityId" /> |
| | | <result column="app_id" jdbcType="BIGINT" property="appId" /> |
| | | <result column="uid" jdbcType="VARCHAR" property="uid" /> |
| | | <result column="join_info" jdbcType="VARCHAR" property="joinInfo" /> |
| | | <result column="user_type" jdbcType="INTEGER" property="userType" /> |
| | | <result column="weight" jdbcType="INTEGER" property="weight" /> |
| | | <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <resultMap id="BaseResultMap" type="com.ks.lucky.pojo.DO.LuckyActivityJoinRecord"> |
| | | <id column="id" jdbcType="BIGINT" property="id"/> |
| | | <result column="activity_id" jdbcType="BIGINT" property="activityId"/> |
| | | <result column="app_id" jdbcType="BIGINT" property="appId"/> |
| | | <result column="uid" jdbcType="VARCHAR" property="uid"/> |
| | | <result column="join_info" jdbcType="VARCHAR" property="joinInfo"/> |
| | | <result column="user_type" jdbcType="INTEGER" property="userType"/> |
| | | <result column="weight" jdbcType="INTEGER" property="weight"/> |
| | | <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | id, activity_id, app_id, uid, join_info, user_type, weight, create_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from lucky_activity_join_record |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from lucky_activity_join_record |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <!-- 非模板 --> |
| | | |
| | | <sql id="listWhere"> |
| | | <if test="query.activityId!=null"> |
| | | and activity_id=#{query.activityId} |
| | | </if> |
| | | <if test="query.appId!=null"> |
| | | and app_id=#{query.appId} |
| | | </if> |
| | | <if test="query.uid!=null"> |
| | | and uid=#{query.uid} |
| | | </if> |
| | | |
| | | <if test="query.minCreateTime!=null"> |
| | | and create_time>=#{query.minCreateTime} |
| | | </if> |
| | | |
| | | <if test="query.maxCreateTime!=null"> |
| | | and #{query.maxCreateTime}>create_time |
| | | </if> |
| | | |
| | | </sql> |
| | | |
| | | |
| | | <select id="list" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from lucky_activity_join_record |
| | | where 1=1 |
| | | <include refid="listWhere"> |
| | | |
| | | </include> |
| | | |
| | | |
| | | <if test="query.sortList!=null"> |
| | | <foreach collection="query.sortList" item="item" separator="," open=" order by "> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | limit #{query.start},#{query.count} |
| | | </select> |
| | | |
| | | <select id="count" resultType="java.lang.Long"> |
| | | select |
| | | count(*) |
| | | from lucky_activity_join_record |
| | | where 1=1 |
| | | <include refid="listWhere"> |
| | | |
| | | </include> |
| | | </select> |
| | | |
| | | <update id="addWeight"> |
| | | |
| | | update lucky_activity_join_record set weight=weight+#{weight} where id=#{id} |
| | | |
| | | </update> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from lucky_activity_join_record |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.ks.lucky.pojo.DO.LuckyActivityJoinRecord"> |
| | | <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.ks.lucky.pojo.DO.LuckyActivityJoinRecord"> |
| | | insert into lucky_activity_join_record (id, activity_id, app_id, |
| | | uid, join_info, user_type, |
| | | weight, create_time) |
| | |
| | | #{uid,jdbcType=VARCHAR}, #{joinInfo,jdbcType=VARCHAR}, #{userType,jdbcType=INTEGER}, |
| | | #{weight,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivityJoinRecord"> |
| | | insert into lucky_activity_join_record |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="activityId != null"> |
| | | activity_id, |
| | | </if> |
| | | <if test="appId != null"> |
| | | app_id, |
| | | </if> |
| | | <if test="uid != null"> |
| | | uid, |
| | | </if> |
| | | <if test="joinInfo != null"> |
| | | join_info, |
| | | </if> |
| | | <if test="userType != null"> |
| | | user_type, |
| | | </if> |
| | | <if test="weight != null"> |
| | | weight, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="activityId != null"> |
| | | #{activityId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="appId != null"> |
| | | #{appId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="uid != null"> |
| | | #{uid,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="joinInfo != null"> |
| | | #{joinInfo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="userType != null"> |
| | | #{userType,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="weight != null"> |
| | | #{weight,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivityJoinRecord"> |
| | | update lucky_activity_join_record |
| | | <set> |
| | | <if test="activityId != null"> |
| | | activity_id = #{activityId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="appId != null"> |
| | | app_id = #{appId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="uid != null"> |
| | | uid = #{uid,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="joinInfo != null"> |
| | | join_info = #{joinInfo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="userType != null"> |
| | | user_type = #{userType,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="weight != null"> |
| | | weight = #{weight,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.ks.lucky.pojo.DO.LuckyActivityJoinRecord"> |
| | | <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" parameterType="com.ks.lucky.pojo.DO.LuckyActivityJoinRecord"> |
| | | insert into lucky_activity_join_record |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="activityId != null"> |
| | | activity_id, |
| | | </if> |
| | | <if test="appId != null"> |
| | | app_id, |
| | | </if> |
| | | <if test="uid != null"> |
| | | uid, |
| | | </if> |
| | | <if test="joinInfo != null"> |
| | | join_info, |
| | | </if> |
| | | <if test="userType != null"> |
| | | user_type, |
| | | </if> |
| | | <if test="weight != null"> |
| | | weight, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="activityId != null"> |
| | | #{activityId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="appId != null"> |
| | | #{appId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="uid != null"> |
| | | #{uid,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="joinInfo != null"> |
| | | #{joinInfo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="userType != null"> |
| | | #{userType,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="weight != null"> |
| | | #{weight,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivityJoinRecord"> |
| | | update lucky_activity_join_record |
| | | <set> |
| | | <if test="activityId != null"> |
| | | activity_id = #{activityId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="appId != null"> |
| | | app_id = #{appId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="uid != null"> |
| | | uid = #{uid,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="joinInfo != null"> |
| | | join_info = #{joinInfo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="userType != null"> |
| | | user_type = #{userType,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="weight != null"> |
| | | weight = #{weight,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.ks.lucky.pojo.DO.LuckyActivityJoinRecord"> |
| | | update lucky_activity_join_record |
| | | set activity_id = #{activityId,jdbcType=BIGINT}, |
| | | app_id = #{appId,jdbcType=BIGINT}, |
| | |
| | | <result column="material_poster" jdbcType="VARCHAR" property="materialPoster"/> |
| | | <result column="material_tag_image" jdbcType="VARCHAR" property="materialTagImage"/> |
| | | <result column="material_" jdbcType="VARCHAR" property="material"/> |
| | | <result column="desc" jdbcType="VARCHAR" property="desc"/> |
| | | <result column="`desc`" jdbcType="VARCHAR" property="desc"/> |
| | | <result column="max_person_count" jdbcType="INTEGER" property="maxPersonCount"/> |
| | | <result column="current_person_count" jdbcType="INTEGER" property="currentPersonCount"/> |
| | | <result column="state" jdbcType="INTEGER" property="state"/> |
| | |
| | | <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | id, app_id, sponsor_id, name, material_poster, material_tag_image, material_, desc, |
| | | id, app_id, sponsor_id, `name`, material_poster, material_tag_image, material_, `desc`, |
| | | max_person_count,current_person_count, state, state_remarks, start_time, finish_time, pre_open_time,actual_open_time, create_time, |
| | | update_time |
| | | </sql> |
| | |
| | | from lucky_activity |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <select id="selectByPrimaryKeyForUpdate" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from lucky_activity |
| | | where id = #{0} for update |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from lucky_activity |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.ks.lucky.pojo.DO.LuckyActivity"> |
| | | <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.ks.lucky.pojo.DO.LuckyActivity"> |
| | | insert into lucky_activity (id, app_id, sponsor_id, |
| | | name, material_poster, material_tag_image, |
| | | material_, desc, max_person_count, current_person_count, |
| | | `name`, material_poster, material_tag_image, |
| | | material_, `desc`, max_person_count, current_person_count, |
| | | state, state_remarks, start_time, |
| | | finish_time, pre_open_time, actual_open_time,create_time, |
| | | update_time) |
| | |
| | | #{finishTime,jdbcType=TIMESTAMP}, #{preOpenTime,jdbcType=TIMESTAMP}, #{actualOpenTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, |
| | | #{updateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivity"> |
| | | <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" parameterType="com.ks.lucky.pojo.DO.LuckyActivity"> |
| | | insert into lucky_activity |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | |
| | | sponsor_id, |
| | | </if> |
| | | <if test="name != null"> |
| | | name, |
| | | `name`, |
| | | </if> |
| | | <if test="materialPoster != null"> |
| | | material_poster, |
| | |
| | | material_, |
| | | </if> |
| | | <if test="desc != null"> |
| | | desc, |
| | | `desc`, |
| | | </if> |
| | | <if test="maxPersonCount != null"> |
| | | max_person_count, |
| | |
| | | sponsor_id = #{sponsorId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="name != null"> |
| | | name = #{name,jdbcType=VARCHAR}, |
| | | `name` = #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="materialPoster != null"> |
| | | material_poster = #{materialPoster,jdbcType=VARCHAR}, |
| | |
| | | material_ = #{material,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="desc != null"> |
| | | desc = #{desc,jdbcType=VARCHAR}, |
| | | `desc` = #{desc,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="maxPersonCount != null"> |
| | | max_person_count = #{maxPersonCount,jdbcType=INTEGER}, |
| | |
| | | update lucky_activity |
| | | set app_id = #{appId,jdbcType=BIGINT}, |
| | | sponsor_id = #{sponsorId,jdbcType=BIGINT}, |
| | | name = #{name,jdbcType=VARCHAR}, |
| | | `name` = #{name,jdbcType=VARCHAR}, |
| | | material_poster = #{materialPoster,jdbcType=VARCHAR}, |
| | | material_tag_image = #{materialTagImage,jdbcType=VARCHAR}, |
| | | material_ = #{material,jdbcType=VARCHAR}, |
| | | desc = #{desc,jdbcType=VARCHAR}, |
| | | `desc` = #{desc,jdbcType=VARCHAR}, |
| | | max_person_count = #{maxPersonCount,jdbcType=INTEGER}, |
| | | current_person_count = #{currentPersonCount,jdbcType=INTEGER}, |
| | | state = #{state,jdbcType=INTEGER}, |
| | |
| | | <sql id="queryWhere"> |
| | | |
| | | <if test="query.key!=null"> |
| | | and name like '${query.key}%' |
| | | and `name` like '${query.key}%' |
| | | </if> |
| | | |
| | | <if test="query.appId!=null"> |
| | |
| | | |
| | | </select> |
| | | |
| | | |
| | | <update id="addJoinCount"> |
| | | |
| | | update lucky_activity set current_person_count=current_person_count+#{joinCount} where id=#{activityId} |
| | | |
| | | </update> |
| | | |
| | | </mapper> |
| | |
| | | from lucky_activity_open_info |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectByActivityId" resultMap="BaseResultMap" parameterType="java.lang.Long" > |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from lucky_activity_open_info |
| | | where activity_id = #{0} |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" > |
| | | delete from lucky_activity_open_info |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.ks.lucky.pojo.DO.LuckyActivityOpenInfo" > |
| | | <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.ks.lucky.pojo.DO.LuckyActivityOpenInfo" > |
| | | insert into lucky_activity_open_info (id, activity_id, open_type, |
| | | min_person_count, pre_open_time, actual_open_time, |
| | | create_time, update_time) |
| | |
| | | #{minPersonCount,jdbcType=INTEGER}, #{preOpenTime,jdbcType=DATE}, #{actualOpenTime,jdbcType=DATE}, |
| | | #{createTime,jdbcType=DATE}, #{updateTime,jdbcType=DATE}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivityOpenInfo" > |
| | | <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" parameterType="com.ks.lucky.pojo.DO.LuckyActivityOpenInfo" > |
| | | insert into lucky_activity_open_info |
| | | <trim prefix="(" suffix=")" suffixOverrides="," > |
| | | <if test="id != null" > |
| | |
| | | <?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.ks.lucky.mapper.LuckyActivitySponsorInfoMapper"> |
| | | <resultMap id="BaseResultMap" type="com.ks.lucky.pojo.DO.LuckyActivitySponsorInfo"> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="activity_id" jdbcType="BIGINT" property="activityId" /> |
| | | <result column="sponsor_id" jdbcType="BIGINT" property="sponsorId" /> |
| | | <result column="sponsor_ad_id" jdbcType="VARCHAR" property="sponsorAdId" /> |
| | | <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
| | | <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <resultMap id="BaseResultMap" type="com.ks.lucky.pojo.DO.LuckyActivitySponsorInfo"> |
| | | <id column="id" jdbcType="BIGINT" property="id"/> |
| | | <result column="activity_id" jdbcType="BIGINT" property="activityId"/> |
| | | <result column="sponsor_id" jdbcType="BIGINT" property="sponsorId"/> |
| | | <result column="sponsor_ad_id" jdbcType="VARCHAR" property="sponsorAdId"/> |
| | | <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> |
| | | <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | id, activity_id, sponsor_id, sponsor_ad_id, create_time, update_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from lucky_activity_sponsor_info |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from lucky_activity_sponsor_info |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <!-- 非模板 --> |
| | | <sql id="listWhere"> |
| | | <if test="query.sponsorId!=null"> |
| | | and sponsor_id=#{query.sponsorId} |
| | | </if> |
| | | <if test="query.activityId!=null"> |
| | | and activity_id=#{query.activityId} |
| | | </if> |
| | | |
| | | <if test="query.minCreateTime!=null"> |
| | | and create_time>=#{query.minCreateTime} |
| | | </if> |
| | | |
| | | <if test="query.maxCreateTime!=null"> |
| | | and #{query.maxCreateTime}>create_time |
| | | </if> |
| | | |
| | | </sql> |
| | | |
| | | |
| | | <select id="list" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from lucky_activity_sponsor_info |
| | | where 1=1 |
| | | <include refid="listWhere"></include> |
| | | |
| | | <if test="query.sortList!=null"> |
| | | <foreach collection="query.sortList" item="item" separator="," open=" order by "> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | limit #{query.start},#{query.count} |
| | | </select> |
| | | |
| | | <select id="count" resultType="java.lang.Long"> |
| | | select |
| | | count(*) |
| | | from lucky_activity_sponsor_info |
| | | where 1=1 |
| | | <include refid="listWhere"></include> |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from lucky_activity_sponsor_info |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.ks.lucky.pojo.DO.LuckyActivitySponsorInfo"> |
| | | <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.ks.lucky.pojo.DO.LuckyActivitySponsorInfo"> |
| | | insert into lucky_activity_sponsor_info (id, activity_id, sponsor_id, |
| | | sponsor_ad_id, create_time, update_time |
| | | ) |
| | |
| | | #{sponsorAdId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivitySponsorInfo"> |
| | | insert into lucky_activity_sponsor_info |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="activityId != null"> |
| | | activity_id, |
| | | </if> |
| | | <if test="sponsorId != null"> |
| | | sponsor_id, |
| | | </if> |
| | | <if test="sponsorAdId != null"> |
| | | sponsor_ad_id, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | update_time, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="activityId != null"> |
| | | #{activityId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="sponsorId != null"> |
| | | #{sponsorId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="sponsorAdId != null"> |
| | | #{sponsorAdId,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | #{updateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivitySponsorInfo"> |
| | | update lucky_activity_sponsor_info |
| | | <set> |
| | | <if test="activityId != null"> |
| | | activity_id = #{activityId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="sponsorId != null"> |
| | | sponsor_id = #{sponsorId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="sponsorAdId != null"> |
| | | sponsor_ad_id = #{sponsorAdId,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.ks.lucky.pojo.DO.LuckyActivitySponsorInfo"> |
| | | <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" parameterType="com.ks.lucky.pojo.DO.LuckyActivitySponsorInfo"> |
| | | insert into lucky_activity_sponsor_info |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="activityId != null"> |
| | | activity_id, |
| | | </if> |
| | | <if test="sponsorId != null"> |
| | | sponsor_id, |
| | | </if> |
| | | <if test="sponsorAdId != null"> |
| | | sponsor_ad_id, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | update_time, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="activityId != null"> |
| | | #{activityId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="sponsorId != null"> |
| | | #{sponsorId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="sponsorAdId != null"> |
| | | #{sponsorAdId,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | #{updateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivitySponsorInfo"> |
| | | update lucky_activity_sponsor_info |
| | | <set> |
| | | <if test="activityId != null"> |
| | | activity_id = #{activityId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="sponsorId != null"> |
| | | sponsor_id = #{sponsorId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="sponsorAdId != null"> |
| | | sponsor_ad_id = #{sponsorAdId,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.ks.lucky.pojo.DO.LuckyActivitySponsorInfo"> |
| | | update lucky_activity_sponsor_info |
| | | set activity_id = #{activityId,jdbcType=BIGINT}, |
| | | sponsor_id = #{sponsorId,jdbcType=BIGINT}, |
| | |
| | | <?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.ks.lucky.mapper.LuckyMQMapper" > |
| | | <resultMap id="BaseResultMap" type="com.ks.lucky.pojo.DO.LuckyMQ" > |
| | | <id column="id" property="id" jdbcType="BIGINT" /> |
| | | <result column="task_id" property="taskId" jdbcType="VARCHAR" /> |
| | | <result column="task_name" property="taskName" jdbcType="VARCHAR" /> |
| | | <result column="state" property="state" jdbcType="INTEGER" /> |
| | | <result column="queue_name" property="queueName" jdbcType="VARCHAR" /> |
| | | <result column="queue_content" property="queueContent" jdbcType="VARCHAR" /> |
| | | <result column="pre_send_time" property="preSendTime" jdbcType="TIMESTAMP" /> |
| | | <result column="actual_send_time" property="actualSendTime" jdbcType="TIMESTAMP" /> |
| | | <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List" > |
| | | <mapper namespace="com.ks.lucky.mapper.LuckyMQMapper"> |
| | | <resultMap id="BaseResultMap" type="com.ks.lucky.pojo.DO.LuckyMQ"> |
| | | <id column="id" property="id" jdbcType="BIGINT"/> |
| | | <result column="task_id" property="taskId" jdbcType="VARCHAR"/> |
| | | <result column="task_name" property="taskName" jdbcType="VARCHAR"/> |
| | | <result column="state" property="state" jdbcType="INTEGER"/> |
| | | <result column="queue_name" property="queueName" jdbcType="VARCHAR"/> |
| | | <result column="queue_content" property="queueContent" jdbcType="VARCHAR"/> |
| | | <result column="pre_send_time" property="preSendTime" jdbcType="TIMESTAMP"/> |
| | | <result column="actual_send_time" property="actualSendTime" jdbcType="TIMESTAMP"/> |
| | | <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | id, task_id, task_name, state, queue_name, queue_content, pre_send_time, actual_send_time, |
| | | create_time, update_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" > |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from lucky_mq |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" > |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from lucky_mq |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | <!-- 非模板 --> |
| | | |
| | | <select id="selectByTaskIdForUpdate" resultMap="BaseResultMap" parameterType="java.lang.String"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from lucky_mq |
| | | where task_id = #{0} for update |
| | | </select> |
| | | |
| | | <select id="selectByTaskId" resultMap="BaseResultMap" parameterType="java.lang.String"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from lucky_mq |
| | | where task_id = #{0} |
| | | </select> |
| | | |
| | | <sql id="listWhere"> |
| | | <if test="query.state!=null"> |
| | | and state=#{query.state} |
| | | </if> |
| | | <if test="query.uid!=null"> |
| | | and uid=#{query.uid} |
| | | </if> |
| | | <if test="query.activityId!=null"> |
| | | and activity_id=#{query.activityId} |
| | | </if> |
| | | |
| | | <if test="query.minPreSendTime!=null"> |
| | | and pre_send_time>=#{query.minPreSendTime} |
| | | </if> |
| | | |
| | | <if test="query.maxPreSendTime!=null"> |
| | | and #{query.maxPreSendTime}>pre_send_time |
| | | </if> |
| | | |
| | | <if test="query.minActualSendTime!=null"> |
| | | and actual_send_time>=#{query.minActualSendTime} |
| | | </if> |
| | | |
| | | <if test="query.maxActualSendTime!=null"> |
| | | and #{query.maxActualSendTime}>actual_send_time |
| | | </if> |
| | | |
| | | |
| | | <if test="query.minCreateTime!=null"> |
| | | and create_time>=#{query.minCreateTime} |
| | | </if> |
| | | |
| | | <if test="query.maxCreateTime!=null"> |
| | | and #{query.maxCreateTime}>create_time |
| | | </if> |
| | | |
| | | </sql> |
| | | |
| | | |
| | | <select id="list" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from lucky_mq |
| | | where 1=1 |
| | | <include refid="listWhere"></include> |
| | | |
| | | <if test="query.sortList!=null"> |
| | | <foreach collection="query.sortList" item="item" separator="," open=" order by "> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | limit #{query.start},#{query.count} |
| | | </select> |
| | | |
| | | <select id="count" resultType="java.lang.Long"> |
| | | select |
| | | count(*) |
| | | from lucky_mq |
| | | where 1=1 |
| | | <include refid="listWhere"></include> |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from lucky_mq |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.ks.lucky.pojo.DO.LuckyMQ" > |
| | | <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.ks.lucky.pojo.DO.LuckyMQ"> |
| | | insert into lucky_mq (id, task_id, task_name, |
| | | state, queue_name, queue_content, |
| | | pre_send_time, actual_send_time, create_time, |
| | |
| | | #{preSendTime,jdbcType=TIMESTAMP}, #{actualSendTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, |
| | | #{updateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.ks.lucky.pojo.DO.LuckyMQ" > |
| | | insert into lucky_mq |
| | | <trim prefix="(" suffix=")" suffixOverrides="," > |
| | | <if test="id != null" > |
| | | id, |
| | | </if> |
| | | <if test="taskId != null" > |
| | | task_id, |
| | | </if> |
| | | <if test="taskName != null" > |
| | | task_name, |
| | | </if> |
| | | <if test="state != null" > |
| | | state, |
| | | </if> |
| | | <if test="queueName != null" > |
| | | queue_name, |
| | | </if> |
| | | <if test="queueContent != null" > |
| | | queue_content, |
| | | </if> |
| | | <if test="preSendTime != null" > |
| | | pre_send_time, |
| | | </if> |
| | | <if test="actualSendTime != null" > |
| | | actual_send_time, |
| | | </if> |
| | | <if test="createTime != null" > |
| | | create_time, |
| | | </if> |
| | | <if test="updateTime != null" > |
| | | update_time, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides="," > |
| | | <if test="id != null" > |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="taskId != null" > |
| | | #{taskId,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="taskName != null" > |
| | | #{taskName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="state != null" > |
| | | #{state,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="queueName != null" > |
| | | #{queueName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="queueContent != null" > |
| | | #{queueContent,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="preSendTime != null" > |
| | | #{preSendTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="actualSendTime != null" > |
| | | #{actualSendTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="createTime != null" > |
| | | #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="updateTime != null" > |
| | | #{updateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.ks.lucky.pojo.DO.LuckyMQ" > |
| | | update lucky_mq |
| | | <set > |
| | | <if test="taskId != null" > |
| | | task_id = #{taskId,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="taskName != null" > |
| | | task_name = #{taskName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="state != null" > |
| | | state = #{state,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="queueName != null" > |
| | | queue_name = #{queueName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="queueContent != null" > |
| | | queue_content = #{queueContent,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="preSendTime != null" > |
| | | pre_send_time = #{preSendTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="actualSendTime != null" > |
| | | actual_send_time = #{actualSendTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="createTime != null" > |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="updateTime != null" > |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.ks.lucky.pojo.DO.LuckyMQ" > |
| | | <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" parameterType="com.ks.lucky.pojo.DO.LuckyMQ"> |
| | | insert into lucky_mq |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="taskId != null"> |
| | | task_id, |
| | | </if> |
| | | <if test="taskName != null"> |
| | | task_name, |
| | | </if> |
| | | <if test="state != null"> |
| | | state, |
| | | </if> |
| | | <if test="queueName != null"> |
| | | queue_name, |
| | | </if> |
| | | <if test="queueContent != null"> |
| | | queue_content, |
| | | </if> |
| | | <if test="preSendTime != null"> |
| | | pre_send_time, |
| | | </if> |
| | | <if test="actualSendTime != null"> |
| | | actual_send_time, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | update_time, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="taskId != null"> |
| | | #{taskId,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="taskName != null"> |
| | | #{taskName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="state != null"> |
| | | #{state,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="queueName != null"> |
| | | #{queueName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="queueContent != null"> |
| | | #{queueContent,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="preSendTime != null"> |
| | | #{preSendTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="actualSendTime != null"> |
| | | #{actualSendTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | #{updateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.ks.lucky.pojo.DO.LuckyMQ"> |
| | | update lucky_mq |
| | | <set> |
| | | <if test="taskId != null"> |
| | | task_id = #{taskId,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="taskName != null"> |
| | | task_name = #{taskName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="state != null"> |
| | | state = #{state,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="queueName != null"> |
| | | queue_name = #{queueName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="queueContent != null"> |
| | | queue_content = #{queueContent,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="preSendTime != null"> |
| | | pre_send_time = #{preSendTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="actualSendTime != null"> |
| | | actual_send_time = #{actualSendTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="updateTime != null"> |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.ks.lucky.pojo.DO.LuckyMQ"> |
| | | update lucky_mq |
| | | set task_id = #{taskId,jdbcType=VARCHAR}, |
| | | task_name = #{taskName,jdbcType=VARCHAR}, |
| | |
| | | from lucky_sponsors |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | <!-- 非模板 --> |
| | | <sql id="listWhere"> |
| | | <if test="query.state!=null"> |
| | | and state=#{query.state} |
| | | </if> |
| | | <if test="query.account!=null"> |
| | | and account=#{query.account} |
| | | </if> |
| | | <if test="query.key!=null"> |
| | | and `name` like '${query.key}%' |
| | | </if> |
| | | |
| | | <if test="query.minCreateTime!=null"> |
| | | and create_time>=#{query.minCreateTime} |
| | | </if> |
| | | |
| | | <if test="query.maxCreateTime!=null"> |
| | | and #{query.maxCreateTime}>create_time |
| | | </if> |
| | | |
| | | </sql> |
| | | |
| | | |
| | | <select id="list" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from lucky_sponsors |
| | | where 1=1 |
| | | <include refid="listWhere"></include> |
| | | |
| | | <if test="query.sortList!=null"> |
| | | <foreach collection="query.sortList" item="item" separator="," open=" order by "> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | limit #{query.start},#{query.count} |
| | | </select> |
| | | |
| | | <select id="count" resultType="java.lang.Long"> |
| | | select |
| | | count(*) |
| | | from lucky_sponsors |
| | | where 1=1 |
| | | <include refid="listWhere"></include> |
| | | </select> |
| | | |
| | | |
| | | <select id="listDetail" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from lucky_sponsors |
| | | where |
| | | <foreach collection="ids" item="id" open="(" separator=" or " close=")"> |
| | | id=#{id} |
| | | </foreach> |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from lucky_sponsors |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.ks.lucky.pojo.DO.LuckySponsors"> |
| | | <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.ks.lucky.pojo.DO.LuckySponsors"> |
| | | insert into lucky_sponsors (id, account, pwd, |
| | | name, mobile, balance, |
| | | state, state_remarks, latest_login_time, |
| | |
| | | #{remarks,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, |
| | | #{updateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.ks.lucky.pojo.DO.LuckySponsors"> |
| | | <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" |
| | | parameterType="com.ks.lucky.pojo.DO.LuckySponsors"> |
| | | insert into lucky_sponsors |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
New file |
| | |
| | | package com.ks.lucky; |
| | | |
| | | import com.ks.app.entity.AppInfo; |
| | | import com.ks.lucky.service.impl.AppManager; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @SpringBootTest |
| | | public class AppTest { |
| | | |
| | | @Resource |
| | | private AppManager appManager; |
| | | |
| | | @Test |
| | | public void getApp() { |
| | | Long appId = appManager.getAppId("1000001"); |
| | | |
| | | AppInfo app = appManager.getAppDetail(appId); |
| | | |
| | | System.out.println(app); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ks.lucky; |
| | | |
| | | import com.ks.lucky.mapper.*; |
| | | import com.ks.lucky.pojo.DO.LuckyActivity; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityAwardResult; |
| | | import com.ks.lucky.pojo.DO.LuckySponsors; |
| | | import com.ks.lucky.query.*; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @SpringBootTest |
| | | public class MapperTest { |
| | | |
| | | @Resource |
| | | private LuckyActivityAwardResultExtraMapper luckyActivityAwardResultExtraMapper; |
| | | |
| | | @Resource |
| | | private LuckyActivityAwardResultMapper luckyActivityAwardResultMapper; |
| | | |
| | | @Resource |
| | | private LuckyActivityAwardsMapper luckyActivityAwardsMapper; |
| | | |
| | | @Resource |
| | | private LuckyActivityJoinAssistMapper luckyActivityJoinAssistMapper; |
| | | |
| | | |
| | | @Resource |
| | | private LuckyActivityJoinRecordMapper luckyActivityJoinRecordMapper; |
| | | |
| | | |
| | | @Resource |
| | | private LuckyActivityMapper luckyActivityMapper; |
| | | |
| | | |
| | | @Resource |
| | | private LuckyActivityOpenInfoMapper luckyActivityOpenInfoMapper; |
| | | |
| | | |
| | | @Resource |
| | | private LuckyActivitySponsorInfoMapper luckyActivitySponsorInfoMapper; |
| | | |
| | | @Resource |
| | | private LuckySponsorsMapper luckySponsorsMapper; |
| | | |
| | | |
| | | @Test |
| | | public void sponsors() { |
| | | LuckySponsorQuery query = new LuckySponsorQuery(); |
| | | query.state = LuckySponsors.STATE_NORMAL; |
| | | query.start = 0; |
| | | query.count = 100; |
| | | query.key = "测试"; |
| | | query.account = "1101184511@qq.com"; |
| | | query.minCreateTime=new Date(); |
| | | query.maxCreateTime=new Date(); |
| | | |
| | | luckySponsorsMapper.list(query); |
| | | luckySponsorsMapper.count(query); |
| | | |
| | | List<Long> ids = new ArrayList<>(); |
| | | ids.add(12L); |
| | | List<LuckySponsors> list = luckySponsorsMapper.listDetail(ids); |
| | | |
| | | System.out.println(list); |
| | | } |
| | | |
| | | @Test |
| | | public void sponsorActivityInfo() { |
| | | ActivitySponsorInfoQuery query = new ActivitySponsorInfoQuery(); |
| | | query.activityId = 123L; |
| | | query.sponsorId = 1L; |
| | | query.minCreateTime=new Date(); |
| | | query.maxCreateTime=new Date(); |
| | | luckyActivitySponsorInfoMapper.list(query); |
| | | luckyActivitySponsorInfoMapper.count(query); |
| | | } |
| | | |
| | | @Test |
| | | public void openInfo() { |
| | | luckyActivityOpenInfoMapper.selectByActivityId(1L); |
| | | } |
| | | |
| | | @Test |
| | | public void activity() { |
| | | luckyActivityMapper.selectByPrimaryKeyForUpdate(1L); |
| | | |
| | | luckyActivityMapper.addJoinCount(1L, 2); |
| | | |
| | | ActivityDaoQuery query = new ActivityDaoQuery(); |
| | | query.sponsorId = 1L; |
| | | query.stateList = Arrays.asList(new Integer[]{LuckyActivity.STATE_NOT_STARTED, LuckyActivity.STATE_VERIFY_REJECT}); |
| | | query.sort = "create_time desc"; |
| | | query.appId = 1L; |
| | | query.full = true; |
| | | query.start = 0; |
| | | query.count = 100; |
| | | query.minCreateTime=new Date(); |
| | | query.maxCreateTime=new Date(); |
| | | luckyActivityMapper.list(query); |
| | | luckyActivityMapper.count(query); |
| | | } |
| | | |
| | | @Test |
| | | public void join() { |
| | | ActivityJoinRecordQuery query = new ActivityJoinRecordQuery(); |
| | | query.activityId = 1L; |
| | | query.uid = "123123"; |
| | | query.appId = 1L; |
| | | query.start = 0; |
| | | query.count = 100; |
| | | query.minCreateTime=new Date(); |
| | | query.maxCreateTime=new Date(); |
| | | |
| | | luckyActivityJoinRecordMapper.list(query); |
| | | luckyActivityJoinRecordMapper.count(query); |
| | | luckyActivityJoinRecordMapper.addWeight(1L, 1); |
| | | } |
| | | |
| | | @Test |
| | | public void assist() { |
| | | ActivityJoinAssistQuery query = new ActivityJoinAssistQuery(); |
| | | query.appId = 4L; |
| | | query.joinId = 1L; |
| | | query.uid = "123"; |
| | | query.start = 0; |
| | | query.count = 100; |
| | | query.minCreateTime=new Date(); |
| | | query.maxCreateTime=new Date(); |
| | | luckyActivityJoinAssistMapper.list(query); |
| | | luckyActivityJoinAssistMapper.count(query); |
| | | } |
| | | |
| | | @Test |
| | | public void award() { |
| | | ActivityAwardQuery query = new ActivityAwardQuery(); |
| | | query.activityId = 1L; |
| | | query.start = 0; |
| | | query.count = 100; |
| | | query.minCreateTime=new Date(); |
| | | query.maxCreateTime=new Date(); |
| | | luckyActivityAwardsMapper.list(query); |
| | | luckyActivityAwardsMapper.count(query); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void awardResult() { |
| | | luckyActivityAwardResultMapper.selectByPrimaryKeyForUpdate(1L); |
| | | luckyActivityAwardResultMapper.setStateByActivityId(1L, LuckyActivityAwardResult.STATE_NOT_RECIEVE, "", new Date()); |
| | | |
| | | ActivityAwardResultQuery query = new ActivityAwardResultQuery(); |
| | | query.uid = "123"; |
| | | query.awardId = 1L; |
| | | query.activityId = 1L; |
| | | query.appId = 4L; |
| | | query.minCreateTime=new Date(); |
| | | query.maxCreateTime=new Date(); |
| | | |
| | | luckyActivityAwardResultMapper.list(query); |
| | | luckyActivityAwardResultMapper.count(query); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void awardResultExtra() { |
| | | luckyActivityAwardResultExtraMapper.selectByAwardResultId(1L); |
| | | } |
| | | |
| | | |
| | | } |