提交 1a0b595a authored 作者: 吴德鹏's avatar 吴德鹏

属性管理

上级 1dedca1a
...@@ -8,7 +8,7 @@ import java.util.Date; ...@@ -8,7 +8,7 @@ import java.util.Date;
* 表名 tb_cf_item_param * 表名 tb_cf_item_param
* *
* @author lipengjun * @author lipengjun
* @date 2020-05-20 10:50:25 * @date 2020-12-23 17:12:46
*/ */
public class TbCfItemParamEntity implements Serializable { public class TbCfItemParamEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -37,6 +37,14 @@ public class TbCfItemParamEntity implements Serializable { ...@@ -37,6 +37,14 @@ public class TbCfItemParamEntity implements Serializable {
* 更新时间 * 更新时间
*/ */
private Date updateTime; private Date updateTime;
/**
* 属性ID
*/
private String attrId;
/**
* 属性描述ID
*/
private String attrDescId;
/** /**
* 设置:商品参数ID * 设置:商品参数ID
...@@ -116,4 +124,30 @@ public class TbCfItemParamEntity implements Serializable { ...@@ -116,4 +124,30 @@ public class TbCfItemParamEntity implements Serializable {
public Date getUpdateTime() { public Date getUpdateTime() {
return updateTime; return updateTime;
} }
/**
* 设置:属性ID
*/
public void setAttrId(String attrId) {
this.attrId = attrId;
}
/**
* 获取:属性ID
*/
public String getAttrId() {
return attrId;
}
/**
* 设置:属性描述ID
*/
public void setAttrDescId(String attrDescId) {
this.attrDescId = attrDescId;
}
/**
* 获取:属性描述ID
*/
public String getAttrDescId() {
return attrDescId;
}
} }
...@@ -6,6 +6,7 @@ import com.platform.entity.AttributesDescEntity; ...@@ -6,6 +6,7 @@ import com.platform.entity.AttributesDescEntity;
import com.platform.entity.AttributesEntity; import com.platform.entity.AttributesEntity;
import com.platform.service.AttributesService; import com.platform.service.AttributesService;
import com.platform.utils.IdUtil; import com.platform.utils.IdUtil;
import com.platform.utils.StringUtils;
import com.platform.vo.AttributesExtends; import com.platform.vo.AttributesExtends;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -74,7 +75,7 @@ public class AttributesServiceImpl implements AttributesService { ...@@ -74,7 +75,7 @@ public class AttributesServiceImpl implements AttributesService {
int res = attributesDao.update(attributes); int res = attributesDao.update(attributes);
List<AttributesDescEntity> descs = attributes.getDescs(); List<AttributesDescEntity> descs = attributes.getDescs();
descs.forEach(attr -> { descs.forEach(attr -> {
if (attr.getAttrDescId() != null || !attr.getAttrDescId().isEmpty()) { if (StringUtils.isNotEmpty(attr.getAttrDescId()) || !attr.getAttrDescId().isEmpty()) {
attr.setUpdateTime(date); attr.setUpdateTime(date);
attributesDescDao.update(attr); attributesDescDao.update(attr);
} else { } else {
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
`create_time`, `create_time`,
`update_time` `update_time`
from attributes_desc from attributes_desc
where attr_desc_id = #{id} where attr_id = #{id}
</select> </select>
<select id="queryList" resultType="com.platform.entity.AttributesDescEntity"> <select id="queryList" resultType="com.platform.entity.AttributesDescEntity">
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
<result property="itemId" column="item_id"/> <result property="itemId" column="item_id"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
<result property="attrId" column="attr_id"/>
<result property="attrDescId" column="attr_desc_id"/>
</resultMap> </resultMap>
<select id="queryObject" resultType="com.platform.entity.TbCfItemParamEntity"> <select id="queryObject" resultType="com.platform.entity.TbCfItemParamEntity">
...@@ -19,7 +21,9 @@ ...@@ -19,7 +21,9 @@
`param_value`, `param_value`,
`item_id`, `item_id`,
`create_time`, `create_time`,
`update_time` `update_time`,
`attr_id`,
`attr_desc_id`
from tb_cf_item_param from tb_cf_item_param
where id = #{id} where id = #{id}
</select> </select>
...@@ -30,7 +34,9 @@ ...@@ -30,7 +34,9 @@
`param_value`, `param_value`,
`item_id`, `item_id`,
`create_time`, `create_time`,
`update_time` `update_time`,
`attr_id`,
`attr_desc_id`
from tb_cf_item_param from tb_cf_item_param
where item_id = #{itemId} where item_id = #{itemId}
</select> </select>
...@@ -41,7 +47,9 @@ ...@@ -41,7 +47,9 @@
`param_value`, `param_value`,
`item_id`, `item_id`,
`create_time`, `create_time`,
`update_time` `update_time`,
`attr_id`,
`attr_desc_id`
from tb_cf_item_param from tb_cf_item_param
WHERE 1=1 WHERE 1=1
<if test="name != null and name.trim() != ''"> <if test="name != null and name.trim() != ''">
...@@ -75,24 +83,30 @@ ...@@ -75,24 +83,30 @@
`param_value`, `param_value`,
`item_id`, `item_id`,
`create_time`, `create_time`,
`update_time`) `update_time`,
`attr_id`,
`attr_desc_id`)
values( values(
#{id}, #{id},
#{paramName}, #{paramName},
#{paramValue}, #{paramValue},
#{itemId}, #{itemId},
#{createTime}, #{createTime},
#{updateTime}) #{updateTime},
#{attrId},
#{attrDescId})
</insert> </insert>
<update id="update" parameterType="com.platform.entity.TbCfItemParamEntity"> <update id="update" parameterType="com.platform.entity.TbCfItemParamEntity">
update tb_cf_item_param update tb_cf_item_param
<set> <set>
<if test="paramName != null">`param_name` = #{paramName},</if> <if test="paramName != null">`param_name` = #{paramName}, </if>
<if test="paramValue != null">`param_value` = #{paramValue},</if> <if test="paramValue != null">`param_value` = #{paramValue}, </if>
<if test="itemId != null">`item_id` = #{itemId},</if> <if test="itemId != null">`item_id` = #{itemId}, </if>
<if test="createTime != null">`create_time` = #{createTime},</if> <if test="createTime != null">`create_time` = #{createTime}, </if>
<if test="updateTime != null">`update_time` = #{updateTime}</if> <if test="updateTime != null">`update_time` = #{updateTime}, </if>
<if test="attrId != null">`attr_id` = #{attrId}, </if>
<if test="attrDescId != null">`attr_desc_id` = #{attrDescId}</if>
</set> </set>
where id = #{id} where id = #{id}
</update> </update>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论