13个文件已删除
14 文件已重命名
28个文件已修改
42个文件已添加
| | |
| | | @Valid |
| | | public class LuckyActivity { |
| | | |
| | | //还未发布 |
| | | public final static int STATE_NOT_PUBLISH = -1; |
| | | |
| | | //已发布待审核,暂时不用 |
| | | public final static int STATE_VERIFYING = 0; |
| | | |
| | | //还未开始 |
| | | public final static int STATE_NOT_STARTED = 0; |
| | | public final static int STATE_NOT_STARTED = 10; |
| | | //已经开始 |
| | | public final static int STATE_STARTED = 1; |
| | | public final static int STATE_STARTED = 20; |
| | | //已经结束 |
| | | public final static int STATE_FINISH = 2; |
| | | public final static int STATE_FINISH = 30; |
| | | //已经开奖 |
| | | public final static int STATE_OPENED = 3; |
| | | public final static int STATE_OPENED = 40; |
| | | |
| | | |
| | | private Long id; |
| | |
| | | @NotNull(message = "结束时间不能为空") |
| | | private Date finishTime; |
| | | |
| | | private Date openTime; |
| | | private Date preOpenTime; |
| | | |
| | | private Date actualOpenTime; |
| | | |
| | | private Date createTime; |
| | | |
| | |
| | | |
| | | public void setSponsorId(Long sponsorId) { |
| | | this.sponsorId = sponsorId; |
| | | } |
| | | |
| | | public Date getActualOpenTime() { |
| | | return actualOpenTime; |
| | | } |
| | | |
| | | public void setActualOpenTime(Date actualOpenTime) { |
| | | this.actualOpenTime = actualOpenTime; |
| | | } |
| | | |
| | | public String getName() { |
| | |
| | | this.finishTime = finishTime; |
| | | } |
| | | |
| | | public Date getOpenTime() { |
| | | return openTime; |
| | | public Date getPreOpenTime() { |
| | | return preOpenTime; |
| | | } |
| | | |
| | | public void setOpenTime(Date openTime) { |
| | | this.openTime = openTime; |
| | | public void setPreOpenTime(Date preOpenTime) { |
| | | this.preOpenTime = preOpenTime; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | |
| | | package com.ks.lucky.pojo.DO; |
| | | |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 活动奖品物料 |
| | | */ |
| | | @Document(collection = "luckyActivityAwardMaterial") |
| | | @Valid |
| | | public class LuckyActivityAwardMaterial { |
| | | |
| | | public enum ActivityAwardMaterialType { |
| | |
| | | } |
| | | |
| | | private String id; |
| | | @NotNull(message = "物料类型不能为空") |
| | | private ActivityAwardMaterialType type; |
| | | private List<String> imgList;//图片列表 |
| | | private Date createTime; |
| | |
| | | package com.ks.lucky.pojo.DO; |
| | | |
| | | import org.springframework.data.annotation.Transient; |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Date; |
| | | |
| | | @Valid |
| | | public class LuckyActivityAwards { |
| | | |
| | | //平分 |
| | | public final static int AWARD_WAY_DIVIDE = 1; |
| | | |
| | | //随机 |
| | | public final static int AWARD_WAY_RANDOM = 2; |
| | | |
| | | private Long id; |
| | | |
| | | @NotNull(message = "活动ID不能为空") |
| | | private Long activityId; |
| | | |
| | | @NotNull(message = "奖品等级不能为空") |
| | | private Integer level; |
| | | |
| | | @NotNull(message = "奖品数量不能为空") |
| | | private Integer count; |
| | | |
| | | @NotNull(message = "中奖方式不能为空") |
| | | private Integer awardWay; |
| | | |
| | | /** |
| | | * 中奖参数 |
| | | */ |
| | | private String awardParams; |
| | | |
| | | //物料ID |
| | | private String materialId; |
| | | |
| | | private String remarks; |
| | |
| | | |
| | | private Date updateTime; |
| | | |
| | | @Transient |
| | | private LuckyActivityAwardMaterial material; |
| | | |
| | | |
| | | public LuckyActivityAwardMaterial getMaterial() { |
| | | return material; |
| | | } |
| | | |
| | | public void setMaterial(LuckyActivityAwardMaterial material) { |
| | | this.material = material; |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | |
| | | import java.util.Date; |
| | | |
| | | public class LuckyActivityJoinRecord { |
| | | |
| | | //真实用户 |
| | | public final static int USER_TYPE_REAL = 1; |
| | | |
| | | //虚拟用户 |
| | | public final static int USER_TYPE_VIRTUAL = 0; |
| | | |
| | | private Long id; |
| | | |
| | | private Long activityId; |
| | |
| | | package com.ks.lucky.pojo.DO; |
| | | |
| | | import org.springframework.data.annotation.Transient; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Date; |
| | | |
| | | public class LuckyActivitySponsorInfo { |
| | | private Long id; |
| | | |
| | | @NotNull(message = "活动ID不能为空") |
| | | private Long activityId; |
| | | |
| | | @NotNull(message = "赞助商ID不能为空") |
| | | private Long sponsorId; |
| | | |
| | | @NotNull(message = "赞助商广告不能为空") |
| | | private String sponsorAdId; |
| | | |
| | | private Date createTime; |
| | | |
| | | private Date updateTime; |
| | | |
| | | |
| | | @Transient |
| | | private LuckySponsorAd ad; |
| | | @Transient |
| | | private LuckySponsors sponsors; |
| | | |
| | | |
| | | public LuckySponsorAd getAd() { |
| | | return ad; |
| | | } |
| | | |
| | | public void setAd(LuckySponsorAd ad) { |
| | | this.ad = ad; |
| | | } |
| | | |
| | | public LuckySponsors getSponsors() { |
| | | return sponsors; |
| | | } |
| | | |
| | | public void setSponsors(LuckySponsors sponsors) { |
| | | this.sponsors = sponsors; |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | |
| | | package com.ks.lucky.pojo.DO; |
| | | |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 赞助商广告 |
| | | */ |
| | | @Valid |
| | | @Document(collection = "luckySponsorAd") |
| | | public class LuckySponsorAd { |
| | | |
| | | //待审核 |
| | | public final static int STATE_WAIT_VERIFY = 0; |
| | | //正常状态 |
| | | public final static int STATE_NORMAL = 1; |
| | | |
| | | //审核未通过 |
| | | public final static int STATE_VERIFY_REJECT = 2; |
| | | |
| | | //被封禁 |
| | | public final static int STATE_FORBIDDEN = 3; |
| | | |
| | | public enum SponsorAdType { |
| | | |
| | | alipayLife("支付宝生活号"), wxXCX("微信小程序"); |
| | |
| | | } |
| | | |
| | | |
| | | private Long id; |
| | | private String id; |
| | | @NotNull(message = "请指定广告类型") |
| | | private SponsorAdType adType;//广告类型 |
| | | @NotNull(message = "请指定赞助商") |
| | | private Long sponsorId; |
| | | private Integer state; |
| | | private String stateDesc; |
| | |
| | | this.adType = adType; |
| | | } |
| | | |
| | | public Long getId() { |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | |
| | | package com.ks.lucky.pojo.DO; |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Valid |
| | | public class LuckySponsors { |
| | | |
| | | //正常 |
| | | public final static int STATE_NORMAL = 0; |
| | | //封禁 |
| | | public final static int STATE_FORBIDDEN = 1; |
| | | |
| | | private Long id; |
| | | |
| | | @NotEmpty(message = "账号不能为空") |
| | | private String account; |
| | | |
| | | @NotEmpty(message = "密码不能为空") |
| | | private String pwd; |
| | | |
| | | @NotEmpty(message = "赞助商名称不能为空") |
| | | private String name; |
| | | |
| | | private String mobile; |
New file |
| | |
| | | package com.ks.lucky.pojo.DTO; |
| | | |
| | | import com.google.gson.Gson; |
| | | |
| | | public class JoinInfo { |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new Gson().toJson(this); |
| | | } |
| | | } |
File was renamed from facade-lucky/src/main/java/com/ks/lucky/remote/service/activity/LuckyActivityAwardMaterialService.java |
| | |
| | | package com.ks.lucky.remote.service.activity; |
| | | package com.ks.lucky.remote.service; |
| | | |
| | | import com.ks.lucky.exception.LuckyActivityAwardMaterialException; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityAwardMaterial; |
File was renamed from facade-lucky/src/main/java/com/ks/lucky/remote/service/activity/LuckyActivityAwardResultService.java |
| | |
| | | package com.ks.lucky.remote.service.activity; |
| | | package com.ks.lucky.remote.service; |
| | | |
| | | import com.ks.lucky.pojo.DO.LuckyActivityAwardResult; |
| | | |
File was renamed from facade-lucky/src/main/java/com/ks/lucky/remote/service/activity/LuckyActivityAwardService.java |
| | |
| | | package com.ks.lucky.remote.service.activity; |
| | | package com.ks.lucky.remote.service; |
| | | |
| | | import com.ks.lucky.exception.LuckyActivityAwardException; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityAwards; |
File was renamed from facade-lucky/src/main/java/com/ks/lucky/remote/service/activity/LuckyActivityJoinAssistService.java |
| | |
| | | package com.ks.lucky.remote.service.activity; |
| | | package com.ks.lucky.remote.service; |
| | | |
| | | import com.ks.lucky.exception.LuckyActivityJoinAssistException; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityJoinAssist; |
File was renamed from facade-lucky/src/main/java/com/ks/lucky/remote/service/activity/LuckyActivityJoinService.java |
| | |
| | | package com.ks.lucky.remote.service.activity; |
| | | package com.ks.lucky.remote.service; |
| | | |
| | | import com.ks.lucky.exception.LuckyActivityException; |
| | | import com.ks.lucky.exception.LuckyActivityJoinException; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityJoinRecord; |
| | | import com.ks.lucky.pojo.DTO.JoinInfo; |
| | | |
| | | /** |
| | | * 活动参与记录服务 |
| | |
| | | * @param activityId |
| | | * @param appKey |
| | | * @param uid |
| | | * @param joinInfo |
| | | * @throws LuckyActivityException |
| | | * @throws LuckyActivityJoinException |
| | | */ |
| | | public void join(Long activityId, String appKey, String uid) throws LuckyActivityJoinException; |
| | | public void join(Long activityId, String appKey, String uid, JoinInfo joinInfo) throws LuckyActivityException, LuckyActivityJoinException; |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | public LuckyActivityJoinRecord getJoinInfo(Long activityId, String appKey, String uid); |
| | | |
| | | |
| | | |
| | | |
| | | } |
File was renamed from facade-lucky/src/main/java/com/ks/lucky/remote/service/activity/LuckyActivityOpenInfoService.java |
| | |
| | | package com.ks.lucky.remote.service.activity; |
| | | package com.ks.lucky.remote.service; |
| | | |
| | | import com.ks.lucky.exception.LuckyActivityOpenInfoException; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityOpenInfo; |
File was renamed from facade-lucky/src/main/java/com/ks/lucky/remote/service/activity/LuckyActivityOpenService.java |
| | |
| | | package com.ks.lucky.remote.service.activity; |
| | | package com.ks.lucky.remote.service; |
| | | |
| | | import com.ks.lucky.exception.LuckyActivityException; |
| | | import com.ks.lucky.pojo.DO.LuckyActivity; |
File was renamed from facade-lucky/src/main/java/com/ks/lucky/remote/service/activity/LuckyActivityService.java |
| | |
| | | package com.ks.lucky.remote.service.activity; |
| | | package com.ks.lucky.remote.service; |
| | | |
| | | import com.ks.lucky.exception.LuckyActivityException; |
| | | import com.ks.lucky.pojo.DO.LuckyActivity; |
| | |
| | | public void updateActivity(LuckyActivity activity) throws LuckyActivityException; |
| | | |
| | | |
| | | /** |
| | | * 发布活动 |
| | | * |
| | | * @throws LuckyActivityException |
| | | */ |
| | | public void publishActivity(Long activityId) throws LuckyActivityException; |
| | | |
| | | |
| | | } |
File was renamed from facade-lucky/src/main/java/com/ks/lucky/remote/service/activity/LuckyActivitySponsorInfoService.java |
| | |
| | | package com.ks.lucky.remote.service.activity; |
| | | package com.ks.lucky.remote.service; |
| | | |
| | | import com.ks.lucky.exception.LuckyActivitySponsorInfoException; |
| | | import com.ks.lucky.pojo.DO.LuckyActivitySponsorInfo; |
| | |
| | | /** |
| | | * 添加赞助信息 |
| | | * |
| | | * @param OpenInfo |
| | | * @param sponsorInfo |
| | | * @throws LuckyActivitySponsorInfoException |
| | | */ |
| | | public void addOpenInfo(LuckyActivitySponsorInfo OpenInfo) throws LuckyActivitySponsorInfoException; |
| | | public void addSponsorInfo(LuckyActivitySponsorInfo sponsorInfo) throws LuckyActivitySponsorInfoException; |
| | | |
| | | /** |
| | | * 修改赞助信息 |
| | | * |
| | | * @param OpenInfo |
| | | * @param sponsorInfo |
| | | * @throws LuckyActivitySponsorInfoException |
| | | */ |
| | | public void updateOpenInfo(LuckyActivitySponsorInfo OpenInfo) throws LuckyActivitySponsorInfoException; |
| | | public void updateSponsorInfo(LuckyActivitySponsorInfo sponsorInfo) throws LuckyActivitySponsorInfoException; |
| | | |
| | | /** |
| | | * 获取赞助信息列表 |
| | |
| | | * @param id |
| | | */ |
| | | |
| | | public void deleteOpenInfo(Long id); |
| | | public void deleteSponsorInfo(Long id); |
| | | |
| | | } |
File was renamed from facade-lucky/src/main/java/com/ks/lucky/remote/service/activity/LuckySponsorAdService.java |
| | |
| | | package com.ks.lucky.remote.service.activity; |
| | | package com.ks.lucky.remote.service; |
| | | |
| | | import com.ks.lucky.exception.LuckySponsorAdException; |
| | | import com.ks.lucky.pojo.DO.LuckySponsorAd; |
| | |
| | | * @param pass 是否通过 |
| | | * @param remarks |
| | | */ |
| | | public void verifyAd(String id, boolean pass, String remarks); |
| | | public void verifyAd(String id, boolean pass, String remarks) throws LuckySponsorAdException; |
| | | |
| | | |
| | | /** |
File was renamed from facade-lucky/src/main/java/com/ks/lucky/remote/service/activity/LuckySponsorService.java |
| | |
| | | package com.ks.lucky.remote.service.activity; |
| | | package com.ks.lucky.remote.service; |
| | | |
| | | import com.ks.lucky.exception.LuckySponsorException; |
| | | import com.ks.lucky.pojo.DO.LuckySponsors; |
| | |
| | | |
| | | |
| | | /** |
| | | * 广告计数 |
| | | * 赞助商计数 |
| | | * |
| | | * @param key |
| | | * @param state |
| | |
| | | |
| | | |
| | | /** |
| | | * 获取广告详情 |
| | | * 获取赞助商详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public LuckySponsors getSponsorDetail(String id); |
| | | public LuckySponsors getSponsorDetail(Long id); |
| | | |
| | | |
| | | /** |
| | | * 批量获取广告详情 |
| | | * 批量获取赞助商详情 |
| | | * |
| | | * @param idList |
| | | * @return |
| | | */ |
| | | public List<LuckySponsors> getSponsorDetailList(List<String> idList); |
| | | public List<LuckySponsors> getSponsorDetailList(List<Long> idList); |
| | | |
| | | /** |
| | | * 添加赞助商 |
| | |
| | | |
| | | |
| | | /** |
| | | * 删除广告 |
| | | * 删除 |
| | | * |
| | | * @param id |
| | | */ |
| | | public void delete(String id); |
| | | public void delete(Long id); |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param idList |
| | | */ |
| | | public void delete(List<String> idList); |
| | | public void delete(List<Long> idList); |
| | | |
| | | } |
| | |
| | | |
| | | @SpringBootApplication |
| | | @EnableTransactionManagement |
| | | @MapperScan(basePackages = "com.ks.goldcorn.mapper") |
| | | @EnableDubbo(scanBasePackages = "com.ks.goldcorn.service.remote") |
| | | @MapperScan(basePackages = "com.ks.app.mapper") |
| | | @EnableDubbo(scanBasePackages = "com.ks.app.service.remote") |
| | | public class AppApplication extends SpringBootServletInitializer { |
| | | private final static Logger logger = LoggerFactory.getLogger(AppApplication.class); |
| | | |
File was renamed from service-app/src/main/java/com/ks/app/service/AppServiceImpl.java |
| | |
| | | package com.ks.app.service; |
| | | package com.ks.app.service.remote; |
| | | |
| | | import com.ks.app.entity.AppAlipayInfoWithBLOBs; |
| | | import com.ks.app.entity.AppInfo; |
| | | import com.ks.app.entity.AppWXInfo; |
| | | import com.ks.app.service.AppAlipayInfoManager; |
| | | import com.ks.app.service.AppInfoManager; |
| | | import com.ks.app.service.AppService; |
| | | import com.ks.app.service.AppWXInfoManager; |
| | | import org.apache.dubbo.config.annotation.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | 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_app |
| | | username: root |
| | | password: Yeshi2016@ |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | |
| | | use-global-data-source-stat: true |
| | | mybatis: |
| | | mapper-locations : classpath:mapper/*.xml |
| | | type-aliases-package: com.ks.goldcorn.pojo.DO |
| | | type-aliases-package: com.ks.app.entity |
| | | |
| | | dubbo: |
| | | application: |
| | |
| | | name: dubbo |
| | | port: 20882 |
| | | scan: |
| | | base-packages: com.ks.goldcorn.service.remote |
| | | base-packages: com.ks.app.service.remote |
| | | provider: |
| | | timeout: 10000 |
| | |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | </plugin> |
| | | <!-- MyBatis插件 --> |
| | | <plugin> |
| | | <groupId>org.mybatis.generator</groupId> |
| | | <artifactId>mybatis-generator-maven-plugin</artifactId> |
| | | <version>1.3.2</version> |
| | | <configuration> |
| | | <!--配置文件的位置--> |
| | | <configurationFile>src/main/resources/generatorConfig.xml</configurationFile> |
| | | <verbose>true</verbose> |
| | | <overwrite>true</overwrite> |
| | | </configuration> |
| | | <executions> |
| | | <execution> |
| | | <id>Generate MyBatis Artifacts</id> |
| | | <goals> |
| | | <goal>generate</goal> |
| | | </goals> |
| | | </execution> |
| | | </executions> |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.mybatis.generator</groupId> |
| | | <artifactId>mybatis-generator-core</artifactId> |
| | | <version>1.3.2</version> |
| | | </dependency> |
| | | </dependencies> |
| | | </plugin> |
| | | <!--<plugin>--> |
| | | <!--<groupId>org.mybatis.generator</groupId>--> |
| | | <!--<artifactId>mybatis-generator-maven-plugin</artifactId>--> |
| | | <!--<version>1.3.2</version>--> |
| | | <!--<configuration>--> |
| | | <!--<!–配置文件的位置–>--> |
| | | <!--<configurationFile>src/main/resources/generatorConfig.xml</configurationFile>--> |
| | | <!--<verbose>true</verbose>--> |
| | | <!--<overwrite>true</overwrite>--> |
| | | <!--</configuration>--> |
| | | <!--<executions>--> |
| | | <!--<execution>--> |
| | | <!--<id>Generate MyBatis Artifacts</id>--> |
| | | <!--<goals>--> |
| | | <!--<goal>generate</goal>--> |
| | | <!--</goals>--> |
| | | <!--</execution>--> |
| | | <!--</executions>--> |
| | | <!--<dependencies>--> |
| | | <!--<dependency>--> |
| | | <!--<groupId>org.mybatis.generator</groupId>--> |
| | | <!--<artifactId>mybatis-generator-core</artifactId>--> |
| | | <!--<version>1.3.2</version>--> |
| | | <!--</dependency>--> |
| | | <!--</dependencies>--> |
| | | <!--</plugin>--> |
| | | </plugins> |
| | | </build> |
| | | |
| | |
| | | <version>2.3.2</version> |
| | | </dependency> |
| | | |
| | | <!-- 分步式任务 --> |
| | | <dependency> |
| | | <groupId>com.xuxueli</groupId> |
| | | <artifactId>xxl-job-core</artifactId> |
| | | <version>2.1.2</version> |
| | | </dependency> |
| | | |
| | | |
| | | |
| | | <!--全局排除log4j --> |
New file |
| | |
| | | package com.ks.lucky.config; |
| | | |
| | | import com.ks.lucky.util.mq.CMQConsumeRunner; |
| | | import com.ks.lucky.util.mq.consume.AcitivtyConsumer; |
| | | import com.xxl.job.core.executor.impl.XxlJobSpringExecutor; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | @Configuration |
| | | public class CMQConsumeConfig { |
| | | |
| | | Logger log = LoggerFactory.getLogger(CMQConsumeConfig.class); |
| | | |
| | | |
| | | @Bean(initMethod = "start", destroyMethod = "destroy") |
| | | public CMQConsumeRunner xxlJobExecutor() { |
| | | CMQConsumeRunner runner = new AcitivtyConsumer(); |
| | | return runner; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ks.lucky.config; |
| | | |
| | | import com.xxl.job.core.executor.impl.XxlJobSpringExecutor; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | @Configuration |
| | | public class XXLJobConfig { |
| | | |
| | | Logger log = LoggerFactory.getLogger(XXLJobConfig.class); |
| | | |
| | | @Value("${xxl.job.admin.addresses}") |
| | | private String adminAddresses; |
| | | |
| | | @Value("${xxl.job.executor.appname}") |
| | | private String appName; |
| | | |
| | | @Value("${xxl.job.executor.ip}") |
| | | private String ip; |
| | | |
| | | @Value("${xxl.job.executor.port}") |
| | | private int port; |
| | | |
| | | @Value("${xxl.job.accessToken}") |
| | | private String accessToken; |
| | | |
| | | @Value("${xxl.job.executor.logpath}") |
| | | private String logPath; |
| | | |
| | | @Value("${xxl.job.executor.logretentiondays}") |
| | | private int logRetentionDays; |
| | | |
| | | |
| | | @Bean(initMethod = "start", destroyMethod = "destroy") |
| | | public XxlJobSpringExecutor xxlJobExecutor() { |
| | | log.info(">>>>>>>>>>> xxl-job config init."); |
| | | XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor(); |
| | | xxlJobSpringExecutor.setAdminAddresses(adminAddresses); |
| | | xxlJobSpringExecutor.setAppName(appName); |
| | | xxlJobSpringExecutor.setIp(ip); |
| | | xxlJobSpringExecutor.setPort(port); |
| | | xxlJobSpringExecutor.setAccessToken(accessToken); |
| | | xxlJobSpringExecutor.setLogPath(logPath); |
| | | xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays); |
| | | return xxlJobSpringExecutor; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ks.lucky.dao; |
| | | |
| | | import com.ks.lib.common.dao.MongodbBaseDao; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityAwardMaterial; |
| | | 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.Date; |
| | | |
| | | @Repository |
| | | public class LuckyActivityAwardMaterialDao extends MongodbBaseDao<LuckyActivityAwardMaterial> { |
| | | |
| | | /** |
| | | * 更新 |
| | | * |
| | | * @param material |
| | | */ |
| | | public void updateSelective(LuckyActivityAwardMaterial material) { |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("id").is(material.getId())); |
| | | Update update = new Update(); |
| | | if (material.getType() != null) { |
| | | update.set("type", material.getType()); |
| | | } |
| | | if (material.getImgList() != null) { |
| | | update.set("imgList", material.getImgList()); |
| | | } |
| | | update.set("updateTime", new Date()); |
| | | update(query, update); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ks.lucky.dao; |
| | | |
| | | import com.ks.lib.common.dao.MongodbBaseDao; |
| | | import com.ks.lucky.pojo.DO.LuckySponsorAd; |
| | | import com.ks.lucky.query.LuckySponsorAdQuery; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Repository |
| | | public class LuckySponsorAdDao extends MongodbBaseDao<LuckySponsorAd> { |
| | | |
| | | |
| | | public List<LuckySponsorAd> list(LuckySponsorAdQuery query) { |
| | | |
| | | return null; |
| | | } |
| | | |
| | | public long count(LuckySponsorAdQuery query) { |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | public void updateSelective(LuckySponsorAd ad) { |
| | | |
| | | } |
| | | |
| | | public List<LuckySponsorAd> list(List<String> ids) { |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ks.lucky.exception; |
| | | |
| | | import com.ks.lib.common.exception.BaseException; |
| | | |
| | | public class LuckyMQException extends BaseException { |
| | | |
| | | |
| | | public LuckyMQException(int code, String msg) { |
| | | super(code, msg); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ks.lucky.job; |
| | | |
| | | import com.ks.lucky.pojo.DO.LuckyMQ; |
| | | import com.ks.lucky.service.LuckyMQService; |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Component |
| | | public class MQJob { |
| | | |
| | | @Resource |
| | | private LuckyMQService luckyMQService; |
| | | |
| | | |
| | | @XxlJob("mqjob-sendmq") |
| | | public ReturnT<String> sendMQ(String param) throws Exception { |
| | | Date now = new Date(); |
| | | List<LuckyMQ> mqList = luckyMQService.listUnSendMsg(now, 1, 1000); |
| | | if (mqList != null) { |
| | | for (LuckyMQ mq : mqList) { |
| | | luckyMQService.sendMsg(mq.getTaskId()); |
| | | } |
| | | } |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.ks.lib.common.dao.BaseMapper; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityAwardResult; |
| | | import com.ks.lucky.query.ActivityAwardResultQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface LuckyActivityAwardResultMapper extends BaseMapper<LuckyActivityAwardResult> { |
| | | |
| | | List<LuckyActivityAwardResult> list(@Param("query") ActivityAwardResultQuery query); |
| | | |
| | | long count(@Param("query") ActivityAwardResultQuery query); |
| | | |
| | | } |
| | |
| | | |
| | | import com.ks.lib.common.dao.BaseMapper; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityAwards; |
| | | import com.ks.lucky.query.ActivityAwardQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface LuckyActivityAwardsMapper extends BaseMapper<LuckyActivityAwards> { |
| | | |
| | | |
| | | List<LuckyActivityAwards> list(@Param("query") ActivityAwardQuery query); |
| | | |
| | | long count(@Param("query") ActivityAwardQuery query); |
| | | |
| | | } |
| | |
| | | |
| | | import com.ks.lib.common.dao.BaseMapper; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityJoinAssist; |
| | | import com.ks.lucky.query.ActivityJoinAssistQuery; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface LuckyActivityJoinAssistMapper extends BaseMapper<LuckyActivityJoinAssist> { |
| | | |
| | | |
| | | List<LuckyActivityJoinAssist> list(ActivityJoinAssistQuery query); |
| | | |
| | | long count(ActivityJoinAssistQuery query); |
| | | } |
| | |
| | | |
| | | import com.ks.lib.common.dao.BaseMapper; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityJoinRecord; |
| | | import com.ks.lucky.query.ActivityJoinRecordQuery; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface LuckyActivityJoinRecordMapper extends BaseMapper<LuckyActivityJoinRecord> { |
| | | |
| | | List<LuckyActivityJoinRecord> list(ActivityJoinRecordQuery query); |
| | | |
| | | void addWeight(Long id, int weight); |
| | | |
| | | } |
| | |
| | | |
| | | public interface LuckyActivityMapper extends BaseMapper<LuckyActivity> { |
| | | |
| | | public List<LuckyActivity> list(@Param("query") ActivityDaoQuery query); |
| | | List<LuckyActivity> list(@Param("query") ActivityDaoQuery query); |
| | | |
| | | public long count(@Param("query") ActivityDaoQuery query); |
| | | long count(@Param("query") ActivityDaoQuery query); |
| | | |
| | | LuckyActivity selectByPrimaryKeyForUpdate(Long id); |
| | | |
| | | int addJoinCount(Long activityId,int joinCount); |
| | | |
| | | } |
| | |
| | | |
| | | import com.ks.lib.common.dao.BaseMapper; |
| | | import com.ks.lucky.pojo.DO.LuckyActivitySponsorInfo; |
| | | import com.ks.lucky.query.ActivitySponsorInfoQuery; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface LuckyActivitySponsorInfoMapper extends BaseMapper<LuckyActivitySponsorInfo> { |
| | | |
| | | List<LuckyActivitySponsorInfo> list(ActivitySponsorInfoQuery query); |
| | | |
| | | } |
New file |
| | |
| | | package com.ks.lucky.mapper; |
| | | |
| | | import com.ks.lib.common.dao.BaseMapper; |
| | | import com.ks.lucky.pojo.DO.LuckyMQ; |
| | | import com.ks.lucky.query.MQQuery; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface LuckyMQMapper extends BaseMapper<LuckyMQ> { |
| | | |
| | | LuckyMQ selectByTaskIdForUpdate(String taskId); |
| | | |
| | | LuckyMQ selectByTaskId(String taskId); |
| | | |
| | | List<LuckyMQ> list(MQQuery query); |
| | | |
| | | long count(MQQuery query); |
| | | } |
| | |
| | | package com.ks.lucky.mapper; |
| | | |
| | | import com.ks.lib.common.dao.BaseMapper; |
| | | import com.ks.lucky.pojo.DO.LuckySponsors; |
| | | import com.ks.lucky.query.LuckySponsorQuery; |
| | | |
| | | public interface LuckySponsorsMapper { |
| | | int deleteByPrimaryKey(Long id); |
| | | import java.util.List; |
| | | |
| | | int insert(LuckySponsors record); |
| | | public interface LuckySponsorsMapper extends BaseMapper<LuckySponsors> { |
| | | |
| | | int insertSelective(LuckySponsors record); |
| | | |
| | | LuckySponsors selectByPrimaryKey(Long id); |
| | | List<LuckySponsors> list(LuckySponsorQuery query); |
| | | |
| | | int updateByPrimaryKeySelective(LuckySponsors record); |
| | | long count(LuckySponsorQuery query); |
| | | |
| | | int updateByPrimaryKey(LuckySponsors record); |
| | | |
| | | List<LuckySponsors> listDetail(List<Long> ids); |
| | | } |
New file |
| | |
| | | package com.ks.lucky.pojo.DO; |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Date; |
| | | |
| | | @Valid |
| | | public class LuckyMQ { |
| | | //未发送 |
| | | public final static int STATE_NOT_SEND = 0; |
| | | //已发送 |
| | | public final static int STATE_SENDED = 1; |
| | | |
| | | |
| | | private Long id; |
| | | |
| | | @NotEmpty(message = "任务ID不能为空") |
| | | private String taskId; |
| | | |
| | | |
| | | private String taskName; |
| | | |
| | | private Integer state; |
| | | |
| | | @NotEmpty(message = "队列名称不能为空") |
| | | private String queueName; |
| | | |
| | | @NotEmpty(message = "队列内容不能为空") |
| | | private String queueContent; |
| | | |
| | | @NotNull(message = "预计发送时间不能为空") |
| | | private Date preSendTime; |
| | | |
| | | private Date actualSendTime; |
| | | |
| | | private Date createTime; |
| | | |
| | | private Date updateTime; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getTaskId() { |
| | | return taskId; |
| | | } |
| | | |
| | | public void setTaskId(String taskId) { |
| | | this.taskId = taskId == null ? null : taskId.trim(); |
| | | } |
| | | |
| | | public String getTaskName() { |
| | | return taskName; |
| | | } |
| | | |
| | | public void setTaskName(String taskName) { |
| | | this.taskName = taskName == null ? null : taskName.trim(); |
| | | } |
| | | |
| | | public Integer getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(Integer state) { |
| | | this.state = state; |
| | | } |
| | | |
| | | public String getQueueName() { |
| | | return queueName; |
| | | } |
| | | |
| | | public void setQueueName(String queueName) { |
| | | this.queueName = queueName == null ? null : queueName.trim(); |
| | | } |
| | | |
| | | public String getQueueContent() { |
| | | return queueContent; |
| | | } |
| | | |
| | | public void setQueueContent(String queueContent) { |
| | | this.queueContent = queueContent == null ? null : queueContent.trim(); |
| | | } |
| | | |
| | | public Date getPreSendTime() { |
| | | return preSendTime; |
| | | } |
| | | |
| | | public void setPreSendTime(Date preSendTime) { |
| | | this.preSendTime = preSendTime; |
| | | } |
| | | |
| | | public Date getActualSendTime() { |
| | | return actualSendTime; |
| | | } |
| | | |
| | | public void setActualSendTime(Date actualSendTime) { |
| | | this.actualSendTime = actualSendTime; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Date getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Date updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ks.lucky.pojo.DTO; |
| | | |
| | | import java.util.Date; |
| | | |
| | | public class ActivityMQMsg { |
| | | //开始活动 |
| | | public final static int TYPE_EXEC_START = 1; |
| | | //活动达到最小开奖人数 |
| | | public final static int TYPE_REACH_MIN_PERSON = 2; |
| | | //活动达到最大开奖数 |
| | | public final static int TYPE_REACH_MAX_PERSON = 3; |
| | | //活动达到开奖时间 |
| | | public final static int TYPE_REACH_OPEN_TIME = 4; |
| | | //活动开奖 |
| | | public final static int TYPE_OPEN = 5; |
| | | |
| | | private Long activityId; |
| | | private Integer type; |
| | | private Date createTime; |
| | | |
| | | public ActivityMQMsg(Long activityId, Integer type, Date createTime) { |
| | | this.activityId = activityId; |
| | | this.type = type; |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Long getActivityId() { |
| | | return activityId; |
| | | } |
| | | |
| | | public void setActivityId(Long activityId) { |
| | | this.activityId = activityId; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ks.lucky.query; |
| | | |
| | | public class ActivityAwardQuery extends BaseDaoQuery { |
| | | public Long activityId; |
| | | } |
New file |
| | |
| | | package com.ks.lucky.query; |
| | | |
| | | public class ActivityAwardResultQuery extends BaseDaoQuery { |
| | | public Long appId; |
| | | public String uid; |
| | | public Long activityId; |
| | | public Long awardId; |
| | | } |
New file |
| | |
| | | package com.ks.lucky.query; |
| | | |
| | | public class ActivityJoinAssistQuery extends BaseDaoQuery { |
| | | public Long joinId; |
| | | public Long appId; |
| | | public String uid; |
| | | public String targetUid; |
| | | } |
New file |
| | |
| | | package com.ks.lucky.query; |
| | | |
| | | public class ActivityJoinRecordQuery extends BaseDaoQuery { |
| | | public Long activityId; |
| | | public Long appId; |
| | | public String uid; |
| | | } |
New file |
| | |
| | | package com.ks.lucky.query; |
| | | |
| | | public class ActivitySponsorInfoQuery extends BaseDaoQuery { |
| | | public Long activityId; |
| | | public Long appId; |
| | | public String uid; |
| | | } |
New file |
| | |
| | | package com.ks.lucky.query; |
| | | |
| | | import com.ks.lucky.pojo.DO.LuckySponsorAd; |
| | | |
| | | public class LuckySponsorAdQuery extends BaseDaoQuery { |
| | | public Long sponsorId; |
| | | public String key; |
| | | public LuckySponsorAd.SponsorAdType type; |
| | | } |
New file |
| | |
| | | package com.ks.lucky.query; |
| | | |
| | | public class LuckySponsorQuery extends BaseDaoQuery { |
| | | public String key; |
| | | public Integer state; |
| | | public String account; |
| | | } |
New file |
| | |
| | | package com.ks.lucky.query; |
| | | |
| | | import java.util.Date; |
| | | |
| | | public class MQQuery { |
| | | |
| | | //状态 |
| | | public Integer state; |
| | | |
| | | //预计发送时间 |
| | | public Date maxPreSendTime; |
| | | |
| | | public Date minPreSendTime; |
| | | |
| | | //实际发送时间 |
| | | public Date maxActualSendTime; |
| | | |
| | | public Date minActualSendTime; |
| | | |
| | | public long start; |
| | | |
| | | public int count; |
| | | |
| | | } |
New file |
| | |
| | | package com.ks.lucky.service; |
| | | |
| | | import com.ks.lucky.exception.LuckyMQException; |
| | | import com.ks.lucky.pojo.DO.LuckyMQ; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface LuckyMQService { |
| | | |
| | | /** |
| | | * 添加消息 |
| | | * |
| | | * @param mq |
| | | * @throws LuckyMQException |
| | | */ |
| | | public void addMQ(LuckyMQ mq) throws LuckyMQException; |
| | | |
| | | |
| | | /** |
| | | * 获取当前未发送的消息列表 |
| | | * |
| | | * @param now |
| | | * @param page |
| | | * @param pageCount |
| | | */ |
| | | public List<LuckyMQ> listUnSendMsg(Date now, int page, int pageCount); |
| | | |
| | | /** |
| | | * 未发送消息计数 |
| | | * |
| | | * @param now |
| | | */ |
| | | public long countUnSendMsg(Date now); |
| | | |
| | | |
| | | /** |
| | | * 移除未发送的消息 |
| | | * |
| | | * @param taskId |
| | | */ |
| | | public void removeUnSendMsg(String taskId) throws LuckyMQException; |
| | | |
| | | |
| | | /** |
| | | * 发送消息 |
| | | * |
| | | * @param taskId |
| | | */ |
| | | public void sendMsg(String taskId) throws LuckyMQException; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ks.lucky.service.impl; |
| | | |
| | | import com.ks.app.entity.AppInfo; |
| | | import com.ks.app.service.AppService; |
| | | import org.apache.dubbo.config.annotation.Reference; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | public class AppManager { |
| | | |
| | | @Reference(version = "1.0") |
| | | private AppService appService; |
| | | |
| | | public Long getAppId(String appKey) { |
| | | AppInfo app = appService.getApp(appKey); |
| | | if (app != null) { |
| | | return app.getId(); |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ks.lucky.service.impl; |
| | | |
| | | import com.ks.lucky.exception.LuckyActivityAwardException; |
| | | import com.ks.lucky.mapper.LuckyActivityAwardsMapper; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityAwardMaterial; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityAwards; |
| | | import com.ks.lucky.query.ActivityAwardQuery; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.yeshi.utils.StringUtil; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 活动奖项管理 |
| | | */ |
| | | @Component |
| | | public class LuckyActivityAwardManager { |
| | | |
| | | @Resource |
| | | private LuckyActivityAwardsMapper luckyActivityAwardsMapper; |
| | | |
| | | @Resource |
| | | private LuckyActivityAwardMaterialManager luckyActivityAwardMaterialManager; |
| | | |
| | | /** |
| | | * 添加奖项 |
| | | * |
| | | * @param award |
| | | * @throws LuckyActivityAwardException |
| | | */ |
| | | @Validated |
| | | public void addAward(LuckyActivityAwards award) throws LuckyActivityAwardException { |
| | | if (award.getCreateTime() == null) { |
| | | award.setCreateTime(new Date()); |
| | | } |
| | | luckyActivityAwardsMapper.insertSelective(award); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改奖项 |
| | | * |
| | | * @param award |
| | | * @throws LuckyActivityAwardException |
| | | */ |
| | | public void updateAward(LuckyActivityAwards award) throws LuckyActivityAwardException { |
| | | if (award.getId() == null) { |
| | | throw new LuckyActivityAwardException(LuckyActivityAwardException.CODE_PARAMS_NOT_ENOUGH, "参数不完整"); |
| | | } |
| | | |
| | | if (award.getUpdateTime() == null) { |
| | | award.setUpdateTime(new Date()); |
| | | } |
| | | luckyActivityAwardsMapper.updateByPrimaryKeySelective(award); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取奖项列表 |
| | | * |
| | | * @param activityId |
| | | * @return |
| | | */ |
| | | public List<LuckyActivityAwards> getAwardList(Long activityId) { |
| | | ActivityAwardQuery query = new ActivityAwardQuery(); |
| | | query.activityId = activityId; |
| | | query.start = 0; |
| | | query.count = 100; |
| | | return luckyActivityAwardsMapper.list(query); |
| | | } |
| | | |
| | | /** |
| | | * 获取奖项详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public LuckyActivityAwards getAwardDetail(Long id) { |
| | | LuckyActivityAwards awards = luckyActivityAwardsMapper.selectByPrimaryKey(id); |
| | | if (!StringUtil.isNullOrEmpty(awards.getMaterialId())) { |
| | | LuckyActivityAwardMaterial material = luckyActivityAwardMaterialManager.getAwardMaterialDetail(awards.getMaterialId()); |
| | | if (material != null) { |
| | | awards.setMaterial(material); |
| | | } |
| | | } |
| | | return awards; |
| | | } |
| | | |
| | | /** |
| | | * 删除奖项 |
| | | * |
| | | * @param id |
| | | */ |
| | | |
| | | public void deleteAward(Long id) { |
| | | LuckyActivityAwards awards = getAwardDetail(id); |
| | | if (awards.getMaterial() != null) { |
| | | luckyActivityAwardMaterialManager.deleteAwardMaterial(awards.getMaterial().getId()); |
| | | } |
| | | luckyActivityAwardsMapper.deleteByPrimaryKey(id); |
| | | } |
| | | |
| | | |
| | | } |
File was renamed from service-lucky/src/main/java/com/ks/lucky/service/remote/LuckyActivityAwardMaterialManager.java |
| | |
| | | package com.ks.lucky.service.remote; |
| | | package com.ks.lucky.service.impl; |
| | | |
| | | import com.ks.lucky.exception.LuckyActivityAwardMaterialException; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityAwardMaterial; |
New file |
| | |
| | | package com.ks.lucky.service.impl; |
| | | |
| | | import com.ks.lucky.exception.LuckyActivityAwardException; |
| | | import com.ks.lucky.mapper.LuckyActivityAwardsMapper; |
| | | import com.ks.lucky.mapper.LuckyActivityJoinRecordMapper; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityAwardMaterial; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityAwards; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityJoinRecord; |
| | | import com.ks.lucky.query.ActivityAwardQuery; |
| | | import com.ks.lucky.query.ActivityJoinRecordQuery; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.yeshi.utils.StringUtil; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 活动奖项管理 |
| | | */ |
| | | @Component |
| | | public class LuckyActivityJoinManager { |
| | | |
| | | @Resource |
| | | private LuckyActivityJoinRecordMapper luckyActivityJoinRecordMapper; |
| | | |
| | | |
| | | public LuckyActivityJoinRecord getRecord(Long activityId, Long appId, String uid) { |
| | | ActivityJoinRecordQuery query = new ActivityJoinRecordQuery(); |
| | | query.appId = appId; |
| | | query.uid = uid; |
| | | query.activityId = activityId; |
| | | List<LuckyActivityJoinRecord> list = luckyActivityJoinRecordMapper.list(query); |
| | | if (list != null && list.size() > 0) |
| | | return list.get(0); |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ks.lucky.service.impl; |
| | | |
| | | import com.ks.lucky.exception.LuckyActivityException; |
| | | import com.ks.lucky.mapper.LuckyActivityMapper; |
| | | import com.ks.lucky.pojo.DO.LuckyActivity; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityOpenInfo; |
| | | import com.ks.lucky.pojo.DTO.ActivityMQMsg; |
| | | import com.ks.lucky.util.mq.CMQManager; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | |
| | | @Component |
| | | public class LuckyActivityManager { |
| | | |
| | | @Resource |
| | | private LuckyActivityMapper luckyActivityMapper; |
| | | |
| | | @Resource |
| | | private LuckyActivityOpenInfoManager luckyActivityOpenInfoManager; |
| | | |
| | | |
| | | /** |
| | | * 活动是否还可以参加 |
| | | * |
| | | * @param activityId |
| | | * @return |
| | | * @throws LuckyActivityException |
| | | */ |
| | | public boolean canJoin(Long activityId) throws LuckyActivityException { |
| | | LuckyActivity activity = luckyActivityMapper.selectByPrimaryKey(activityId); |
| | | if (activity == null) { |
| | | throw new LuckyActivityException(LuckyActivityException.CODE_NOT_EXIST, "活动不存在"); |
| | | } |
| | | |
| | | if (activity.getState() == LuckyActivity.STATE_NOT_STARTED) { |
| | | throw new LuckyActivityException(1, "活动还未开始"); |
| | | } |
| | | |
| | | if (activity.getState() == LuckyActivity.STATE_FINISH || activity.getState() == LuckyActivity.STATE_OPENED) { |
| | | throw new LuckyActivityException(1, "活动已经结束"); |
| | | } |
| | | |
| | | if (activity.getCurrentPersonCount() >= activity.getMaxPersonCount()) { |
| | | throw new LuckyActivityException(1, "参与人数已满"); |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 添加参与数 |
| | | * |
| | | * @param activityId |
| | | * @param count |
| | | * @throws LuckyActivityException |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addJoinCount(Long activityId, int count) throws LuckyActivityException { |
| | | LuckyActivity luckyActivity = luckyActivityMapper.selectByPrimaryKeyForUpdate(activityId); |
| | | if (luckyActivity == null) { |
| | | throw new LuckyActivityException(LuckyActivityException.CODE_NOT_EXIST, "活动不存在"); |
| | | } |
| | | |
| | | LuckyActivityOpenInfo openInfo = luckyActivityOpenInfoManager.getOpenInfo(activityId); |
| | | if (openInfo == null) { |
| | | throw new LuckyActivityException(1, "活动信息不完整"); |
| | | } |
| | | |
| | | int currentCount = luckyActivity.getCurrentPersonCount(); |
| | | LuckyActivity update = new LuckyActivity(); |
| | | update.setId(activityId); |
| | | update.setCurrentPersonCount(currentCount + count); |
| | | update.setUpdateTime(new Date()); |
| | | luckyActivityMapper.updateByPrimaryKeySelective(update); |
| | | if (update.getCurrentPersonCount().intValue() >= openInfo.getMinPersonCount() && currentCount < openInfo.getMinPersonCount()) { |
| | | //达到最低开奖人数 |
| | | CMQManager.getInstance().addActivityMsg(new ActivityMQMsg(activityId, ActivityMQMsg.TYPE_REACH_MIN_PERSON, new Date())); |
| | | } |
| | | |
| | | if (update.getCurrentPersonCount().intValue() >= luckyActivity.getMaxPersonCount() && currentCount < luckyActivity.getMaxPersonCount()) { |
| | | //达到最大开奖人数 |
| | | CMQManager.getInstance().addActivityMsg(new ActivityMQMsg(activityId, ActivityMQMsg.TYPE_REACH_MAX_PERSON, new Date())); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 启动活动 |
| | | * |
| | | * @param activityId |
| | | */ |
| | | public void startUpActivity(Long activityId) throws LuckyActivityException { |
| | | LuckyActivity luckyActivity = luckyActivityMapper.selectByPrimaryKeyForUpdate(activityId); |
| | | if (luckyActivity == null) { |
| | | throw new LuckyActivityException(LuckyActivityException.CODE_NOT_EXIST, "活动不存在"); |
| | | } |
| | | |
| | | if (luckyActivity.getState() != LuckyActivity.STATE_NOT_STARTED) { |
| | | throw new LuckyActivityException(1, "活动尚未处于待启动状态"); |
| | | } |
| | | |
| | | //启动活动 |
| | | LuckyActivity update = new LuckyActivity(); |
| | | update.setId(activityId); |
| | | update.setUpdateTime(new Date()); |
| | | update.setState(LuckyActivity.STATE_STARTED); |
| | | update.setStateRemarks("已经启动"); |
| | | |
| | | luckyActivityMapper.updateByPrimaryKeySelective(update); |
| | | } |
| | | |
| | | |
| | | } |
File was renamed from service-lucky/src/main/java/com/ks/lucky/service/remote/LuckyActivityOpenInfoManager.java |
| | |
| | | package com.ks.lucky.service.remote; |
| | | package com.ks.lucky.service.impl; |
| | | |
| | | import com.ks.lucky.exception.LuckyActivityOpenInfoException; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityOpenInfo; |
New file |
| | |
| | | package com.ks.lucky.service.impl; |
| | | |
| | | import com.ks.lucky.dao.LuckySponsorAdDao; |
| | | import com.ks.lucky.exception.LuckyActivitySponsorInfoException; |
| | | import com.ks.lucky.mapper.LuckyActivitySponsorInfoMapper; |
| | | import com.ks.lucky.mapper.LuckySponsorsMapper; |
| | | import com.ks.lucky.pojo.DO.LuckyActivitySponsorInfo; |
| | | import com.ks.lucky.pojo.DO.LuckySponsorAd; |
| | | import com.ks.lucky.pojo.DO.LuckySponsors; |
| | | import com.ks.lucky.query.ActivitySponsorInfoQuery; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.validation.annotation.Validated; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 活动赞助信息管理 |
| | | */ |
| | | @Component |
| | | public class LuckyActivitySponsorInfoManager { |
| | | |
| | | @Resource |
| | | private LuckyActivitySponsorInfoMapper luckyActivitySponsorInfoMapper; |
| | | |
| | | @Resource |
| | | private LuckySponsorAdDao luckySponsorAdDao; |
| | | |
| | | @Resource |
| | | private LuckySponsorsMapper luckySponsorsMapper; |
| | | |
| | | |
| | | /** |
| | | * 添加赞助信息 |
| | | * |
| | | * @param sponsorInfo |
| | | * @throws LuckyActivitySponsorInfoException |
| | | */ |
| | | @Validated |
| | | public void addSponsorInfo(LuckyActivitySponsorInfo sponsorInfo) throws LuckyActivitySponsorInfoException { |
| | | ActivitySponsorInfoQuery query = new ActivitySponsorInfoQuery(); |
| | | query.activityId = sponsorInfo.getActivityId(); |
| | | |
| | | List<LuckyActivitySponsorInfo> list = luckyActivitySponsorInfoMapper.list(query); |
| | | if (list != null && list.size() > 0) { |
| | | throw new LuckyActivitySponsorInfoException(LuckyActivitySponsorInfoException.CODE_EXIST, "活动赞助信息已经存在"); |
| | | } |
| | | |
| | | if (sponsorInfo.getCreateTime() == null) { |
| | | sponsorInfo.setCreateTime(new Date()); |
| | | } |
| | | luckyActivitySponsorInfoMapper.insertSelective(sponsorInfo); |
| | | } |
| | | |
| | | /** |
| | | * 修改赞助信息 |
| | | * |
| | | * @param sponsorInfo |
| | | * @throws LuckyActivitySponsorInfoException |
| | | */ |
| | | public void updateSponsorInfo(LuckyActivitySponsorInfo sponsorInfo) throws LuckyActivitySponsorInfoException { |
| | | luckyActivitySponsorInfoMapper.updateByPrimaryKeySelective(sponsorInfo); |
| | | } |
| | | |
| | | /** |
| | | * 获取赞助信息列表 |
| | | * |
| | | * @param activityId |
| | | * @return |
| | | */ |
| | | public LuckyActivitySponsorInfo getSponsorInfo(Long activityId) { |
| | | ActivitySponsorInfoQuery query = new ActivitySponsorInfoQuery(); |
| | | query.activityId = activityId; |
| | | List<LuckyActivitySponsorInfo> list = luckyActivitySponsorInfoMapper.list(query); |
| | | if (list != null && list.size() > 0) { |
| | | return list.get(0); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 获取赞助信息详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public LuckyActivitySponsorInfo getSponsorInfoDetail(Long id) { |
| | | LuckyActivitySponsorInfo info = luckyActivitySponsorInfoMapper.selectByPrimaryKey(id); |
| | | if (info == null) { |
| | | return null; |
| | | } |
| | | |
| | | if (info.getSponsorAdId() != null) { |
| | | LuckySponsorAd ad = luckySponsorAdDao.get(info.getSponsorAdId()); |
| | | info.setAd(ad); |
| | | } |
| | | |
| | | if (info.getSponsorId() != null) { |
| | | LuckySponsors sponsor = luckySponsorsMapper.selectByPrimaryKey(info.getSponsorId()); |
| | | info.setSponsors(sponsor); |
| | | } |
| | | return info; |
| | | } |
| | | |
| | | /** |
| | | * 删除赞助信息 |
| | | * |
| | | * @param id |
| | | */ |
| | | |
| | | public void deleteSponsorInfo(Long id) { |
| | | luckySponsorsMapper.deleteByPrimaryKey(id); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ks.lucky.service.impl; |
| | | |
| | | import com.ks.lucky.exception.LuckyMQException; |
| | | import com.ks.lucky.mapper.LuckyMQMapper; |
| | | import com.ks.lucky.pojo.DO.LuckyMQ; |
| | | import com.ks.lucky.query.MQQuery; |
| | | import com.ks.lucky.service.LuckyMQService; |
| | | import com.ks.lucky.util.mq.CMQManager; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class LuckyMQServiceImpl implements LuckyMQService { |
| | | @Resource |
| | | private LuckyMQMapper luckyMQMapper; |
| | | |
| | | @Override |
| | | public void addMQ(LuckyMQ mq) throws LuckyMQException { |
| | | LuckyMQ old = luckyMQMapper.selectByTaskId(mq.getTaskId()); |
| | | if (old != null) { |
| | | throw new LuckyMQException(LuckyMQException.CODE_EXIST, "任务ID已经存在"); |
| | | } |
| | | |
| | | if (mq.getCreateTime() == null) { |
| | | mq.setCreateTime(new Date()); |
| | | } |
| | | |
| | | luckyMQMapper.insertSelective(mq); |
| | | } |
| | | |
| | | @Override |
| | | public List<LuckyMQ> listUnSendMsg(Date now, int page, int pageCount) { |
| | | MQQuery query = new MQQuery(); |
| | | query.maxPreSendTime = new Date(now.getTime() + 1L); |
| | | query.minPreSendTime = new Date(now.getTime() - 1000 * 60 * 60L * 24); |
| | | query.state = LuckyMQ.STATE_NOT_SEND; |
| | | query.start = (page - 1) * pageCount; |
| | | query.count = pageCount; |
| | | return luckyMQMapper.list(query); |
| | | } |
| | | |
| | | @Override |
| | | public long countUnSendMsg(Date now) { |
| | | MQQuery query = new MQQuery(); |
| | | query.maxPreSendTime = new Date(now.getTime() + 1L); |
| | | query.minPreSendTime = new Date(now.getTime() - 1000 * 60 * 60L * 24); |
| | | query.state = LuckyMQ.STATE_NOT_SEND; |
| | | return luckyMQMapper.count(query); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void removeUnSendMsg(String taskId) throws LuckyMQException { |
| | | LuckyMQ old = luckyMQMapper.selectByTaskIdForUpdate(taskId); |
| | | if (old == null) { |
| | | return; |
| | | } |
| | | if (old.getState() != LuckyMQ.STATE_NOT_SEND) { |
| | | throw new LuckyMQException(1, "消息不是待发送状态"); |
| | | } |
| | | luckyMQMapper.deleteByPrimaryKey(old.getId()); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void sendMsg(String taskId) throws LuckyMQException { |
| | | LuckyMQ mq = luckyMQMapper.selectByTaskIdForUpdate(taskId); |
| | | if (mq == null) { |
| | | throw new LuckyMQException(LuckyMQException.CODE_EXIST, "任务ID已经存在"); |
| | | } |
| | | |
| | | CMQManager.getInstance().addMsg(mq.getQueueName(), mq.getQueueContent()); |
| | | LuckyMQ update = new LuckyMQ(); |
| | | update.setId(mq.getId()); |
| | | update.setState(LuckyMQ.STATE_SENDED); |
| | | update.setActualSendTime(new Date()); |
| | | update.setUpdateTime(new Date()); |
| | | luckyMQMapper.updateByPrimaryKeySelective(update); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ks.lucky.service.impl; |
| | | |
| | | import com.ks.lucky.dao.LuckySponsorAdDao; |
| | | import com.ks.lucky.exception.LuckyActivitySponsorInfoException; |
| | | import com.ks.lucky.mapper.LuckyActivitySponsorInfoMapper; |
| | | import com.ks.lucky.mapper.LuckySponsorsMapper; |
| | | import com.ks.lucky.pojo.DO.LuckyActivitySponsorInfo; |
| | | import com.ks.lucky.pojo.DO.LuckySponsorAd; |
| | | import com.ks.lucky.pojo.DO.LuckySponsors; |
| | | import com.ks.lucky.query.ActivitySponsorInfoQuery; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.validation.annotation.Validated; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 赞助商广告管理 |
| | | */ |
| | | @Component |
| | | public class LuckySponsorAdManager { |
| | | |
| | | @Resource |
| | | private LuckySponsorAdDao luckySponsorAdDao; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ks.lucky.service.impl.remote; |
| | | |
| | | import com.aliyun.tea.Validation; |
| | | import com.ks.lucky.dao.LuckyActivityAwardMaterialDao; |
| | | import com.ks.lucky.exception.LuckyActivityAwardMaterialException; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityAwardMaterial; |
| | | import com.ks.lucky.remote.service.LuckyActivityAwardMaterialService; |
| | | import org.apache.dubbo.config.annotation.Service; |
| | | import org.springframework.validation.annotation.Validated; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | @Service(version = "1.0") |
| | | public class LuckyActivityAwardMaterialServiceImpl implements LuckyActivityAwardMaterialService { |
| | | |
| | | @Resource |
| | | private LuckyActivityAwardMaterialDao luckyActivityAwardMaterialDao; |
| | | |
| | | |
| | | @Validated |
| | | @Override |
| | | public void addAwardMaterial(LuckyActivityAwardMaterial awardMaterial) throws LuckyActivityAwardMaterialException { |
| | | if (awardMaterial.getCreateTime() == null) { |
| | | awardMaterial.setCreateTime(new Date()); |
| | | } |
| | | luckyActivityAwardMaterialDao.save(awardMaterial); |
| | | } |
| | | |
| | | @Override |
| | | public void updateAwardMaterial(LuckyActivityAwardMaterial awardMaterial) throws LuckyActivityAwardMaterialException { |
| | | |
| | | if (awardMaterial == null || awardMaterial.getId() == null) { |
| | | throw new LuckyActivityAwardMaterialException(LuckyActivityAwardMaterialException.CODE_PARAMS_NOT_ENOUGH, "参数不完整"); |
| | | } |
| | | |
| | | LuckyActivityAwardMaterial old = luckyActivityAwardMaterialDao.get(awardMaterial.getId()); |
| | | if (old == null) { |
| | | throw new LuckyActivityAwardMaterialException(LuckyActivityAwardMaterialException.CODE_NOT_EXIST, "物料不存在"); |
| | | } |
| | | |
| | | luckyActivityAwardMaterialDao.updateSelective(awardMaterial); |
| | | } |
| | | |
| | | @Override |
| | | public LuckyActivityAwardMaterial getAwardMaterialDetail(String id) { |
| | | return luckyActivityAwardMaterialDao.get(id); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteAwardMaterial(String id) { |
| | | luckyActivityAwardMaterialDao.delete(id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ks.lucky.service.impl.remote; |
| | | |
| | | import com.ks.lucky.mapper.LuckyActivityAwardResultMapper; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityAwardResult; |
| | | import com.ks.lucky.query.ActivityAwardResultQuery; |
| | | import com.ks.lucky.remote.service.LuckyActivityAwardResultService; |
| | | import com.ks.lucky.service.impl.AppManager; |
| | | import org.apache.dubbo.config.annotation.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Service(version = "1.0") |
| | | public class LuckyActivityAwardResultServiceImpl implements LuckyActivityAwardResultService { |
| | | |
| | | @Resource |
| | | private LuckyActivityAwardResultMapper luckyActivityAwardResultMapper; |
| | | |
| | | @Resource |
| | | private AppManager appManager; |
| | | |
| | | |
| | | @Override |
| | | public LuckyActivityAwardResult getResult(String appKey, String uid, Long activityId, Long awardId) { |
| | | Long appId = appManager.getAppId(appKey); |
| | | if (appId == null) { |
| | | return null; |
| | | } |
| | | |
| | | ActivityAwardResultQuery query = new ActivityAwardResultQuery(); |
| | | query.appId = appId; |
| | | query.activityId = activityId; |
| | | query.uid = uid; |
| | | query.awardId = awardId; |
| | | |
| | | List<LuckyActivityAwardResult> list = luckyActivityAwardResultMapper.list(query); |
| | | if (list != null && list.size() > 0) { |
| | | return list.get(0); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public void recieveAward(String appKey, String uid, Long activityId) { |
| | | //TODO 领奖 |
| | | } |
| | | } |
New file |
| | |
| | | package com.ks.lucky.service.impl.remote; |
| | | |
| | | import com.ks.lucky.exception.LuckyActivityAwardException; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityAwards; |
| | | import com.ks.lucky.remote.service.LuckyActivityAwardService; |
| | | import com.ks.lucky.service.impl.LuckyActivityAwardManager; |
| | | import org.apache.dubbo.config.annotation.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Service(version = "1.0") |
| | | public class LuckyActivityAwardServiceImpl implements LuckyActivityAwardService { |
| | | |
| | | @Resource |
| | | private LuckyActivityAwardManager luckyActivityAwardManager; |
| | | |
| | | @Override |
| | | public void addAward(LuckyActivityAwards award) throws LuckyActivityAwardException { |
| | | luckyActivityAwardManager.addAward(award); |
| | | } |
| | | |
| | | @Override |
| | | public void updateAward(LuckyActivityAwards award) throws LuckyActivityAwardException { |
| | | luckyActivityAwardManager.updateAward(award); |
| | | } |
| | | |
| | | @Override |
| | | public List<LuckyActivityAwards> getAwardList(Long activityId) { |
| | | return luckyActivityAwardManager.getAwardList(activityId); |
| | | } |
| | | |
| | | @Override |
| | | public LuckyActivityAwards getAwardDetail(Long id) { |
| | | return luckyActivityAwardManager.getAwardDetail(id); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteAward(Long id) { |
| | | luckyActivityAwardManager.deleteAward(id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ks.lucky.service.impl.remote; |
| | | |
| | | import com.ks.lucky.exception.LuckyActivityJoinAssistException; |
| | | import com.ks.lucky.mapper.LuckyActivityJoinAssistMapper; |
| | | import com.ks.lucky.mapper.LuckyActivityJoinRecordMapper; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityJoinAssist; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityJoinRecord; |
| | | import com.ks.lucky.query.ActivityJoinAssistQuery; |
| | | import com.ks.lucky.remote.service.LuckyActivityJoinAssistService; |
| | | import com.ks.lucky.service.impl.AppManager; |
| | | import com.ks.lucky.service.impl.LuckyActivityJoinManager; |
| | | import org.apache.dubbo.config.annotation.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service(version = "1.0") |
| | | public class LuckyActivityJoinAssistServiceImpl implements LuckyActivityJoinAssistService { |
| | | |
| | | @Resource |
| | | private LuckyActivityJoinAssistMapper luckyActivityJoinAssistMapper; |
| | | |
| | | @Resource |
| | | private AppManager appManager; |
| | | |
| | | @Resource |
| | | private LuckyActivityJoinRecordMapper luckyActivityJoinRecordMapper; |
| | | |
| | | @Resource |
| | | private LuckyActivityJoinManager luckyActivityJoinManager; |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void assist(Long activityId, String appKey, String uid, String targetUid) throws LuckyActivityJoinAssistException { |
| | | Long appId = appManager.getAppId(appKey); |
| | | |
| | | |
| | | LuckyActivityJoinRecord record = luckyActivityJoinManager.getRecord(activityId, appId, uid); |
| | | |
| | | if (record == null) { |
| | | throw new LuckyActivityJoinAssistException(1, "助力对象尚未参加活动"); |
| | | } |
| | | |
| | | ActivityJoinAssistQuery query = new ActivityJoinAssistQuery(); |
| | | 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); |
| | | if (list != null && list.size() > 0) { |
| | | throw new LuckyActivityJoinAssistException(1, "已经助力过"); |
| | | } |
| | | |
| | | |
| | | LuckyActivityJoinAssist assist = new LuckyActivityJoinAssist(); |
| | | assist.setAppId(appId); |
| | | assist.setCreateTime(new Date()); |
| | | assist.setJoinId(record.getId()); |
| | | assist.setUid(uid); |
| | | assist.setWeight(1); |
| | | luckyActivityJoinAssistMapper.insertSelective(assist); |
| | | |
| | | luckyActivityJoinRecordMapper.addWeight(record.getId(), assist.getWeight()); |
| | | } |
| | | |
| | | @Override |
| | | public List<LuckyActivityJoinAssist> getAssistRecordList(Long activityId, String appKey, String uid, int page, int pageSize) { |
| | | Long appId = appManager.getAppId(appKey); |
| | | LuckyActivityJoinRecord record = luckyActivityJoinManager.getRecord(activityId, appId, uid); |
| | | if (record == null) { |
| | | return null; |
| | | } |
| | | |
| | | ActivityJoinAssistQuery query = new ActivityJoinAssistQuery(); |
| | | query.joinId = record.getId(); |
| | | query.appId = appId; |
| | | query.uid = uid; |
| | | query.start = (page - 1) * pageSize; |
| | | query.count = pageSize; |
| | | |
| | | return luckyActivityJoinAssistMapper.list(query); |
| | | } |
| | | |
| | | @Override |
| | | public long countAssistRecord(Long activityId, String appKey, String uid) { |
| | | Long appId = appManager.getAppId(appKey); |
| | | LuckyActivityJoinRecord record = luckyActivityJoinManager.getRecord(activityId, appId, uid); |
| | | if (record == null) { |
| | | return 0L; |
| | | } |
| | | |
| | | ActivityJoinAssistQuery query = new ActivityJoinAssistQuery(); |
| | | query.joinId = record.getId(); |
| | | query.appId = appId; |
| | | query.uid = uid; |
| | | |
| | | return luckyActivityJoinAssistMapper.count(query); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ks.lucky.service.impl.remote; |
| | | |
| | | import com.ks.lucky.exception.LuckyActivityException; |
| | | import com.ks.lucky.exception.LuckyActivityJoinException; |
| | | import com.ks.lucky.mapper.LuckyActivityJoinRecordMapper; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityJoinRecord; |
| | | import com.ks.lucky.pojo.DTO.JoinInfo; |
| | | import com.ks.lucky.remote.service.LuckyActivityJoinService; |
| | | import com.ks.lucky.service.impl.AppManager; |
| | | import com.ks.lucky.service.impl.LuckyActivityJoinManager; |
| | | import com.ks.lucky.service.impl.LuckyActivityManager; |
| | | import org.apache.dubbo.config.annotation.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | @Service(version = "1.0") |
| | | public class LuckyActivityJoinServiceImpl implements LuckyActivityJoinService { |
| | | |
| | | @Resource |
| | | private LuckyActivityJoinManager luckyActivityJoinManager; |
| | | |
| | | @Resource |
| | | private LuckyActivityManager luckyActivityManager; |
| | | |
| | | @Resource |
| | | private AppManager appManager; |
| | | |
| | | @Resource |
| | | private LuckyActivityJoinRecordMapper luckyActivityJoinRecordMapper; |
| | | |
| | | |
| | | @Override |
| | | public void join(Long activityId, String appKey, String uid, JoinInfo joinInfo) throws LuckyActivityException, LuckyActivityJoinException { |
| | | luckyActivityManager.canJoin(activityId); |
| | | Long appId = appManager.getAppId(appKey); |
| | | LuckyActivityJoinRecord record = luckyActivityJoinManager.getRecord(activityId, appId, uid); |
| | | if (record != null) { |
| | | throw new LuckyActivityJoinException(1, "已经参加"); |
| | | } |
| | | record = new LuckyActivityJoinRecord(); |
| | | record.setActivityId(activityId); |
| | | record.setAppId(appId); |
| | | record.setCreateTime(new Date()); |
| | | record.setJoinInfo(joinInfo.toString()); |
| | | record.setUid(uid); |
| | | record.setUserType(LuckyActivityJoinRecord.USER_TYPE_REAL); |
| | | record.setWeight(1); |
| | | record.setCreateTime(new Date()); |
| | | luckyActivityJoinRecordMapper.insertSelective(record); |
| | | luckyActivityManager.addJoinCount(activityId, record.getWeight()); |
| | | } |
| | | |
| | | @Override |
| | | public LuckyActivityJoinRecord getJoinInfo(Long activityId, String appKey, String uid) { |
| | | Long appId = appManager.getAppId(appKey); |
| | | LuckyActivityJoinRecord record = luckyActivityJoinManager.getRecord(activityId, appId, uid); |
| | | return record; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ks.lucky.service.impl.remote; |
| | | |
| | | import com.ks.lucky.exception.LuckyActivityOpenInfoException; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityOpenInfo; |
| | | import com.ks.lucky.remote.service.LuckyActivityOpenInfoService; |
| | | import org.apache.dubbo.config.annotation.Service; |
| | | |
| | | @Service(version = "1.0") |
| | | public class LuckyActivityOpenInfoServiceImpl implements LuckyActivityOpenInfoService { |
| | | @Override |
| | | public void addOpenInfo(LuckyActivityOpenInfo OpenInfo) throws LuckyActivityOpenInfoException { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void updateOpenInfo(LuckyActivityOpenInfo OpenInfo) throws LuckyActivityOpenInfoException { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public LuckyActivityOpenInfo getOpenInfo(Long activityId) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public LuckyActivityOpenInfo getOpenInfoDetail(Long id) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public void deleteOpenInfo(Long id) { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.ks.lucky.service.impl.remote; |
| | | |
| | | import com.ks.lucky.exception.LuckyActivityException; |
| | | import com.ks.lucky.pojo.DO.LuckyActivity; |
| | | import com.ks.lucky.remote.service.LuckyActivityOpenService; |
| | | import org.apache.dubbo.config.annotation.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service(version = "1.0") |
| | | public class LuckyActivityOpenServiceImpl implements LuckyActivityOpenService { |
| | | @Override |
| | | public List<LuckyActivity> listValidActivity(String appKey, int page, int pageSize) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public long countValidActivity(String appKey) { |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public void createActivity(LuckyActivity activity) throws LuckyActivityException { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public LuckyActivity getActivityDetail(Long id) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public void updateActivity(LuckyActivity activity) throws LuckyActivityException { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.ks.lucky.service.impl.remote; |
| | | |
| | | import com.ks.app.exception.AppException; |
| | | import com.ks.lucky.exception.LuckyActivityException; |
| | | import com.ks.lucky.exception.LuckyMQException; |
| | | import com.ks.lucky.mapper.LuckyActivityMapper; |
| | | import com.ks.lucky.pojo.DO.LuckyActivity; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityAwards; |
| | | import com.ks.lucky.pojo.DO.LuckyActivityOpenInfo; |
| | | import com.ks.lucky.pojo.DO.LuckyActivitySponsorInfo; |
| | | import com.ks.lucky.query.ActivityDaoQuery; |
| | | import com.ks.lucky.remote.service.LuckyActivityService; |
| | | import com.ks.lucky.service.LuckyMQService; |
| | | import com.ks.lucky.service.impl.AppManager; |
| | | import com.ks.lucky.service.impl.LuckyActivityAwardManager; |
| | | import com.ks.lucky.service.impl.LuckyActivityOpenInfoManager; |
| | | import com.ks.lucky.service.impl.LuckyActivitySponsorInfoManager; |
| | | import com.ks.lucky.util.mq.LuckyMQFactory; |
| | | import org.apache.dubbo.config.annotation.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.annotation.Validated; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service(version = "1.0") |
| | | public class LuckyActivityServiceImpl implements LuckyActivityService { |
| | | |
| | | @Resource |
| | | private LuckyActivityMapper luckyActivityMapper; |
| | | |
| | | @Resource |
| | | private LuckyActivityOpenInfoManager luckyActivityOpenInfoManager; |
| | | |
| | | @Resource |
| | | private LuckyActivitySponsorInfoManager luckyActivitySponsorInfoManager; |
| | | |
| | | @Resource |
| | | private LuckyActivityAwardManager luckyActivityAwardManager; |
| | | |
| | | @Resource |
| | | private AppManager appManager; |
| | | |
| | | @Resource |
| | | private LuckyMQService luckyMQService; |
| | | |
| | | private Long getAppId(String appKey) throws AppException { |
| | | return appManager.getAppId(appKey); |
| | | } |
| | | |
| | | @Override |
| | | public List<LuckyActivity> getActivityList(String appKey, Long sponsorId, List<Integer> stateList, String key, int page, int pageSize) { |
| | | ActivityDaoQuery query = new ActivityDaoQuery(); |
| | | query.stateList = stateList; |
| | | query.key = key; |
| | | query.sponsorId = sponsorId; |
| | | |
| | | try { |
| | | query.appId = getAppId(appKey); |
| | | } catch (AppException e) { |
| | | return null; |
| | | } |
| | | query.start = (page - 1) * pageSize; |
| | | query.count = pageSize; |
| | | query.sort = "start_time desc"; |
| | | return luckyActivityMapper.list(query); |
| | | } |
| | | |
| | | @Override |
| | | public long countActivity(String appKey, Long sponsorId, List<Integer> stateList, String key) { |
| | | ActivityDaoQuery query = new ActivityDaoQuery(); |
| | | query.stateList = stateList; |
| | | query.key = key; |
| | | query.sponsorId = sponsorId; |
| | | try { |
| | | query.appId = getAppId(appKey); |
| | | } catch (AppException e) { |
| | | return 0L; |
| | | } |
| | | return luckyActivityMapper.count(query); |
| | | } |
| | | |
| | | |
| | | @Validated |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void createActivity(LuckyActivity activity) throws LuckyActivityException { |
| | | |
| | | if (activity.getAwardsList() == null || activity.getAwardsList().size() == 0) { |
| | | throw new LuckyActivityException(LuckyActivityException.CODE_PARAMS_NOT_ENOUGH, "请设置奖项信息"); |
| | | } |
| | | |
| | | if (activity.getOpenInfo() == null) { |
| | | throw new LuckyActivityException(LuckyActivityException.CODE_PARAMS_NOT_ENOUGH, "请设置开奖信息"); |
| | | } |
| | | if (activity.getSponsorInfo() == null) { |
| | | throw new LuckyActivityException(LuckyActivityException.CODE_PARAMS_NOT_ENOUGH, "请设置赞助信息"); |
| | | } |
| | | |
| | | |
| | | // luckyActivityOpenInfoManager.addOpenInfo(activity.getOpenInfo()); |
| | | // |
| | | // |
| | | // luckyActivitySponsorInfoManager.addOpenInfo(); |
| | | |
| | | //TODO 添加其他信息 |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 检查要发布的活动 |
| | | * |
| | | * @param activity |
| | | */ |
| | | private void checkActivityForPublish(LuckyActivity activity) throws LuckyActivityException { |
| | | if (activity == null) { |
| | | throw new LuckyActivityException(LuckyActivityException.CODE_NOT_EXIST, "活动不存在"); |
| | | } |
| | | if (activity.getStartTime() == null) { |
| | | throw new LuckyActivityException(1, "活动开始时间未设置"); |
| | | } |
| | | |
| | | if (activity.getStartTime().getTime() < System.currentTimeMillis()) { |
| | | throw new LuckyActivityException(1, "活动开始时间不能小于当前时间"); |
| | | } |
| | | |
| | | if (activity.getFinishTime() != null && activity.getStartTime().getTime() >= activity.getFinishTime().getTime()) { |
| | | throw new LuckyActivityException(1, "活动开始结束时间不能小于开始时间"); |
| | | } |
| | | |
| | | //TODO 检查更多参数 |
| | | |
| | | |
| | | //检查活动状态 |
| | | if (activity.getState() != LuckyActivity.STATE_NOT_PUBLISH) { |
| | | throw new LuckyActivityException(1, "活动已发布"); |
| | | } |
| | | //检查开奖信息 |
| | | LuckyActivityOpenInfo openInfo = luckyActivityOpenInfoManager.getOpenInfo(activity.getId()); |
| | | if (openInfo == null) { |
| | | throw new LuckyActivityException(2, "不存在开奖信息"); |
| | | } |
| | | |
| | | LuckyActivitySponsorInfo sponsorInfo = luckyActivitySponsorInfoManager.getSponsorInfo(activity.getId()); |
| | | if (sponsorInfo == null) { |
| | | throw new LuckyActivityException(2, "不存在赞助信息"); |
| | | } |
| | | |
| | | List<LuckyActivityAwards> awardsList = luckyActivityAwardManager.getAwardList(activity.getId()); |
| | | if (awardsList == null || awardsList.size() == 0) { |
| | | throw new LuckyActivityException(2, "不存在奖项信息"); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void publishActivity(Long activityId) throws LuckyActivityException { |
| | | LuckyActivity activity = luckyActivityMapper.selectByPrimaryKeyForUpdate(activityId); |
| | | checkActivityForPublish(activity); |
| | | |
| | | LuckyActivity update = new LuckyActivity(); |
| | | update.setId(activityId); |
| | | update.setState(LuckyActivity.STATE_NOT_STARTED); |
| | | update.setStateRemarks("已发布"); |
| | | update.setUpdateTime(new Date()); |
| | | |
| | | //加入代发消息列表 |
| | | try { |
| | | luckyMQService.addMQ(LuckyMQFactory.createStartUpActivity(activity)); |
| | | } catch (LuckyMQException e) { |
| | | throw new LuckyActivityException(10, "消息投递失败"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void verifyActivity(Long activityId, boolean pass, String remarks) throws LuckyActivityException { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public LuckyActivity getActivityDetail(Long id) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public void updateActivity(LuckyActivity activity) throws LuckyActivityException { |
| | | |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ks.lucky.service.impl.remote; |
| | | |
| | | import com.ks.lucky.exception.LuckyActivitySponsorInfoException; |
| | | import com.ks.lucky.pojo.DO.LuckyActivitySponsorInfo; |
| | | import com.ks.lucky.remote.service.LuckyActivitySponsorInfoService; |
| | | import com.ks.lucky.service.impl.LuckyActivitySponsorInfoManager; |
| | | import org.apache.dubbo.config.annotation.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Service(version = "1.0") |
| | | public class LuckyActivitySponsorInfoServiceImpl implements LuckyActivitySponsorInfoService { |
| | | |
| | | @Resource |
| | | private LuckyActivitySponsorInfoManager luckyActivitySponsorInfoManager; |
| | | |
| | | |
| | | @Override |
| | | public void addSponsorInfo(LuckyActivitySponsorInfo sponsorInfo) throws LuckyActivitySponsorInfoException { |
| | | luckyActivitySponsorInfoManager.addSponsorInfo(sponsorInfo); |
| | | } |
| | | |
| | | @Override |
| | | public void updateSponsorInfo(LuckyActivitySponsorInfo sponsorInfo) throws LuckyActivitySponsorInfoException { |
| | | luckyActivitySponsorInfoManager.updateSponsorInfo(sponsorInfo); |
| | | } |
| | | |
| | | @Override |
| | | public LuckyActivitySponsorInfo getSponsorInfo(Long activityId) { |
| | | return luckyActivitySponsorInfoManager.getSponsorInfo(activityId); |
| | | } |
| | | |
| | | @Override |
| | | public LuckyActivitySponsorInfo getSponsorInfoDetail(Long id) { |
| | | return luckyActivitySponsorInfoManager.getSponsorInfoDetail(id); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteSponsorInfo(Long id) { |
| | | luckyActivitySponsorInfoManager.deleteSponsorInfo(id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ks.lucky.service.impl.remote; |
| | | |
| | | import com.ks.lucky.dao.LuckySponsorAdDao; |
| | | import com.ks.lucky.exception.LuckySponsorAdException; |
| | | import com.ks.lucky.pojo.DO.LuckySponsorAd; |
| | | import com.ks.lucky.query.LuckySponsorAdQuery; |
| | | import com.ks.lucky.remote.service.LuckySponsorAdService; |
| | | import com.ks.lucky.service.impl.LuckySponsorAdManager; |
| | | import org.apache.dubbo.config.annotation.Service; |
| | | import org.springframework.validation.annotation.Validated; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service(version = "1.0") |
| | | public class LuckySponsorAdServiceImpl implements LuckySponsorAdService { |
| | | |
| | | @Resource |
| | | private LuckySponsorAdManager luckySponsorAdManager; |
| | | |
| | | @Resource |
| | | private LuckySponsorAdDao luckySponsorAdDao; |
| | | |
| | | @Override |
| | | public List<LuckySponsorAd> getAdList(Long sponsorId, String key, LuckySponsorAd.SponsorAdType type, int page, int count) { |
| | | LuckySponsorAdQuery query = new LuckySponsorAdQuery(); |
| | | query.key = key; |
| | | query.sponsorId = sponsorId; |
| | | query.type = type; |
| | | query.start = (page - 1) * count; |
| | | query.count = count; |
| | | return luckySponsorAdDao.list(query); |
| | | } |
| | | |
| | | @Override |
| | | public long countAd(Long sponsorId, String key, LuckySponsorAd.SponsorAdType type) { |
| | | LuckySponsorAdQuery query = new LuckySponsorAdQuery(); |
| | | query.key = key; |
| | | query.sponsorId = sponsorId; |
| | | query.type = type; |
| | | return luckySponsorAdDao.count(query); |
| | | } |
| | | |
| | | @Override |
| | | public LuckySponsorAd getAdDetail(String id) { |
| | | |
| | | return luckySponsorAdDao.get(id); |
| | | } |
| | | |
| | | @Override |
| | | public void verifyAd(String id, boolean pass, String remarks) throws LuckySponsorAdException { |
| | | LuckySponsorAd ad = getAdDetail(id); |
| | | if (ad == null) { |
| | | throw new LuckySponsorAdException(LuckySponsorAdException.CODE_NOT_EXIST, "广告不存在"); |
| | | } |
| | | |
| | | if (ad.getState() != LuckySponsorAd.STATE_WAIT_VERIFY) { |
| | | throw new LuckySponsorAdException(1, "未处于审核状态"); |
| | | } |
| | | |
| | | LuckySponsorAd update = new LuckySponsorAd(); |
| | | update.setId(ad.getId()); |
| | | if (pass) { |
| | | update.setState(LuckySponsorAd.STATE_NORMAL); |
| | | update.setStateDesc("审核通过"); |
| | | } else { |
| | | update.setState(LuckySponsorAd.STATE_VERIFY_REJECT); |
| | | update.setStateDesc("审核拒绝"); |
| | | } |
| | | update.setUpdateTime(new Date()); |
| | | |
| | | luckySponsorAdDao.updateSelective(update); |
| | | } |
| | | |
| | | @Override |
| | | public List<LuckySponsorAd> getAdDetailList(List<String> idList) { |
| | | return luckySponsorAdDao.list(idList); |
| | | } |
| | | |
| | | @Validated |
| | | @Override |
| | | public void addSponsorAd(LuckySponsorAd ad) throws LuckySponsorAdException { |
| | | |
| | | ad.setId(ad.getSponsorId() + "-" + System.currentTimeMillis()); |
| | | if (ad.getCreateTime() == null) { |
| | | ad.setCreateTime(new Date()); |
| | | } |
| | | ad.setState(LuckySponsorAd.STATE_WAIT_VERIFY); |
| | | ad.setStateDesc("待审核"); |
| | | luckySponsorAdDao.save(ad); |
| | | } |
| | | |
| | | @Override |
| | | public void updateSponsorAd(LuckySponsorAd ad) throws LuckySponsorAdException { |
| | | |
| | | luckySponsorAdDao.updateSelective(ad); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(String id) { |
| | | luckySponsorAdDao.delete(id); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(List<String> idList) { |
| | | for (String id : idList) { |
| | | luckySponsorAdDao.delete(id); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.ks.lucky.service.impl.remote; |
| | | |
| | | import com.ks.lucky.exception.LuckySponsorException; |
| | | import com.ks.lucky.mapper.LuckySponsorsMapper; |
| | | import com.ks.lucky.pojo.DO.LuckySponsors; |
| | | import com.ks.lucky.query.LuckySponsorQuery; |
| | | import com.ks.lucky.remote.service.LuckySponsorService; |
| | | import org.apache.dubbo.config.annotation.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.annotation.Validated; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service(version = "1.0") |
| | | public class LuckySponsorServiceImpl implements LuckySponsorService { |
| | | |
| | | @Resource |
| | | private LuckySponsorsMapper luckySponsorsMapper; |
| | | |
| | | |
| | | @Override |
| | | public List<LuckySponsors> getSponsorList(String key, Integer state, int page, int count) { |
| | | LuckySponsorQuery query = new LuckySponsorQuery(); |
| | | query.key = key; |
| | | query.state = state; |
| | | query.start = (page - 1) * count; |
| | | query.count = count; |
| | | |
| | | return luckySponsorsMapper.list(query); |
| | | } |
| | | |
| | | @Override |
| | | public long countSponsor(String key, Integer state) { |
| | | LuckySponsorQuery query = new LuckySponsorQuery(); |
| | | query.key = key; |
| | | query.state = state; |
| | | return luckySponsorsMapper.count(query); |
| | | } |
| | | |
| | | @Override |
| | | public LuckySponsors getSponsorDetail(Long id) { |
| | | |
| | | return luckySponsorsMapper.selectByPrimaryKey(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<LuckySponsors> getSponsorDetailList(List<Long> idList) { |
| | | return luckySponsorsMapper.listDetail(idList); |
| | | } |
| | | |
| | | @Validated |
| | | @Override |
| | | public void addSponsor(LuckySponsors sponsor) throws LuckySponsorException { |
| | | LuckySponsorQuery query = new LuckySponsorQuery(); |
| | | query.account = sponsor.getAccount(); |
| | | List<LuckySponsors> list = luckySponsorsMapper.list(query); |
| | | if (list != null && list.size() > 0) { |
| | | throw new LuckySponsorException(LuckySponsorException.CODE_EXIST, "账号已经存在"); |
| | | } |
| | | |
| | | sponsor.setBalance(new BigDecimal(0)); |
| | | if (sponsor.getCreateTime() == null) { |
| | | sponsor.setCreateTime(new Date()); |
| | | } |
| | | |
| | | sponsor.setState(LuckySponsors.STATE_NORMAL); |
| | | luckySponsorsMapper.insertSelective(sponsor); |
| | | } |
| | | |
| | | @Override |
| | | public void updateSponsor(LuckySponsors sponsor) throws LuckySponsorException { |
| | | sponsor.setUpdateTime(new Date()); |
| | | luckySponsorsMapper.updateByPrimaryKeySelective(sponsor); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(Long id) { |
| | | luckySponsorsMapper.deleteByPrimaryKey(id); |
| | | } |
| | | |
| | | @Transactional |
| | | @Override |
| | | public void delete(List<Long> idList) { |
| | | for (Long id : idList) { |
| | | delete(id); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.ks.lucky.util.mq; |
| | | |
| | | public interface CMQConsumeRunner { |
| | | public void start(); |
| | | |
| | | public void destroy(); |
| | | } |
New file |
| | |
| | | package com.ks.lucky.util.mq; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.ks.lucky.pojo.DTO.ActivityMQMsg; |
| | | import com.qcloud.cmq.Message; |
| | | import org.yeshi.utils.CMQUtil; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public class CMQManager { |
| | | |
| | | |
| | | private static String secretId = "AKIDTlpgJhLjOozvd6QI2XnpfGbgV4NQJk25"; |
| | | private static String secretKey = "xhCSUHo55oHUQ6XicFcmfIgspX0EEzWo"; |
| | | private static CMQManager cmqManager; |
| | | private static CMQUtil cmqUtil; |
| | | public static String QUEUENAME_LUCKY_ACTIVITY = "lucky-activity"; |
| | | |
| | | static { |
| | | cmqUtil = CMQUtil.getInstance(secretId, secretKey); |
| | | // 最大消息为1M |
| | | cmqUtil.createQueue(QUEUENAME_LUCKY_ACTIVITY, 1024 * 1024); |
| | | } |
| | | |
| | | public static CMQManager getInstance() { |
| | | if (cmqManager == null) { |
| | | cmqManager = new CMQManager(); |
| | | } |
| | | return cmqManager; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加消息 |
| | | * |
| | | * @param queueName |
| | | * @param msg |
| | | */ |
| | | public void addMsg(String queueName, String msg) { |
| | | cmqUtil.sendMsg(queueName, msg); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加活动消息 |
| | | * |
| | | * @param msg |
| | | */ |
| | | public void addActivityMsg(ActivityMQMsg msg) { |
| | | cmqUtil.sendMsg(QUEUENAME_LUCKY_ACTIVITY, new Gson().toJson(msg)); |
| | | } |
| | | |
| | | /** |
| | | * 活动消息消费 |
| | | * |
| | | * @param count |
| | | * @return |
| | | */ |
| | | public Map<String, ActivityMQMsg> consumeActivityMsg(int count) { |
| | | List<Message> list = cmqUtil.recieveMsg(count, QUEUENAME_LUCKY_ACTIVITY); |
| | | if (list == null) { |
| | | return null; |
| | | } |
| | | |
| | | Map<String, ActivityMQMsg> map = new HashMap<>(); |
| | | Gson gson = new Gson(); |
| | | for (Message msg : list) { |
| | | String result = msg.msgBody; |
| | | map.put(msg.receiptHandle, gson.fromJson(result, ActivityMQMsg.class)); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 删除活动消息 |
| | | * |
| | | * @param receiptHandle |
| | | */ |
| | | public void deleteActivityMsg(String receiptHandle) { |
| | | cmqUtil.deleteMsg(QUEUENAME_LUCKY_ACTIVITY, receiptHandle); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ks.lucky.util.mq; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.ks.lucky.pojo.DO.LuckyActivity; |
| | | import com.ks.lucky.pojo.DO.LuckyMQ; |
| | | import com.ks.lucky.pojo.DTO.ActivityMQMsg; |
| | | |
| | | import java.util.Date; |
| | | |
| | | public class LuckyMQFactory { |
| | | |
| | | public static LuckyMQ createStartUpActivity(LuckyActivity activity) { |
| | | LuckyMQ mq = new LuckyMQ(); |
| | | mq.setState(LuckyMQ.STATE_NOT_SEND); |
| | | mq.setCreateTime(new Date()); |
| | | mq.setPreSendTime(activity.getStartTime()); |
| | | mq.setQueueContent(new Gson().toJson(new ActivityMQMsg(activity.getId(), ActivityMQMsg.TYPE_EXEC_START, new Date()))); |
| | | mq.setQueueName(CMQManager.QUEUENAME_LUCKY_ACTIVITY); |
| | | mq.setTaskId("start-activity-" + activity.getId()); |
| | | mq.setTaskName("启动活动"); |
| | | return mq; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ks.lucky.util.mq.consume; |
| | | |
| | | import com.ks.lucky.pojo.DTO.ActivityMQMsg; |
| | | import com.ks.lucky.util.mq.CMQConsumeRunner; |
| | | import com.ks.lucky.util.mq.CMQManager; |
| | | |
| | | import java.util.Iterator; |
| | | import java.util.Map; |
| | | |
| | | public class AcitivtyConsumer implements CMQConsumeRunner { |
| | | |
| | | |
| | | @Override |
| | | public void start() { |
| | | while (true) { |
| | | Map<String, ActivityMQMsg> map = CMQManager.getInstance().consumeActivityMsg(16); |
| | | if (map != null) { |
| | | for (Iterator<String> its = map.keySet().iterator(); its.hasNext(); ) { |
| | | String handler = its.next(); |
| | | ActivityMQMsg msg = map.get(handler); |
| | | if (msg != null) { |
| | | switch (msg.getType()) { |
| | | case ActivityMQMsg.TYPE_EXEC_START: |
| | | //启动活动 |
| | | break; |
| | | case ActivityMQMsg.TYPE_REACH_MIN_PERSON: |
| | | break; |
| | | |
| | | case ActivityMQMsg.TYPE_REACH_MAX_PERSON: |
| | | break; |
| | | |
| | | case ActivityMQMsg.TYPE_REACH_OPEN_TIME: |
| | | break; |
| | | |
| | | case ActivityMQMsg.TYPE_OPEN: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void destroy() { |
| | | |
| | | } |
| | | } |
| | |
| | | base-packages: com.ks.goldcorn.service.remote |
| | | provider: |
| | | timeout: 10000 |
| | | |
| | | xxl: |
| | | job: |
| | | accessToken: |
| | | executor: |
| | | appname: demo |
| | | ip: |
| | | logpath: /data/applogs/xxl-job/jobhandler |
| | | logretentiondays: -1 |
| | | port: 9999 |
| | | admin: |
| | | addresses: http://localhost:8081/xxl-job-admin |
| | |
| | | <!--enableDeleteByExample="false" enableSelectByExample="false"--> |
| | | <!--selectByExampleQueryId="false"></table>--> |
| | | |
| | | <!--<table schema="" domainObjectName="LuckySponsors" tableName="lucky_sponsors" 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> |
| | | |
| | | |
| | | </context> |
| | |
| | | create_time = #{createTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <resultMap id="BaseResultMap" type="com.ks.lucky.pojo.DO.LuckyActivityAwardResultExtra"> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="award_result_id" jdbcType="BIGINT" property="awardResultId" /> |
| | | <result column="name" jdbcType="VARCHAR" property="name" /> |
| | | <result column="phone" jdbcType="VARCHAR" property="phone" /> |
| | | <result column="address" jdbcType="VARCHAR" property="address" /> |
| | | <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | id, award_result_id, name, phone, address, create_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from lucky_activity_award_result_extra |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from lucky_activity_award_result_extra |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwardResultExtra"> |
| | | insert into lucky_activity_award_result_extra (id, award_result_id, name, |
| | | phone, address, create_time |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{awardResultId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, |
| | | #{phone,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwardResultExtra"> |
| | | insert into lucky_activity_award_result_extra |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="awardResultId != null"> |
| | | award_result_id, |
| | | </if> |
| | | <if test="name != null"> |
| | | name, |
| | | </if> |
| | | <if test="phone != null"> |
| | | phone, |
| | | </if> |
| | | <if test="address != null"> |
| | | address, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="awardResultId != null"> |
| | | #{awardResultId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="name != null"> |
| | | #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="phone != null"> |
| | | #{phone,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="address != null"> |
| | | #{address,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwardResultExtra"> |
| | | update lucky_activity_award_result_extra |
| | | <set> |
| | | <if test="awardResultId != null"> |
| | | award_result_id = #{awardResultId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="name != null"> |
| | | name = #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="phone != null"> |
| | | phone = #{phone,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="address != null"> |
| | | address = #{address,jdbcType=VARCHAR}, |
| | | </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.LuckyActivityAwardResultExtra"> |
| | | update lucky_activity_award_result_extra |
| | | set award_result_id = #{awardResultId,jdbcType=BIGINT}, |
| | | name = #{name,jdbcType=VARCHAR}, |
| | | phone = #{phone,jdbcType=VARCHAR}, |
| | | address = #{address,jdbcType=VARCHAR}, |
| | | create_time = #{createTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <resultMap id="BaseResultMap" type="com.ks.lucky.pojo.DO.LuckyActivityAwardResultExtra"> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="award_result_id" jdbcType="BIGINT" property="awardResultId" /> |
| | | <result column="name" jdbcType="VARCHAR" property="name" /> |
| | | <result column="phone" jdbcType="VARCHAR" property="phone" /> |
| | | <result column="address" jdbcType="VARCHAR" property="address" /> |
| | | <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | id, award_result_id, name, phone, address, create_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from lucky_activity_award_result_extra |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from lucky_activity_award_result_extra |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwardResultExtra"> |
| | | insert into lucky_activity_award_result_extra (id, award_result_id, name, |
| | | phone, address, create_time |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{awardResultId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, |
| | | #{phone,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwardResultExtra"> |
| | | insert into lucky_activity_award_result_extra |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="awardResultId != null"> |
| | | award_result_id, |
| | | </if> |
| | | <if test="name != null"> |
| | | name, |
| | | </if> |
| | | <if test="phone != null"> |
| | | phone, |
| | | </if> |
| | | <if test="address != null"> |
| | | address, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="awardResultId != null"> |
| | | #{awardResultId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="name != null"> |
| | | #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="phone != null"> |
| | | #{phone,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="address != null"> |
| | | #{address,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwardResultExtra"> |
| | | update lucky_activity_award_result_extra |
| | | <set> |
| | | <if test="awardResultId != null"> |
| | | award_result_id = #{awardResultId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="name != null"> |
| | | name = #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="phone != null"> |
| | | phone = #{phone,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="address != null"> |
| | | address = #{address,jdbcType=VARCHAR}, |
| | | </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.LuckyActivityAwardResultExtra"> |
| | | update lucky_activity_award_result_extra |
| | | set award_result_id = #{awardResultId,jdbcType=BIGINT}, |
| | | name = #{name,jdbcType=VARCHAR}, |
| | | phone = #{phone,jdbcType=VARCHAR}, |
| | | address = #{address,jdbcType=VARCHAR}, |
| | | create_time = #{createTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <resultMap id="BaseResultMap" type="com.ks.lucky.pojo.DO.LuckyActivityAwardResultExtra"> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="award_result_id" jdbcType="BIGINT" property="awardResultId" /> |
| | | <result column="name" jdbcType="VARCHAR" property="name" /> |
| | | <result column="phone" jdbcType="VARCHAR" property="phone" /> |
| | | <result column="address" jdbcType="VARCHAR" property="address" /> |
| | | <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | id, award_result_id, name, phone, address, create_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from lucky_activity_award_result_extra |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from lucky_activity_award_result_extra |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwardResultExtra"> |
| | | insert into lucky_activity_award_result_extra (id, award_result_id, name, |
| | | phone, address, create_time |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{awardResultId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, |
| | | #{phone,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwardResultExtra"> |
| | | insert into lucky_activity_award_result_extra |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="awardResultId != null"> |
| | | award_result_id, |
| | | </if> |
| | | <if test="name != null"> |
| | | name, |
| | | </if> |
| | | <if test="phone != null"> |
| | | phone, |
| | | </if> |
| | | <if test="address != null"> |
| | | address, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="awardResultId != null"> |
| | | #{awardResultId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="name != null"> |
| | | #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="phone != null"> |
| | | #{phone,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="address != null"> |
| | | #{address,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.ks.lucky.pojo.DO.LuckyActivityAwardResultExtra"> |
| | | update lucky_activity_award_result_extra |
| | | <set> |
| | | <if test="awardResultId != null"> |
| | | award_result_id = #{awardResultId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="name != null"> |
| | | name = #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="phone != null"> |
| | | phone = #{phone,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="address != null"> |
| | | address = #{address,jdbcType=VARCHAR}, |
| | | </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.LuckyActivityAwardResultExtra"> |
| | | update lucky_activity_award_result_extra |
| | | set award_result_id = #{awardResultId,jdbcType=BIGINT}, |
| | | name = #{name,jdbcType=VARCHAR}, |
| | | phone = #{phone,jdbcType=VARCHAR}, |
| | | address = #{address,jdbcType=VARCHAR}, |
| | | create_time = #{createTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <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"> |
| | | delete from lucky_activity_award_result |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" 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 |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{activityId,jdbcType=BIGINT}, #{appId,jdbcType=BIGINT}, |
| | | #{uid,jdbcType=VARCHAR}, #{awardId,jdbcType=BIGINT}, #{state,jdbcType=INTEGER}, |
| | | #{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"> |
| | | update lucky_activity_award_result |
| | | set activity_id = #{activityId,jdbcType=BIGINT}, |
| | | app_id = #{appId,jdbcType=BIGINT}, |
| | | uid = #{uid,jdbcType=VARCHAR}, |
| | | award_id = #{awardId,jdbcType=BIGINT}, |
| | | state = #{state,jdbcType=INTEGER}, |
| | | state_desc = #{stateDesc,jdbcType=VARCHAR}, |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <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"> |
| | | delete from lucky_activity_award_result |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" 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 |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{activityId,jdbcType=BIGINT}, #{appId,jdbcType=BIGINT}, |
| | | #{uid,jdbcType=VARCHAR}, #{awardId,jdbcType=BIGINT}, #{state,jdbcType=INTEGER}, |
| | | #{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"> |
| | | update lucky_activity_award_result |
| | | set activity_id = #{activityId,jdbcType=BIGINT}, |
| | | app_id = #{appId,jdbcType=BIGINT}, |
| | | uid = #{uid,jdbcType=VARCHAR}, |
| | | award_id = #{awardId,jdbcType=BIGINT}, |
| | | state = #{state,jdbcType=INTEGER}, |
| | | state_desc = #{stateDesc,jdbcType=VARCHAR}, |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <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"> |
| | | delete from lucky_activity_award_result |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" 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 |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{activityId,jdbcType=BIGINT}, #{appId,jdbcType=BIGINT}, |
| | | #{uid,jdbcType=VARCHAR}, #{awardId,jdbcType=BIGINT}, #{state,jdbcType=INTEGER}, |
| | | #{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"> |
| | | update lucky_activity_award_result |
| | | set activity_id = #{activityId,jdbcType=BIGINT}, |
| | | app_id = #{appId,jdbcType=BIGINT}, |
| | | uid = #{uid,jdbcType=VARCHAR}, |
| | | award_id = #{awardId,jdbcType=BIGINT}, |
| | | state = #{state,jdbcType=INTEGER}, |
| | | state_desc = #{stateDesc,jdbcType=VARCHAR}, |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <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"> |
| | | delete from lucky_activity_awards |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" 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, |
| | | update_time) |
| | | values (#{id,jdbcType=BIGINT}, #{activityId,jdbcType=BIGINT}, #{level,jdbcType=INTEGER}, |
| | | #{count,jdbcType=INTEGER}, #{awardWay,jdbcType=INTEGER}, #{awardParams,jdbcType=VARCHAR}, |
| | | #{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"> |
| | | update lucky_activity_awards |
| | | set activity_id = #{activityId,jdbcType=BIGINT}, |
| | | level = #{level,jdbcType=INTEGER}, |
| | | count = #{count,jdbcType=INTEGER}, |
| | | award_way = #{awardWay,jdbcType=INTEGER}, |
| | | award_params = #{awardParams,jdbcType=VARCHAR}, |
| | | material_id = #{materialId,jdbcType=VARCHAR}, |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <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"> |
| | | delete from lucky_activity_awards |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" 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, |
| | | update_time) |
| | | values (#{id,jdbcType=BIGINT}, #{activityId,jdbcType=BIGINT}, #{level,jdbcType=INTEGER}, |
| | | #{count,jdbcType=INTEGER}, #{awardWay,jdbcType=INTEGER}, #{awardParams,jdbcType=VARCHAR}, |
| | | #{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"> |
| | | update lucky_activity_awards |
| | | set activity_id = #{activityId,jdbcType=BIGINT}, |
| | | level = #{level,jdbcType=INTEGER}, |
| | | count = #{count,jdbcType=INTEGER}, |
| | | award_way = #{awardWay,jdbcType=INTEGER}, |
| | | award_params = #{awardParams,jdbcType=VARCHAR}, |
| | | material_id = #{materialId,jdbcType=VARCHAR}, |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <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"> |
| | | delete from lucky_activity_awards |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" 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, |
| | | update_time) |
| | | values (#{id,jdbcType=BIGINT}, #{activityId,jdbcType=BIGINT}, #{level,jdbcType=INTEGER}, |
| | | #{count,jdbcType=INTEGER}, #{awardWay,jdbcType=INTEGER}, #{awardParams,jdbcType=VARCHAR}, |
| | | #{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"> |
| | | update lucky_activity_awards |
| | | set activity_id = #{activityId,jdbcType=BIGINT}, |
| | | level = #{level,jdbcType=INTEGER}, |
| | | count = #{count,jdbcType=INTEGER}, |
| | | award_way = #{awardWay,jdbcType=INTEGER}, |
| | | award_params = #{awardParams,jdbcType=VARCHAR}, |
| | | material_id = #{materialId,jdbcType=VARCHAR}, |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <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"> |
| | | delete from lucky_activity_join_assist |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.ks.lucky.pojo.DO.LuckyActivityJoinAssist"> |
| | | insert into lucky_activity_join_assist (id, join_id, app_id, |
| | | uid, weight, create_time, |
| | | update_time) |
| | | values (#{id,jdbcType=BIGINT}, #{joinId,jdbcType=BIGINT}, #{appId,jdbcType=BIGINT}, |
| | | #{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"> |
| | | update lucky_activity_join_assist |
| | | set join_id = #{joinId,jdbcType=BIGINT}, |
| | | app_id = #{appId,jdbcType=BIGINT}, |
| | | uid = #{uid,jdbcType=VARCHAR}, |
| | | weight = #{weight,jdbcType=INTEGER}, |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <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"> |
| | | delete from lucky_activity_join_assist |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.ks.lucky.pojo.DO.LuckyActivityJoinAssist"> |
| | | insert into lucky_activity_join_assist (id, join_id, app_id, |
| | | uid, weight, create_time, |
| | | update_time) |
| | | values (#{id,jdbcType=BIGINT}, #{joinId,jdbcType=BIGINT}, #{appId,jdbcType=BIGINT}, |
| | | #{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"> |
| | | update lucky_activity_join_assist |
| | | set join_id = #{joinId,jdbcType=BIGINT}, |
| | | app_id = #{appId,jdbcType=BIGINT}, |
| | | uid = #{uid,jdbcType=VARCHAR}, |
| | | weight = #{weight,jdbcType=INTEGER}, |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <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"> |
| | | delete from lucky_activity_join_assist |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.ks.lucky.pojo.DO.LuckyActivityJoinAssist"> |
| | | insert into lucky_activity_join_assist (id, join_id, app_id, |
| | | uid, weight, create_time, |
| | | update_time) |
| | | values (#{id,jdbcType=BIGINT}, #{joinId,jdbcType=BIGINT}, #{appId,jdbcType=BIGINT}, |
| | | #{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"> |
| | | update lucky_activity_join_assist |
| | | set join_id = #{joinId,jdbcType=BIGINT}, |
| | | app_id = #{appId,jdbcType=BIGINT}, |
| | | uid = #{uid,jdbcType=VARCHAR}, |
| | | weight = #{weight,jdbcType=INTEGER}, |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | create_time = #{createTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <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"> |
| | | delete from lucky_activity_join_record |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" 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) |
| | | values (#{id,jdbcType=BIGINT}, #{activityId,jdbcType=BIGINT}, #{appId,jdbcType=BIGINT}, |
| | | #{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"> |
| | | update lucky_activity_join_record |
| | | set activity_id = #{activityId,jdbcType=BIGINT}, |
| | | app_id = #{appId,jdbcType=BIGINT}, |
| | | uid = #{uid,jdbcType=VARCHAR}, |
| | | join_info = #{joinInfo,jdbcType=VARCHAR}, |
| | | user_type = #{userType,jdbcType=INTEGER}, |
| | | weight = #{weight,jdbcType=INTEGER}, |
| | | create_time = #{createTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <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"> |
| | | delete from lucky_activity_join_record |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" 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) |
| | | values (#{id,jdbcType=BIGINT}, #{activityId,jdbcType=BIGINT}, #{appId,jdbcType=BIGINT}, |
| | | #{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"> |
| | | update lucky_activity_join_record |
| | | set activity_id = #{activityId,jdbcType=BIGINT}, |
| | | app_id = #{appId,jdbcType=BIGINT}, |
| | | uid = #{uid,jdbcType=VARCHAR}, |
| | | join_info = #{joinInfo,jdbcType=VARCHAR}, |
| | | user_type = #{userType,jdbcType=INTEGER}, |
| | | weight = #{weight,jdbcType=INTEGER}, |
| | | create_time = #{createTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <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"> |
| | | delete from lucky_activity_join_record |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" 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) |
| | | values (#{id,jdbcType=BIGINT}, #{activityId,jdbcType=BIGINT}, #{appId,jdbcType=BIGINT}, |
| | | #{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"> |
| | | update lucky_activity_join_record |
| | | set activity_id = #{activityId,jdbcType=BIGINT}, |
| | | app_id = #{appId,jdbcType=BIGINT}, |
| | | uid = #{uid,jdbcType=VARCHAR}, |
| | | join_info = #{joinInfo,jdbcType=VARCHAR}, |
| | | user_type = #{userType,jdbcType=INTEGER}, |
| | | weight = #{weight,jdbcType=INTEGER}, |
| | | create_time = #{createTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | <result column="state_remarks" jdbcType="VARCHAR" property="stateRemarks"/> |
| | | <result column="start_time" jdbcType="TIMESTAMP" property="startTime"/> |
| | | <result column="finish_time" jdbcType="TIMESTAMP" property="finishTime"/> |
| | | <result column="open_time" jdbcType="TIMESTAMP" property="openTime"/> |
| | | <result column="pre_open_time" jdbcType="TIMESTAMP" property="preOpenTime"/> |
| | | <result column="actual_open_time" jdbcType="TIMESTAMP" property="actualOpenTime"/> |
| | | <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> |
| | | <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, |
| | | max_person_count,current_person_count, state, state_remarks, start_time, finish_time, open_time, create_time, |
| | | max_person_count,current_person_count, state, state_remarks, start_time, finish_time, pre_open_time,actual_open_time, create_time, |
| | | update_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | |
| | | name, material_poster, material_tag_image, |
| | | material_, desc, max_person_count, current_person_count, |
| | | state, state_remarks, start_time, |
| | | finish_time, open_time, create_time, |
| | | finish_time, pre_open_time, actual_open_time,create_time, |
| | | update_time) |
| | | values (#{id,jdbcType=BIGINT}, #{appId,jdbcType=BIGINT}, #{sponsorId,jdbcType=BIGINT}, |
| | | #{name,jdbcType=VARCHAR}, #{materialPoster,jdbcType=VARCHAR}, #{materialTagImage,jdbcType=VARCHAR}, |
| | | #{material,jdbcType=VARCHAR}, #{desc,jdbcType=VARCHAR}, #{maxPersonCount,jdbcType=INTEGER}, #{currentPersonCount,jdbcType=INTEGER}, |
| | | #{state,jdbcType=INTEGER}, #{stateRemarks,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP}, |
| | | #{finishTime,jdbcType=TIMESTAMP}, #{openTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, |
| | | #{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"> |
| | |
| | | <if test="finishTime != null"> |
| | | finish_time, |
| | | </if> |
| | | <if test="openTime != null"> |
| | | open_time, |
| | | <if test="preOpenTime != null"> |
| | | pre_open_time, |
| | | </if> |
| | | |
| | | <if test="actualOpenTime != null"> |
| | | actual_open_time, |
| | | </if> |
| | | |
| | | |
| | | <if test="createTime != null"> |
| | | create_time, |
| | | </if> |
| | |
| | | <if test="finishTime != null"> |
| | | #{finishTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="openTime != null"> |
| | | #{openTime,jdbcType=TIMESTAMP}, |
| | | <if test="preOpenTime != null"> |
| | | #{preOpenTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="actualOpenTime != null"> |
| | | #{actualOpenTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | #{createTime,jdbcType=TIMESTAMP}, |
| | |
| | | <if test="finishTime != null"> |
| | | finish_time = #{finishTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="openTime != null"> |
| | | open_time = #{openTime,jdbcType=TIMESTAMP}, |
| | | <if test="preOpenTime != null"> |
| | | pre_open_time = #{preOpenTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | |
| | | <if test="actualOpenTime != null"> |
| | | actual_open_time = #{actualOpenTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | |
| | | state_remarks = #{stateRemarks,jdbcType=VARCHAR}, |
| | | start_time = #{startTime,jdbcType=TIMESTAMP}, |
| | | finish_time = #{finishTime,jdbcType=TIMESTAMP}, |
| | | open_time = #{openTime,jdbcType=TIMESTAMP}, |
| | | pre_open_time = #{preOpenTime,jdbcType=TIMESTAMP}, |
| | | actual_open_time = #{actualOpenTime,jdbcType=TIMESTAMP}, |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | |
| | | limit #{query.start},#{query.count} |
| | | </select> |
| | | |
| | | <select id="list" resultType="java.lang.Long"> |
| | | <select id="count" resultType="java.lang.Long"> |
| | | select |
| | | count(*) |
| | | from lucky_activity |
| | |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <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"> |
| | | delete from lucky_activity_sponsor_info |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" 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 |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{activityId,jdbcType=BIGINT}, #{sponsorId,jdbcType=BIGINT}, |
| | | #{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"> |
| | | update lucky_activity_sponsor_info |
| | | set activity_id = #{activityId,jdbcType=BIGINT}, |
| | | sponsor_id = #{sponsorId,jdbcType=BIGINT}, |
| | | sponsor_ad_id = #{sponsorAdId,jdbcType=VARCHAR}, |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
New file |
| | |
| | | <?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" > |
| | | 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" > |
| | | delete from lucky_mq |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" 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, |
| | | update_time) |
| | | values (#{id,jdbcType=BIGINT}, #{taskId,jdbcType=VARCHAR}, #{taskName,jdbcType=VARCHAR}, |
| | | #{state,jdbcType=INTEGER}, #{queueName,jdbcType=VARCHAR}, #{queueContent,jdbcType=VARCHAR}, |
| | | #{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" > |
| | | update lucky_mq |
| | | set task_id = #{taskId,jdbcType=VARCHAR}, |
| | | task_name = #{taskName,jdbcType=VARCHAR}, |
| | | state = #{state,jdbcType=INTEGER}, |
| | | queue_name = #{queueName,jdbcType=VARCHAR}, |
| | | queue_content = #{queueContent,jdbcType=VARCHAR}, |
| | | pre_send_time = #{preSendTime,jdbcType=TIMESTAMP}, |
| | | actual_send_time = #{actualSendTime,jdbcType=TIMESTAMP}, |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <resultMap id="BaseResultMap" type="com.ks.lucky.pojo.DO.LuckySponsors"> |
| | | <id column="id" jdbcType="BIGINT" property="id"/> |
| | | <result column="name" jdbcType="VARCHAR" property="name"/> |
| | | <result column="mobile" jdbcType="VARCHAR" property="mobile"/> |
| | | <result column="state" jdbcType="INTEGER" property="state"/> |
| | | <result column="state_remarks" jdbcType="VARCHAR" property="stateRemarks"/> |
| | | <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> |
| | | <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | id, name, mobile, state, state_remarks, create_time, update_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from lucky_sponsors |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </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 into lucky_sponsors (id, name, mobile, |
| | | state, state_remarks, create_time, |
| | | update_time) |
| | | values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, |
| | | #{state,jdbcType=INTEGER}, #{stateRemarks,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, |
| | | #{updateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.ks.lucky.pojo.DO.LuckySponsors"> |
| | | insert into lucky_sponsors |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="name != null"> |
| | | name, |
| | | </if> |
| | | <if test="mobile != null"> |
| | | mobile, |
| | | </if> |
| | | <if test="state != null"> |
| | | state, |
| | | </if> |
| | | <if test="stateRemarks != null"> |
| | | state_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="name != null"> |
| | | #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="mobile != null"> |
| | | #{mobile,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="state != null"> |
| | | #{state,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="stateRemarks != null"> |
| | | #{stateRemarks,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.LuckySponsors"> |
| | | update lucky_sponsors |
| | | <set> |
| | | <if test="name != null"> |
| | | name = #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="mobile != null"> |
| | | mobile = #{mobile,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="state != null"> |
| | | state = #{state,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="stateRemarks != null"> |
| | | state_remarks = #{stateRemarks,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.LuckySponsors"> |
| | | update lucky_sponsors |
| | | set name = #{name,jdbcType=VARCHAR}, |
| | | mobile = #{mobile,jdbcType=VARCHAR}, |
| | | state = #{state,jdbcType=INTEGER}, |
| | | state_remarks = #{stateRemarks,jdbcType=VARCHAR}, |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <resultMap id="BaseResultMap" type="com.ks.lucky.pojo.DO.LuckySponsors"> |
| | | <id column="id" jdbcType="BIGINT" property="id"/> |
| | | <result column="name" jdbcType="VARCHAR" property="name"/> |
| | | <result column="mobile" jdbcType="VARCHAR" property="mobile"/> |
| | | <result column="state" jdbcType="INTEGER" property="state"/> |
| | | <result column="state_remarks" jdbcType="VARCHAR" property="stateRemarks"/> |
| | | <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> |
| | | <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | id, name, mobile, state, state_remarks, create_time, update_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from lucky_sponsors |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </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 into lucky_sponsors (id, name, mobile, |
| | | state, state_remarks, create_time, |
| | | update_time) |
| | | values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, |
| | | #{state,jdbcType=INTEGER}, #{stateRemarks,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, |
| | | #{updateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.ks.lucky.pojo.DO.LuckySponsors"> |
| | | insert into lucky_sponsors |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="name != null"> |
| | | name, |
| | | </if> |
| | | <if test="mobile != null"> |
| | | mobile, |
| | | </if> |
| | | <if test="state != null"> |
| | | state, |
| | | </if> |
| | | <if test="stateRemarks != null"> |
| | | state_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="name != null"> |
| | | #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="mobile != null"> |
| | | #{mobile,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="state != null"> |
| | | #{state,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="stateRemarks != null"> |
| | | #{stateRemarks,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.LuckySponsors"> |
| | | update lucky_sponsors |
| | | <set> |
| | | <if test="name != null"> |
| | | name = #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="mobile != null"> |
| | | mobile = #{mobile,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="state != null"> |
| | | state = #{state,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="stateRemarks != null"> |
| | | state_remarks = #{stateRemarks,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.LuckySponsors"> |
| | | update lucky_sponsors |
| | | set name = #{name,jdbcType=VARCHAR}, |
| | | mobile = #{mobile,jdbcType=VARCHAR}, |
| | | state = #{state,jdbcType=INTEGER}, |
| | | state_remarks = #{stateRemarks,jdbcType=VARCHAR}, |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | update_time = #{updateTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |