Commit 17886961 authored by muhong's avatar muhong

修改 收藏册和藏品关联表结构

parent e0fe1f97
......@@ -9,7 +9,7 @@ import java.util.Date;
/**
* @author shiyu
* @date 2023/07/25
* @date 2023/09/04
*/
@Data
public class FavoritesItemsRelation implements Serializable {
......@@ -33,6 +33,11 @@ public class FavoritesItemsRelation implements Serializable {
*/
private Date addTime;
/**
* 更新时间
*/
private Date updateTime;
private static final long serialVersionUID = 1L;
@Override
......@@ -45,6 +50,7 @@ public class FavoritesItemsRelation implements Serializable {
sb.append(", userId=").append(userId);
sb.append(", itemId=").append(itemId);
sb.append(", addTime=").append(addTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
......@@ -65,7 +71,8 @@ public class FavoritesItemsRelation implements Serializable {
return (this.getFavoritesId() == null ? other.getFavoritesId() == null : this.getFavoritesId().equals(other.getFavoritesId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getItemId() == null ? other.getItemId() == null : this.getItemId().equals(other.getItemId()))
&& (this.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime()));
&& (this.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
}
@Override
......@@ -76,6 +83,7 @@ public class FavoritesItemsRelation implements Serializable {
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getItemId() == null) ? 0 : getItemId().hashCode());
result = prime * result + ((getAddTime() == null) ? 0 : getAddTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
return result;
}
......@@ -90,7 +98,8 @@ public class FavoritesItemsRelation implements Serializable {
favoritesId("favorites_id", "favoritesId", "BIGINT", false),
userId("user_id", "userId", "BIGINT", false),
itemId("item_id", "itemId", "BIGINT", false),
addTime("add_time", "addTime", "TIMESTAMP", false);
addTime("add_time", "addTime", "TIMESTAMP", false),
updateTime("update_time", "updateTime", "TIMESTAMP", false);
/**
* This field was generated by MyBatis Generator.
......
......@@ -675,6 +675,138 @@ public class FavoritesItemsRelationExample {
addCriterion("add_time not between", value1, value2, "addTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table favorites_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeEqualToColumn(FavoritesItemsRelation.Column column) {
addCriterion(new StringBuilder("update_time = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table favorites_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeNotEqualToColumn(FavoritesItemsRelation.Column column) {
addCriterion(new StringBuilder("update_time <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table favorites_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeGreaterThanColumn(FavoritesItemsRelation.Column column) {
addCriterion(new StringBuilder("update_time > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table favorites_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeGreaterThanOrEqualToColumn(FavoritesItemsRelation.Column column) {
addCriterion(new StringBuilder("update_time >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table favorites_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeLessThanColumn(FavoritesItemsRelation.Column column) {
addCriterion(new StringBuilder("update_time < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table favorites_items_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeLessThanOrEqualToColumn(FavoritesItemsRelation.Column column) {
addCriterion(new StringBuilder("update_time <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
......
......@@ -6,12 +6,7 @@
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="item_id" jdbcType="BIGINT" property="itemId" />
<result column="add_time" jdbcType="TIMESTAMP" property="addTime" />
</resultMap>
<resultMap id="ItemResultMap" type="com.wwdz.ch.db.dto.FavoritesItemsDto">
<result column="item_id" jdbcType="BIGINT" property="itemId" />
<result column="add_time" jdbcType="TIMESTAMP" property="addTime" />
<result column="images" jdbcType="VARCHAR" property="images" />
<result column="top_image" jdbcType="VARCHAR" property="topImage" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
......@@ -72,7 +67,7 @@
</where>
</sql>
<sql id="Base_Column_List">
favorites_id, user_id, item_id, add_time
favorites_id, user_id, item_id, add_time, update_time
</sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.FavoritesItemsRelationExample" resultMap="BaseResultMap">
select
......@@ -107,7 +102,7 @@
</foreach>
</when>
<otherwise>
favorites_id, user_id, item_id, add_time
favorites_id, user_id, item_id, add_time, update_time
</otherwise>
</choose>
from favorites_items_relation
......@@ -126,17 +121,9 @@
</delete>
<insert id="insert" parameterType="com.wwdz.ch.db.domain.FavoritesItemsRelation">
insert into favorites_items_relation (favorites_id, user_id, item_id,
add_time)
add_time, update_time)
values (#{favoritesId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{itemId,jdbcType=BIGINT},
#{addTime,jdbcType=TIMESTAMP})
</insert>
<insert id="batchInsert" parameterType="com.wwdz.ch.db.domain.FavoritesItemsRelation">
insert into favorites_items_relation (favorites_id, user_id, item_id,
add_time)
values
<foreach collection="list" item="item" separator=",">
(#{item.favoritesId,jdbcType=BIGINT}, #{item.userId,jdbcType=BIGINT}, #{item.itemId,jdbcType=BIGINT}, #{item.addTime,jdbcType=TIMESTAMP})
</foreach>
#{addTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.FavoritesItemsRelation">
insert into favorites_items_relation
......@@ -153,6 +140,9 @@
<if test="addTime != null">
add_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="favoritesId != null">
......@@ -167,6 +157,9 @@
<if test="addTime != null">
#{addTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wwdz.ch.db.domain.FavoritesItemsRelationExample" resultType="java.lang.Long">
......@@ -190,6 +183,9 @@
<if test="record.addTime != null">
add_time = #{record.addTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
......@@ -200,7 +196,8 @@
set favorites_id = #{record.favoritesId,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT},
item_id = #{record.itemId,jdbcType=BIGINT},
add_time = #{record.addTime,jdbcType=TIMESTAMP}
add_time = #{record.addTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
......@@ -238,7 +235,7 @@
</foreach>
</when>
<otherwise>
favorites_id, user_id, item_id, add_time
favorites_id, user_id, item_id, add_time, update_time
</otherwise>
</choose>
from favorites_items_relation
......
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