Commit 8e28687e authored by shiyu's avatar shiyu

签到任务

parent 596d98e0
...@@ -10,7 +10,7 @@ import lombok.Data; ...@@ -10,7 +10,7 @@ import lombok.Data;
/** /**
* @author shiyu * @author shiyu
* @date 2024/12/19 * @date 2024/12/23
*/ */
@Data @Data
public class SignInTask implements Entity { public class SignInTask implements Entity {
...@@ -86,6 +86,11 @@ public class SignInTask implements Entity { ...@@ -86,6 +86,11 @@ public class SignInTask implements Entity {
*/ */
private Boolean isPrivate; private Boolean isPrivate;
/**
* 是否有奖励
*/
private Boolean hasReward;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Override @Override
...@@ -109,6 +114,7 @@ public class SignInTask implements Entity { ...@@ -109,6 +114,7 @@ public class SignInTask implements Entity {
sb.append(", createTime=").append(createTime); sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime); sb.append(", updateTime=").append(updateTime);
sb.append(", isPrivate=").append(isPrivate); sb.append(", isPrivate=").append(isPrivate);
sb.append(", hasReward=").append(hasReward);
sb.append(", serialVersionUID=").append(serialVersionUID); sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]"); sb.append("]");
return sb.toString(); return sb.toString();
...@@ -140,7 +146,8 @@ public class SignInTask implements Entity { ...@@ -140,7 +146,8 @@ public class SignInTask implements Entity {
&& (this.getCreatorId() == null ? other.getCreatorId() == null : this.getCreatorId().equals(other.getCreatorId())) && (this.getCreatorId() == null ? other.getCreatorId() == null : this.getCreatorId().equals(other.getCreatorId()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getIsPrivate() == null ? other.getIsPrivate() == null : this.getIsPrivate().equals(other.getIsPrivate())); && (this.getIsPrivate() == null ? other.getIsPrivate() == null : this.getIsPrivate().equals(other.getIsPrivate()))
&& (this.getHasReward() == null ? other.getHasReward() == null : this.getHasReward().equals(other.getHasReward()));
} }
@Override @Override
...@@ -162,6 +169,7 @@ public class SignInTask implements Entity { ...@@ -162,6 +169,7 @@ public class SignInTask implements Entity {
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getIsPrivate() == null) ? 0 : getIsPrivate().hashCode()); result = prime * result + ((getIsPrivate() == null) ? 0 : getIsPrivate().hashCode());
result = prime * result + ((getHasReward() == null) ? 0 : getHasReward().hashCode());
return result; return result;
} }
...@@ -187,7 +195,8 @@ public class SignInTask implements Entity { ...@@ -187,7 +195,8 @@ public class SignInTask implements Entity {
creatorId("creator_id", "creatorId", "BIGINT", false), creatorId("creator_id", "creatorId", "BIGINT", false),
createTime("create_time", "createTime", "TIMESTAMP", false), createTime("create_time", "createTime", "TIMESTAMP", false),
updateTime("update_time", "updateTime", "TIMESTAMP", false), updateTime("update_time", "updateTime", "TIMESTAMP", false),
isPrivate("is_private", "isPrivate", "BIT", false); isPrivate("is_private", "isPrivate", "BIT", false),
hasReward("has_reward", "hasReward", "BIT", false);
/** /**
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
......
...@@ -2157,6 +2157,138 @@ public class SignInTaskExample { ...@@ -2157,6 +2157,138 @@ public class SignInTaskExample {
addCriterion("is_private not between", value1, value2, "isPrivate"); addCriterion("is_private not between", value1, value2, "isPrivate");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andHasRewardIsNull() {
addCriterion("has_reward is null");
return (Criteria) this;
}
public Criteria andHasRewardIsNotNull() {
addCriterion("has_reward is not null");
return (Criteria) this;
}
public Criteria andHasRewardEqualTo(Boolean value) {
addCriterion("has_reward =", value, "hasReward");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sign_in_task
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andHasRewardEqualToColumn(SignInTask.Column column) {
addCriterion(new StringBuilder("has_reward = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andHasRewardNotEqualTo(Boolean value) {
addCriterion("has_reward <>", value, "hasReward");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sign_in_task
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andHasRewardNotEqualToColumn(SignInTask.Column column) {
addCriterion(new StringBuilder("has_reward <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andHasRewardGreaterThan(Boolean value) {
addCriterion("has_reward >", value, "hasReward");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sign_in_task
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andHasRewardGreaterThanColumn(SignInTask.Column column) {
addCriterion(new StringBuilder("has_reward > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andHasRewardGreaterThanOrEqualTo(Boolean value) {
addCriterion("has_reward >=", value, "hasReward");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sign_in_task
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andHasRewardGreaterThanOrEqualToColumn(SignInTask.Column column) {
addCriterion(new StringBuilder("has_reward >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andHasRewardLessThan(Boolean value) {
addCriterion("has_reward <", value, "hasReward");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sign_in_task
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andHasRewardLessThanColumn(SignInTask.Column column) {
addCriterion(new StringBuilder("has_reward < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andHasRewardLessThanOrEqualTo(Boolean value) {
addCriterion("has_reward <=", value, "hasReward");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sign_in_task
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andHasRewardLessThanOrEqualToColumn(SignInTask.Column column) {
addCriterion(new StringBuilder("has_reward <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andHasRewardIn(List<Boolean> values) {
addCriterion("has_reward in", values, "hasReward");
return (Criteria) this;
}
public Criteria andHasRewardNotIn(List<Boolean> values) {
addCriterion("has_reward not in", values, "hasReward");
return (Criteria) this;
}
public Criteria andHasRewardBetween(Boolean value1, Boolean value2) {
addCriterion("has_reward between", value1, value2, "hasReward");
return (Criteria) this;
}
public Criteria andHasRewardNotBetween(Boolean value1, Boolean value2) {
addCriterion("has_reward not between", value1, value2, "hasReward");
return (Criteria) this;
}
} }
public static class Criteria extends GeneratedCriteria { public static class Criteria extends GeneratedCriteria {
......
...@@ -7,6 +7,7 @@ import java.util.List; ...@@ -7,6 +7,7 @@ import java.util.List;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@Mapper @Mapper
public interface SignInTaskMapper { public interface SignInTaskMapper {
long countByExample(SignInTaskExample example); long countByExample(SignInTaskExample example);
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_private" jdbcType="BIT" property="isPrivate" /> <result column="is_private" jdbcType="BIT" property="isPrivate" />
<result column="has_reward" jdbcType="BIT" property="hasReward" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
...@@ -78,7 +79,8 @@ ...@@ -78,7 +79,8 @@
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, `name`, image, start_valid_time, end_valid_time, sign_in_start_time, sign_in_end_time, id, `name`, image, start_valid_time, end_valid_time, sign_in_start_time, sign_in_end_time,
goal_days, `type`, `state`, `desc`, creator_id, create_time, update_time, is_private goal_days, `type`, `state`, `desc`, creator_id, create_time, update_time, is_private,
has_reward
</sql> </sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.qiandao.SignInTaskExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.wwdz.ch.db.domain.qiandao.SignInTaskExample" resultMap="BaseResultMap">
select select
...@@ -114,8 +116,8 @@ ...@@ -114,8 +116,8 @@
</when> </when>
<otherwise> <otherwise>
id, `name`, image, start_valid_time, end_valid_time, sign_in_start_time, sign_in_end_time, id, `name`, image, start_valid_time, end_valid_time, sign_in_start_time, sign_in_end_time,
goal_days, `type`, `state`, `desc`, creator_id, create_time, update_time, is_private goal_days, `type`, `state`, `desc`, creator_id, create_time, update_time, is_private,
has_reward
</otherwise> </otherwise>
</choose> </choose>
from sign_in_task from sign_in_task
...@@ -147,8 +149,8 @@ ...@@ -147,8 +149,8 @@
</when> </when>
<otherwise> <otherwise>
id, `name`, image, start_valid_time, end_valid_time, sign_in_start_time, sign_in_end_time, id, `name`, image, start_valid_time, end_valid_time, sign_in_start_time, sign_in_end_time,
goal_days, `type`, `state`, `desc`, creator_id, create_time, update_time, is_private goal_days, `type`, `state`, `desc`, creator_id, create_time, update_time, is_private,
has_reward
</otherwise> </otherwise>
</choose> </choose>
from sign_in_task from sign_in_task
...@@ -172,12 +174,14 @@ ...@@ -172,12 +174,14 @@
end_valid_time, sign_in_start_time, sign_in_end_time, end_valid_time, sign_in_start_time, sign_in_end_time,
goal_days, `type`, `state`, goal_days, `type`, `state`,
`desc`, creator_id, create_time, `desc`, creator_id, create_time,
update_time, is_private) update_time, is_private, has_reward
)
values (#{name,jdbcType=VARCHAR}, #{image,jdbcType=VARCHAR}, #{startValidTime,jdbcType=TIMESTAMP}, values (#{name,jdbcType=VARCHAR}, #{image,jdbcType=VARCHAR}, #{startValidTime,jdbcType=TIMESTAMP},
#{endValidTime,jdbcType=TIMESTAMP}, #{signInStartTime,jdbcType=TIMESTAMP}, #{signInEndTime,jdbcType=TIMESTAMP}, #{endValidTime,jdbcType=TIMESTAMP}, #{signInStartTime,jdbcType=TIMESTAMP}, #{signInEndTime,jdbcType=TIMESTAMP},
#{goalDays,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{state,jdbcType=INTEGER}, #{goalDays,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{state,jdbcType=INTEGER},
#{desc,jdbcType=VARCHAR}, #{creatorId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{desc,jdbcType=VARCHAR}, #{creatorId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{isPrivate,jdbcType=BIT}) #{updateTime,jdbcType=TIMESTAMP}, #{isPrivate,jdbcType=BIT}, #{hasReward,jdbcType=BIT}
)
</insert> </insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.qiandao.SignInTask"> <insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.qiandao.SignInTask">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
...@@ -227,6 +231,9 @@ ...@@ -227,6 +231,9 @@
<if test="isPrivate != null"> <if test="isPrivate != null">
is_private, is_private,
</if> </if>
<if test="hasReward != null">
has_reward,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null"> <if test="name != null">
...@@ -271,6 +278,9 @@ ...@@ -271,6 +278,9 @@
<if test="isPrivate != null"> <if test="isPrivate != null">
#{isPrivate,jdbcType=BIT}, #{isPrivate,jdbcType=BIT},
</if> </if>
<if test="hasReward != null">
#{hasReward,jdbcType=BIT},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.wwdz.ch.db.domain.qiandao.SignInTaskExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.wwdz.ch.db.domain.qiandao.SignInTaskExample" resultType="java.lang.Long">
...@@ -327,6 +337,9 @@ ...@@ -327,6 +337,9 @@
<if test="record.isPrivate != null"> <if test="record.isPrivate != null">
is_private = #{record.isPrivate,jdbcType=BIT}, is_private = #{record.isPrivate,jdbcType=BIT},
</if> </if>
<if test="record.hasReward != null">
has_reward = #{record.hasReward,jdbcType=BIT},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
...@@ -348,7 +361,8 @@ ...@@ -348,7 +361,8 @@
creator_id = #{record.creatorId,jdbcType=BIGINT}, creator_id = #{record.creatorId,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_private = #{record.isPrivate,jdbcType=BIT} is_private = #{record.isPrivate,jdbcType=BIT},
has_reward = #{record.hasReward,jdbcType=BIT}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
...@@ -398,6 +412,9 @@ ...@@ -398,6 +412,9 @@
<if test="isPrivate != null"> <if test="isPrivate != null">
is_private = #{isPrivate,jdbcType=BIT}, is_private = #{isPrivate,jdbcType=BIT},
</if> </if>
<if test="hasReward != null">
has_reward = #{hasReward,jdbcType=BIT},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
...@@ -416,7 +433,8 @@ ...@@ -416,7 +433,8 @@
creator_id = #{creatorId,jdbcType=BIGINT}, creator_id = #{creatorId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP},
is_private = #{isPrivate,jdbcType=BIT} is_private = #{isPrivate,jdbcType=BIT},
has_reward = #{hasReward,jdbcType=BIT}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.qiandao.SignInTaskExample" resultMap="BaseResultMap"> <select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.qiandao.SignInTaskExample" resultMap="BaseResultMap">
...@@ -453,8 +471,8 @@ ...@@ -453,8 +471,8 @@
</when> </when>
<otherwise> <otherwise>
id, `name`, image, start_valid_time, end_valid_time, sign_in_start_time, sign_in_end_time, id, `name`, image, start_valid_time, end_valid_time, sign_in_start_time, sign_in_end_time,
goal_days, `type`, `state`, `desc`, creator_id, create_time, update_time, is_private goal_days, `type`, `state`, `desc`, creator_id, create_time, update_time, is_private,
has_reward
</otherwise> </otherwise>
</choose> </choose>
from sign_in_task from sign_in_task
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper.qiandao" <javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper.qiandao"
targetProject="ch-dao/src/main/java"/> targetProject="ch-dao/src/main/java"/>
<table tableName="qd_give_like_record" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true"> <table tableName="sign_in_task" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<generatedKey column="id" sqlStatement="Mysql" identity="true" /> <generatedKey column="id" sqlStatement="Mysql" identity="true" />
</table> </table>
......
package com.wwdz.ch.wx.impl.qiandao; package com.wwdz.ch.wx.impl.qiandao;
import com.wwdz.ch.core.consts.CommConsts;
import com.wwdz.ch.core.consts.qiandao.SignInTaskEnum; import com.wwdz.ch.core.consts.qiandao.SignInTaskEnum;
import com.wwdz.ch.core.type.Result; import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dao.qiandao.SignInTaskDao; import com.wwdz.ch.db.dao.qiandao.SignInTaskDao;
...@@ -12,6 +13,8 @@ import org.slf4j.LoggerFactory; ...@@ -12,6 +13,8 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
@Service @Service
public class SignInTaskServiceImpl implements SignInTaskService { public class SignInTaskServiceImpl implements SignInTaskService {
...@@ -33,4 +36,28 @@ public class SignInTaskServiceImpl implements SignInTaskService { ...@@ -33,4 +36,28 @@ public class SignInTaskServiceImpl implements SignInTaskService {
} }
return Result.failed(); return Result.failed();
} }
@Override
public Result findListForHomePage(SignInTaskRequestDto dto) {
try {
dto.setCreatorId(CommConsts.SYSTEM_ACCOUNT.longValue());
dto.setLimit(6);
List<SignInTask> signInTaskList = signInTaskDao.findByPage(dto);
return Result.success(signInTaskList);
} catch (Exception e) {
logger.error("首页查询签到任务失败 error :{}", e);
}
return Result.failed();
}
@Override
public Result findList(SignInTaskRequestDto dto) {
try {
} catch (Exception e) {
logger.error("查询签到任务失败 error : {}", e);
}
return Result.failed();
}
} }
...@@ -11,4 +11,21 @@ public interface SignInTaskService { ...@@ -11,4 +11,21 @@ public interface SignInTaskService {
* @return * @return
*/ */
Result add(SignInTaskRequestDto dto); Result add(SignInTaskRequestDto dto);
/**
* 首页查询签到任务
* @param dto
* @return
*/
Result findListForHomePage(SignInTaskRequestDto dto);
/**
* 查询签到任务
* @param dto
* @return
*/
Result findList(SignInTaskRequestDto dto);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment