提交 abf950cd authored 作者: zhengfg's avatar zhengfg

商品管理添加价格字段

上级 443f1174
package com.platform.entity; package com.platform.entity;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
/** /**
* 站点商品实体 * 站点商品实体
* 表名 tb_cf_station_item * 表名 tb_cf_station_item
* *
* @author LHB * @author lipengjun
* @date 2019-10-17 14:30:51 * @date 2019-10-21 15:13:28
*/ */
public class TbCfStationItemEntity implements Serializable { public class TbCfStationItemEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -33,6 +34,10 @@ public class TbCfStationItemEntity implements Serializable { ...@@ -33,6 +34,10 @@ public class TbCfStationItemEntity implements Serializable {
* 商品一级分类 * 商品一级分类
*/ */
private String itemCategory; private String itemCategory;
/**
* 商品价格
*/
private BigDecimal itemPrice;
/** /**
* 商品链接 * 商品链接
*/ */
...@@ -131,6 +136,19 @@ public class TbCfStationItemEntity implements Serializable { ...@@ -131,6 +136,19 @@ public class TbCfStationItemEntity implements Serializable {
public String getItemCategory() { public String getItemCategory() {
return itemCategory; return itemCategory;
} }
/**
* 设置:商品价格
*/
public void setItemPrice(BigDecimal itemPrice) {
this.itemPrice = itemPrice;
}
/**
* 获取:商品价格
*/
public BigDecimal getItemPrice() {
return itemPrice;
}
/** /**
* 设置:商品链接 * 设置:商品链接
*/ */
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<result property="itemName" column="item_name"/> <result property="itemName" column="item_name"/>
<result property="itemBrief" column="item_brief"/> <result property="itemBrief" column="item_brief"/>
<result property="itemCategory" column="item_category"/> <result property="itemCategory" column="item_category"/>
<result property="itemPrice" column="item_price"/>
<result property="itemUrl" column="item_url"/> <result property="itemUrl" column="item_url"/>
<result property="itemImg" column="item_img"/> <result property="itemImg" column="item_img"/>
<result property="platformCode" column="platform_code"/> <result property="platformCode" column="platform_code"/>
...@@ -19,73 +20,76 @@ ...@@ -19,73 +20,76 @@
<result property="itemDescritionId" column="item_descrition_id"/> <result property="itemDescritionId" column="item_descrition_id"/>
</resultMap> </resultMap>
<select id="queryObject" resultType="com.platform.entity.TbCfStationItemEntity"> <select id="queryObject" resultType="com.platform.entity.TbCfStationItemEntity">
select `item_id`, select
`item_code`, `item_id`,
`item_name`, `item_code`,
`item_brief`, `item_name`,
`item_category`, `item_brief`,
`item_url`, `item_category`,
`item_img`, `item_price`,
`platform_code`, `item_url`,
`platform_name`, `item_img`,
`enable_flag`, `platform_code`,
`create_time`, `platform_name`,
`item_categorytwo`, `enable_flag`,
`item_descrition_id` `create_time`,
FROM `item_categorytwo`,
tb_cf_station_item s `item_descrition_id`
from tb_cf_station_item
where item_id = #{id} where item_id = #{id}
</select> </select>
<select id="queryList" resultType="com.platform.entity.TbCfStationItemEntity"> <select id="queryList" resultType="com.platform.entity.TbCfStationItemEntity">
select `item_id`, select
`item_code`, `item_id`,
`item_name`, `item_code`,
`item_brief`, `item_name`,
`item_category`, `item_brief`,
`item_url`, `item_category`,
`item_img`, `item_price`,
`platform_code`, `item_url`,
`platform_name`, `item_img`,
`enable_flag`, `platform_code`,
`create_time`, `platform_name`,
`item_categorytwo`, `enable_flag`,
`item_descrition_id` `create_time`,
FROM `item_categorytwo`,
tb_cf_station_item s `item_descrition_id`
WHERE 1=1 from tb_cf_station_item
<if test="name != null and name.trim() != ''"> WHERE 1=1
AND name LIKE concat('%',#{name},'%') <if test="name != null and name.trim() != ''">
</if> AND name LIKE concat('%',#{name},'%')
</if>
<choose> <choose>
<when test="sidx != null and sidx.trim() != ''"> <when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order} order by ${sidx} ${order}
</when> </when>
<otherwise> <otherwise>
order by item_id desc order by item_id desc
</otherwise> </otherwise>
</choose> </choose>
<if test="offset != null and limit != null"> <if test="offset != null and limit != null">
limit #{offset}, #{limit} limit #{offset}, #{limit}
</if> </if>
</select> </select>
<select id="queryTotal" resultType="int"> <select id="queryTotal" resultType="int">
select count(*) from tb_cf_station_item select count(*) from tb_cf_station_item
WHERE 1=1 WHERE 1=1
<if test="name != null and name.trim() != ''"> <if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%') AND name LIKE concat('%',#{name},'%')
</if> </if>
</select> </select>
<insert id="save" parameterType="com.platform.entity.TbCfStationItemEntity"> <insert id="save" parameterType="com.platform.entity.TbCfStationItemEntity">
insert into tb_cf_station_item( insert into tb_cf_station_item(
`item_id`, `item_id`,
`item_code`, `item_code`,
`item_name`, `item_name`,
`item_brief`, `item_brief`,
`item_category`, `item_category`,
`item_price`,
`item_url`, `item_url`,
`item_img`, `item_img`,
`platform_code`, `platform_code`,
...@@ -100,6 +104,7 @@ ...@@ -100,6 +104,7 @@
#{itemName}, #{itemName},
#{itemBrief}, #{itemBrief},
#{itemCategory}, #{itemCategory},
#{itemPrice},
#{itemUrl}, #{itemUrl},
#{itemImg}, #{itemImg},
#{platformCode}, #{platformCode},
...@@ -109,35 +114,38 @@ ...@@ -109,35 +114,38 @@
#{itemCategorytwo}, #{itemCategorytwo},
#{itemDescritionId}) #{itemDescritionId})
</insert> </insert>
<update id="update" parameterType="com.platform.entity.TbCfStationItemEntity">
update tb_cf_station_item
<set>
<if test="itemCode != null">`item_code` = #{itemCode}, </if>
<if test="itemName != null">`item_name` = #{itemName}, </if>
<if test="itemBrief != null">`item_brief` = #{itemBrief}, </if>
<if test="itemCategory != null">`item_category` = #{itemCategory}, </if>
<if test="itemPrice != null">`item_price` = #{itemPrice}, </if>
<if test="itemUrl != null">`item_url` = #{itemUrl}, </if>
<if test="itemImg != null">`item_img` = #{itemImg}, </if>
<if test="platformCode != null">`platform_code` = #{platformCode}, </if>
<if test="platformName != null">`platform_name` = #{platformName}, </if>
<if test="enableFlag != null">`enable_flag` = #{enableFlag}, </if>
<if test="createTime != null">`create_time` = #{createTime}, </if>
<if test="itemCategorytwo != null">`item_categorytwo` = #{itemCategorytwo}, </if>
<if test="itemDescritionId != null">`item_descrition_id` = #{itemDescritionId}</if>
</set>
where item_id = #{itemId}
</update>
<delete id="delete">
<update id="update" parameterType="com.platform.entity.TbCfStationItemEntity">
update tb_cf_station_item
<set>
<if test="itemCode != null">`item_code` = #{itemCode},</if>
<if test="itemName != null">`item_name` = #{itemName},</if>
<if test="itemBrief != null">`item_brief` = #{itemBrief},</if>
<if test="itemCategory != null">`item_category` = #{itemCategory},</if>
<if test="itemUrl != null">`item_url` = #{itemUrl},</if>
<if test="itemImg != null">`item_img` = #{itemImg},</if>
<if test="platformCode != null">`platform_code` = #{platformCode},</if>
<if test="platformName != null">`platform_name` = #{platformName},</if>
<if test="enableFlag != null">`enable_flag` = #{enableFlag},</if>
<if test="createTime != null">`create_time` = #{createTime},</if>
<if test="itemCategorytwo != null">`item_categorytwo` = #{itemCategorytwo},</if>
<if test="itemDescritionId != null">`item_descrition_id` = #{itemDescritionId}</if>
</set>
where item_id = #{itemId}
</update>
<delete id="delete">
delete from tb_cf_station_item where item_id = #{value} delete from tb_cf_station_item where item_id = #{value}
</delete> </delete>
<delete id="deleteBatch">
delete from tb_cf_station_item where item_id in
<foreach item="itemId" collection="array" open="(" separator="," close=")">
#{itemId}
</foreach>
</delete>
<delete id="deleteBatch">
delete from tb_cf_station_item where item_id in
<foreach item="itemId" collection="array" open="(" separator="," close=")">
#{itemId}
</foreach>
</delete>
</mapper> </mapper>
\ No newline at end of file
...@@ -45,6 +45,9 @@ ...@@ -45,6 +45,9 @@
<Form-item label="商品链接" prop="itemUrl"> <Form-item label="商品链接" prop="itemUrl">
<i-input v-model="tbCfStationItem.itemUrl" placeholder="商品链接"/> <i-input v-model="tbCfStationItem.itemUrl" placeholder="商品链接"/>
</Form-item> </Form-item>
<Form-item label="商品价格" prop="itemUrl">
<i-input v-model="tbCfStationItem.itemPrice" placeholder="商品价格"/>
</Form-item>
<Form-item label="商品图片" prop="itemImg"> <Form-item label="商品图片" prop="itemImg">
<i-input v-model="tbCfStationItem.itemImg" placeholder="商品图片"/> <i-input v-model="tbCfStationItem.itemImg" placeholder="商品图片"/>
</Form-item> </Form-item>
......
...@@ -8,6 +8,7 @@ $(function () { ...@@ -8,6 +8,7 @@ $(function () {
{label: '商品标题简介', name: 'itemBrief', index: 'item_brief', width: 80}, {label: '商品标题简介', name: 'itemBrief', index: 'item_brief', width: 80},
{label: '商品链接', name: 'itemUrl', index: 'item_url', width: 80}, {label: '商品链接', name: 'itemUrl', index: 'item_url', width: 80},
{label: '商品图片', name: 'itemImg', index: 'item_img', width: 80}, {label: '商品图片', name: 'itemImg', index: 'item_img', width: 80},
{label: '商品价格', name: 'itemPrice', index: 'item_price', width: 80},
{label: '所属平台', name: 'platformCode', index: 'platform_code', width: 80}, {label: '所属平台', name: 'platformCode', index: 'platform_code', width: 80},
{label: '平台名', name: 'platformName', index: 'platform_name', width: 80}, {label: '平台名', name: 'platformName', index: 'platform_name', width: 80},
{label: '启用状态', name: 'enableFlag', index: 'enable_flag', width: 80}, {label: '启用状态', name: 'enableFlag', index: 'enable_flag', width: 80},
......
...@@ -134,8 +134,7 @@ public class DateUtils { ...@@ -134,8 +134,7 @@ public class DateUtils {
public static void main(String[] args) { public static void main(String[] args) {
Date date = new Date(); Date date = strToDate("2019-09-18 14:42:44");
String str = "20170818223629599"; System.out.println(date.getTime()/1000);
System.out.println(DateUtils.getDateFormat(str));
} }
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论