Commit 5f68865b authored by shiyu's avatar shiyu

签到任务

parent a927eafa
package com.wwdz.ch.db.domain.qiandao;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import com.xxdxxs.entity.Entity;
import lombok.Data;
/**
* @author shiyu
* @date 2024/12/18
* @date 2024/12/19
*/
@Data
public class SignInTask implements Entity {
......@@ -69,6 +71,16 @@ public class SignInTask implements Entity {
*/
private Long creatorId;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 是否私有
*/
......@@ -94,6 +106,8 @@ public class SignInTask implements Entity {
sb.append(", state=").append(state);
sb.append(", desc=").append(desc);
sb.append(", creatorId=").append(creatorId);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", isPrivate=").append(isPrivate);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
......@@ -124,6 +138,8 @@ public class SignInTask implements Entity {
&& (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
&& (this.getDesc() == null ? other.getDesc() == null : this.getDesc().equals(other.getDesc()))
&& (this.getCreatorId() == null ? other.getCreatorId() == null : this.getCreatorId().equals(other.getCreatorId()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getIsPrivate() == null ? other.getIsPrivate() == null : this.getIsPrivate().equals(other.getIsPrivate()));
}
......@@ -143,6 +159,8 @@ public class SignInTask implements Entity {
result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
result = prime * result + ((getDesc() == null) ? 0 : getDesc().hashCode());
result = prime * result + ((getCreatorId() == null) ? 0 : getCreatorId().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getIsPrivate() == null) ? 0 : getIsPrivate().hashCode());
return result;
}
......@@ -167,6 +185,8 @@ public class SignInTask implements Entity {
state("state", "state", "INTEGER", true),
desc("desc", "desc", "VARCHAR", true),
creatorId("creator_id", "creatorId", "BIGINT", false),
createTime("create_time", "createTime", "TIMESTAMP", false),
updateTime("update_time", "updateTime", "TIMESTAMP", false),
isPrivate("is_private", "isPrivate", "BIT", false);
/**
......
package com.wwdz.ch.db.dto.request.qiandao;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
@Data
public class SignInTaskRequestDto implements Entity {
private Long id;
/**
* 签到任务名称
*/
private String name;
/**
* 图片
*/
private String image;
/**
* 开始生效时间
*/
private Date startValidTime;
/**
* 有效截止时间
*/
private Date endValidTime;
/**
* 打卡开始时间
*/
private Date signInStartTime;
/**
* 打卡结束时间
*/
private Date signInEndTime;
/**
* 打卡目标天数
*/
private Integer goalDays;
/**
* 打开类型(1连续,2累计)
*/
private Integer type;
/**
* 状态
*/
private Integer state;
/**
* 描述
*/
private String desc;
/**
* 创建人id
*/
private Long creatorId;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 是否私有
*/
private Boolean isPrivate;
}
......@@ -3,8 +3,11 @@ package com.wwdz.ch.db.mapper.qiandao;
import com.wwdz.ch.db.domain.qiandao.SignInTask;
import com.wwdz.ch.db.domain.qiandao.SignInTaskExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface SignInTaskMapper {
long countByExample(SignInTaskExample example);
......
......@@ -14,6 +14,8 @@
<result column="state" jdbcType="INTEGER" property="state" />
<result column="desc" jdbcType="VARCHAR" property="desc" />
<result column="creator_id" jdbcType="BIGINT" property="creatorId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_private" jdbcType="BIT" property="isPrivate" />
</resultMap>
<sql id="Example_Where_Clause">
......@@ -76,7 +78,7 @@
</sql>
<sql id="Base_Column_List">
id, `name`, image, start_valid_time, end_valid_time, sign_in_start_time, sign_in_end_time,
goal_days, `type`, `state`, `desc`, creator_id, is_private
goal_days, `type`, `state`, `desc`, creator_id, create_time, update_time, is_private
</sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.qiandao.SignInTaskExample" resultMap="BaseResultMap">
select
......@@ -105,14 +107,15 @@
distinct
</if>
<choose>
<when test="selective != null and selective.length > 0">
<when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, `name`, image, start_valid_time, end_valid_time, sign_in_start_time, sign_in_end_time,
goal_days, `type`, `state`, `desc`, creator_id, is_private
goal_days, `type`, `state`, `desc`, creator_id, create_time, update_time, is_private
</otherwise>
</choose>
from sign_in_task
......@@ -137,14 +140,15 @@
-->
select
<choose>
<when test="selective != null and selective.length > 0">
<when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, `name`, image, start_valid_time, end_valid_time, sign_in_start_time, sign_in_end_time,
goal_days, `type`, `state`, `desc`, creator_id, is_private
goal_days, `type`, `state`, `desc`, creator_id, create_time, update_time, is_private
</otherwise>
</choose>
from sign_in_task
......@@ -167,13 +171,13 @@
insert into sign_in_task (`name`, image, start_valid_time,
end_valid_time, sign_in_start_time, sign_in_end_time,
goal_days, `type`, `state`,
`desc`, creator_id, is_private
)
`desc`, creator_id, create_time,
update_time, is_private)
values (#{name,jdbcType=VARCHAR}, #{image,jdbcType=VARCHAR}, #{startValidTime,jdbcType=TIMESTAMP},
#{endValidTime,jdbcType=TIMESTAMP}, #{signInStartTime,jdbcType=TIMESTAMP}, #{signInEndTime,jdbcType=TIMESTAMP},
#{goalDays,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{state,jdbcType=INTEGER},
#{desc,jdbcType=VARCHAR}, #{creatorId,jdbcType=BIGINT}, #{isPrivate,jdbcType=BIT}
)
#{desc,jdbcType=VARCHAR}, #{creatorId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{isPrivate,jdbcType=BIT})
</insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.qiandao.SignInTask">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
......@@ -214,6 +218,12 @@
<if test="creatorId != null">
creator_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="isPrivate != null">
is_private,
</if>
......@@ -252,6 +262,12 @@
<if test="creatorId != null">
#{creatorId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="isPrivate != null">
#{isPrivate,jdbcType=BIT},
</if>
......@@ -302,6 +318,12 @@
<if test="record.creatorId != null">
creator_id = #{record.creatorId,jdbcType=BIGINT},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.isPrivate != null">
is_private = #{record.isPrivate,jdbcType=BIT},
</if>
......@@ -324,6 +346,8 @@
`state` = #{record.state,jdbcType=INTEGER},
`desc` = #{record.desc,jdbcType=VARCHAR},
creator_id = #{record.creatorId,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_private = #{record.isPrivate,jdbcType=BIT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
......@@ -365,6 +389,12 @@
<if test="creatorId != null">
creator_id = #{creatorId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="isPrivate != null">
is_private = #{isPrivate,jdbcType=BIT},
</if>
......@@ -384,6 +414,8 @@
`state` = #{state,jdbcType=INTEGER},
`desc` = #{desc,jdbcType=VARCHAR},
creator_id = #{creatorId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_private = #{isPrivate,jdbcType=BIT}
where id = #{id,jdbcType=BIGINT}
</update>
......@@ -414,14 +446,15 @@
select
'true' as QUERYID,
<choose>
<when test="selective != null and selective.length > 0">
<when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, `name`, image, start_valid_time, end_valid_time, sign_in_start_time, sign_in_end_time,
goal_days, `type`, `state`, `desc`, creator_id, is_private
goal_days, `type`, `state`, `desc`, creator_id, create_time, update_time, is_private
</otherwise>
</choose>
from sign_in_task
......
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