当前位置:网站首页>Top selling commodities 【 project mall 】
Top selling commodities 【 project mall 】
2022-06-11 23:26:00 【Sun star moon cloud】
Best selling ranking of goods 【 project Shopping Mall 】
Best selling ranking of goods

1. goods – Create data table
1. Realization user Command select store database .
use store;
2. stay store Create in the database t_product database
/* */
/*!40101 SET NAMES utf8 */;
CREATE TABLE t_product
(
id int(20) NOT NULL COMMENT ' goods id',
category_id int(20) DEFAULT NULL COMMENT ' classification id',
item_type varchar(100) DEFAULT NULL COMMENT ' Product line ',
title varchar(100) DEFAULT NULL COMMENT ' Commodity title ',
sell_point varchar(150) DEFAULT NULL COMMENT ' Selling point of goods ',
price bigint(20) DEFAULT NULL COMMENT ' item pricing ',
num int(10) DEFAULT NULL COMMENT ' Inventory quantity ',
image varchar(500) DEFAULT NULL COMMENT ' Picture path ',
status int(1) DEFAULT '1' COMMENT ' Goods state 1: shelves 2: Off the shelf 3: Delete ',
priority int(10) DEFAULT NULL COMMENT ' Show priority ',
created_time datetime DEFAULT NULL COMMENT ' Creation time ',
modified_time datetime DEFAULT NULL COMMENT ' Last modified ',
created_user varchar(50) DEFAULT NULL COMMENT ' founder ',
modified_user varchar(50) DEFAULT NULL COMMENT ' Last modified by ',
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000001','238',' Kraft paper Notepad ',' Extensive (GuangBo) 10 This outfit 40 Zhang A5 Kraft paper Notepad, diary, office soft copy GBR0731 ',' Classic review ! A great deal !','23','99999','/images/portal/00GuangBo1040A5GBR0731/','1','62','2017-10-25 15:08:55','2017-10-25 15:08:55','admin ',' admin ');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000002','238',' Leather calendar ',' Extensive (GuangBo) Leather calendar Planning Notepad efficiency manual Beige FB60322 ',' Classic review ! A great deal !','46','99999','/images/portal/001GuangBo)FB60322/','1','49','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000003','238','16k Notepad ',' Extensive (GuangBo)16K115 Page coil Notepad diary stationery notebook pattern random ',' Classic review ! A great deal !','13','99999','/images/portal/01GuangBo16K115FB60506/','1','58','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000004','241',' Calculator ',' Deli (deli)1548A Business office desktop calculator Solar dual power supply ',' Classic review ! A great deal !','58','99999','/images/portal/002calculator1548A/','1','42','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000005','241',' Ball pen ',' Schneider (Schneider) K15 Classic ballpoint pen (5 Mixed color clothes )',' Classic review ! A great deal !','29','99999','/images/portal/03SchneiderK15/','1','36','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000006','236',' Bill mesh zip pocket ',' Sanmu (SUNWOOD) C4523 Bill mesh zip pocket / file pocket 12 Individual outfit The color is random ',' Classic review ! A great deal !','28','99999','/images/portal/04_SUNWOODC452312/','1','53','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000007','163',' burn 7000',' Dell Dell burn 700 Classic gold ',' Place an order and give 12000 Ma mobile power supply ','32999','99999','/images/portal/11DELLran7000gold/','1','59','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000008','163',' burn 7000',' Dell Dell burn 700R1605 Classic silver ',' Only Shanghai , Guangzhou , Goods are available in Shenyang Warehouse ! Advance purchase as soon as possible !','4549','99999','/images/portal/11DELLran7000R1605Ssilvery/','1','32','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000009','163',' burn 7000',' Dell Dell burn 700 Learning gold ',' Place an order and give 12000 Ma mobile power supply ','39929','99999','/images/portal/11DELLran7000gold/','1','84','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000010','163',' burn 7000',' Dell Dell burn 700R1605 Learning silver ',' Only Shanghai , Guangzhou , Goods are available in Shenyang Warehouse ! Advance purchase as soon as possible !','5559','99999','/images/portal/11DELLran7000R1605Ssilvery/','1','21','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000011','163',' burn 7000',' Dell Dell burn 700 High profile gold ',' Place an order and give 12000 Ma mobile power supply ','3994','99999','/images/portal/11DELLran7000gold/','1','56','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000012','163',' burn 7000',' Dell Dell burn 700R1605 High profile silver ',' Only Shanghai , Guangzhou , Goods are available in Shenyang Warehouse ! Advance purchase as soon as possible !','6559','99999','/images/portal/11DELLran7000R1605Ssilvery/','1','16','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000013','238','A5 Premium business notebook ',' One heart (COMIX)C5902 A5 Premium business notebook Notepad diary 122 Zhang ',' You can send it as soon as you place an order 10400 Ma mobile power supply ! And a magic box for mobile phones !','41','99999','/images/portal/02COMIXC5902A5122blue/','1','10','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000014','163','XPS13-9360',' Dell (DELL)XPS13-9360-R1609 13.3 Standard gold ',' Only Shanghai , Guangzhou , Goods are available in Shenyang Warehouse ! Advance purchase as soon as possible !','4600','99999','/images/portal/12(DELL)XPS13gold/','1','1','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000015','163','XPS13-9360',' Dell (DELL)XPS13-9360-R1609 13.3 Standard silver ',' Only Shanghai , Guangzhou , Goods are available in Shenyang Warehouse ! Advance purchase as soon as possible !','4601','99999','/images/portal/12DELLXPS13-silvery/','1','73','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000016','163','XPS13-9360',' Dell (DELL)XPS13-9360-R1609 13.3 High profile gold ',' Only Shanghai , Guangzhou , Goods are available in Shenyang Warehouse ! Advance purchase as soon as possible !','4602','99999','/images/portal/12(DELL)XPS13gold/','1','64','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000017','163','XPS13-9360',' Dell (DELL)XPS13-9360-R1609 13.3 High profile silver ',' Only Shanghai , Guangzhou , Goods are available in Shenyang Warehouse ! Advance purchase as soon as possible !','4604','99992','/images/portal/12DELLXPS13-silvery/','1','100','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000018','163','XPS13-9360',' Dell (DELL)XPS13-9360-R1609 13.3 Noble gold ',' Only Shanghai , Guangzhou , Goods are available in Shenyang Warehouse ! Advance purchase as soon as possible !','4605','99999','/images/portal/12(DELL)XPS13gold/','1','7','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000019','163','XPS13-9360',' Dell (DELL)XPS13-9360-R1609 13.3 Noble silver ',' Only Shanghai , Guangzhou , Goods are available in Shenyang Warehouse ! Advance purchase as soon as possible !','4899','99999','/images/portal/12DELLXPS13-silvery/','1','34','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000020','163','IdeaPad310',' lenovo (Lenovo)IdeaPad310 Low profile black ',' Clearance ! Beijing only , There are goods in Wuhan warehouse !','5119','99999','/images/portal/13LenovoIdeaPad310_black/','1','50','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000021','163','IdeaPad310',' lenovo (Lenovo)IdeaPad310 Low profile silver ',' Clearance ! Beijing only , There are goods in Wuhan warehouse !','5129','99999','/images/portal/13LenovoIdeaPad310_silvery/','1','48','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000022','163','IdeaPad310',' lenovo (Lenovo)IdeaPad310 Classic black ',' Clearance ! Beijing only , There are goods in Wuhan warehouse !','5119','99999','/images/portal/13LenovoIdeaPad310_black/','1','90','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000023','163','IdeaPad310',' lenovo (Lenovo)IdeaPad310 Classic silver ',' Clearance ! Beijing only , There are goods in Wuhan warehouse !','5129','99999','/images/portal/13LenovoIdeaPad310_silvery/','1','6','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000024','163','IdeaPad310',' lenovo (Lenovo)IdeaPad310 High profile black ',' Clearance ! Beijing only , There are goods in Wuhan warehouse !','5119','99999','/images/portal/13LenovoIdeaPad310_black/','1','60','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000025','163','IdeaPad310',' lenovo (Lenovo)IdeaPad310 High profile silver ',' Clearance ! Beijing only , There are goods in Wuhan warehouse !','5129','99999','/images/portal/13LenovoIdeaPad310_silvery/','1','80','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000026','163','YOGA710',' lenovo (Lenovo)YOGA710 14 Inch (i7-7500U 8G 256GSSD 2G Showing a ) golden ','【0 Yuan presents 】 Over ten thousand high praise , Sales legend ! Classic Blu ray TV , Unique natural light technology patent , Take the best home for the new year !【0 Yuan white slip trial ,1001 A New Year greeting plan 】','59999','99999','/images/portal/14LenovoYOGA710 _gold/','1','19','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000027','163','YOGA710',' lenovo (Lenovo)YOGA710 14 Inch (i7-7500U 8G 256GSSD 2G Showing a ) silvery ','【0 Yuan presents 】 Over ten thousand high praise , Sales legend ! Classic Blu ray TV , Unique natural light technology patent , Take the best home for the new year !【0 Yuan white slip trial ,1001 A New Year greeting plan 】','59999','99999','/images/portal/14LenovoYOGA710 _silvery/','1','55','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000028','163',' Xiaoxin 310',' lenovo (Lenovo) Xiaoxin 310 Low profile black ',' Clearance ! Beijing only , There are goods in Wuhan warehouse !','4939','99997','/images/portal/15Lenovo_xiaoxin_310_black/','1','19','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000029','163',' Xiaoxin 310',' lenovo (Lenovo) Xiaoxin 310 Low profile silver ',' Clearance ! Beijing only , There are goods in Wuhan warehouse !','4839','99999','/images/portal/15Lenovo_xiaoxin_310_silvery/','1','27','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000030','163',' Xiaoxin 310',' lenovo (Lenovo) Xiaoxin 310 Classic black ',' Clearance ! Beijing only , There are goods in Wuhan warehouse !','4739','99999','/images/portal/15Lenovo_xiaoxin_310_black/','1','78','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000031','163',' Xiaoxin 310',' lenovo (Lenovo) Xiaoxin 310 Classic silver ',' Clearance ! Beijing only , There are goods in Wuhan warehouse !','4639','99998','/images/portal/15Lenovo_xiaoxin_310_silvery/','1','9','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000032','163',' Xiaoxin 310',' lenovo (Lenovo) Xiaoxin 310 High profile black ',' Clearance ! Beijing only , There are goods in Wuhan warehouse !','4539','99999','/images/portal/15Lenovo_xiaoxin_310_black/','1','9','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000033','163',' Xiaoxin 310',' lenovo (Lenovo) Xiaoxin 310 High profile silver ',' Clearance ! Beijing only , There are goods in Wuhan warehouse !','4439','99999','/images/portal/15Lenovo_xiaoxin_310_silvery/','1','18','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000034','163','YOGA900',' lenovo (Lenovo)YOGA900 green ',' The vitality of youth Fresh, beautiful, high-end and high-grade ','5200','99999','/images/portal/16LenovoYOGA900green/','1','63','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000035','163','YOGA900',' lenovo (Lenovo)YOGA900 Pink ',' The vitality of youth Fresh, beautiful, high-end and high-grade ','5200','99999','/images/portal/16LenovoYOGA900pink/','1','62','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000036','163','YOGA900',' lenovo (Lenovo)YOGA900 Red ',' The vitality of youth Fresh, beautiful, high-end and high-grade ','5200','99999','/images/portal/16LenovoYOGA900red/','1','21','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000037','163',' Xiaoxin 13 Flagship Edition ',' lenovo (Lenovo) Xiaoxin Air13 Pro 13.3 Inch 14.8mm Ultra thin notebook computer gold ',' The vitality of youth Youth exclusive ','6439','99998','/images/portal/17Lenovo)xiaoxinAir13Pro_gold/','1','16','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000038','163',' Xiaoxin 13 Flagship Edition ',' lenovo (Lenovo) Xiaoxin Air13 Pro 13.3 Inch 14.8mm Ultra thin notebook computer silver ',' The vitality of youth Youth exclusive ','6439','99998','/images/portal/17Lenovo)xiaoxinAir13Pro_silvery/','1','17','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000039','163','XPS15',' Dell (DELL) XPS15 silvery ',' Time limited special ! Over ten thousand excellent products have been highly praised !','3333','99999','/images/portal/18(DELL)XPS15_silvery/','1','37','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000040','163','15MF Pro',' Dell (DELL) Rubik's Cube 15MF Pro-R2505TSS Lingyue Standard Edition ','15.6 Inch two in one flip laptop (i5-7200U 8GB 1TB IPS Win10) Touch Silver ','4443','99999','/images/portal/19DELL15MF Pro/','1','35','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000041','163','XPS15-9550',' Dell (DELL) XPS15 The standard version ','15.6 Inch two in one flip laptop (i5-7200U 8GB 1TGB IPS Win10) Touch ','8443','99999','/images/portal/20DellXPS15-9550/','1','61','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000042','163','ThinkPad New s1',' lenovo ThinkPad New S1(01CD) i5 6 generation Red ',' Classic review ! A great deal !','4399','99999','/images/portal/21ThinkPad_New_S1/','1','99','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000043','917',' a bag bag',' Leshang schoolbag Computer package bag black ',' Give you the joy of returning with a full load !','89','99999','/images/portal/22_LEXON_LNE6025B06T/','1','12','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('10000044','917',' a bag bag',' Leshang schoolbag Computer package bag Pink ',' Give you the joy of returning with a full load !','89','99999','/images/portal/22_LEXON_LNE6025B06T/','1','62','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('100000021','238',' Leather calendar ',' Extensive (GuangBo) Leather calendar Plan Notepad efficiency manual blue FB60321',' Classic review ! A great deal !','22','99999','/images/portal/001GuangBo)FB60322/','1','73','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('100000391','163','XPS15',' Dell (DELL) XPS15 golden ',' Time limited special ! Over ten thousand excellent products have been highly praised !','3333','99999','/images/portal/18(DELL)XPS15_silvery/','1','81','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('100000401','163','15MF Pro',' Dell (DELL) Rubik's Cube 15MF Pro-R2505TSS Lingyue high configuration version ','15.6 Inch two in one flip laptop (i5-7200U 8GB 1TB IPS Win10) Touch white ','4443','99997','/images/portal/19DELL15MF Pro/','1','86','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('100000402','163','15MF Pro',' Dell (DELL) Rubik's Cube 15MF Pro-R2505TSS Lingyue player version ','15.6 Inch two in one flip laptop (i7-7200U 8GB 512GB IPS Win10) Touch Silver ','6443','99999','/images/portal/19DELL15MF Pro/','1','84','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('100000403','163','15MF Pro',' Dell (DELL) Rubik's Cube 15MF Pro-R2505TSS Lingyue flagship ','15.6 Inch two in one flip laptop (i7-7200U 8GB 512GB IPS Win10) Touch white ','6443','99999','/images/portal/19DELL15MF Pro/','1','63','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('100000411','163','XPS15-9550',' Dell (DELL) XPS15 Upgraded version ','15.6 Inch two in one flip laptop (i5-7200U 8GB 256GB IPS Win10) Touch ','8443','99999','/images/portal/20DellXPS15-9550/','1','60','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('100000412','163','XPS15-9550',' Dell (DELL) XPS15 High configuration version ','15.6 Inch two in one flip laptop (i7-7200U 8GB 1TB IPS Win10) Touch ','8443','99999','/images/portal/20DellXPS15-9550/','1','13','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('100000413','163','XPS15-9550',' Dell (DELL) XPS15 pro ','15.6 Inch two in one flip laptop (i7-7200U 8GB 256GB IPS Win10) Touch ','8443','99999','/images/portal/20DellXPS15-9550/','1','83','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('100000421','163','ThinkPad New s1',' lenovo ThinkPad New S1(01CD) i7 6 generation Red ',' Classic review ! A great deal !','6399','99999','/images/portal/21ThinkPad_New_S1/','1','74','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('100000422','163','ThinkPad New s1',' lenovo ThinkPad New S1(01CD) i5 6 generation yellow ',' Classic review ! A great deal !','4399','99999','/images/portal/21ThinkPad_New_S1/','1','23','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('100000424','163','ThinkPad New s1',' lenovo ThinkPad New S1(01CD) i5 6 generation Blue ',' Classic review ! A great deal !','4399','99999','/images/portal/21ThinkPad_New_S1/','1','87','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
insert into `t_product` (`id`, `category_id`, `item_type`, `title`, `sell_point`, `price`, `num`, `image`, `status`, `priority`, `created_time`, `modified_time`, `created_user`, `modified_user`) values('100000425','163','ThinkPad New s1',' lenovo ThinkPad New S1(01CD) i7 6 generation Blue ',' Classic review ! A great deal !','6399','99999','/images/portal/21ThinkPad_New_S1/','1','59','2017-10-25 15:08:55','2017-10-25 15:08:55','admin','admin');
t_product.sql
2. goods – Create entity class
establish com.cy.store.entity.Product class , And inheritance BaseEntity class . Declare the attribute corresponding to the data section in the class .
/** Entity class of commodity data */
public class Product extends BaseEntity implements Serializable {
private Integer id;
private Integer categoryId;
private String itemType;
private String title;
private String sellPoint;
private Long price;
private Integer num;
private String image;
private Integer status;
private Integer priority;
//****
}
Product
3. Best selling ranking of goods – Persistence layer
3.1 Of planning query SQL sentence
Query the list of popular products SQL sentence .
SELECT * FORM t_product WHERE status=1 ORDER BY piority DESC LIMIT 0,4
3.2 Interfaces and abstract methods
package com.cy.store.mapper;
import com.cy.store.entity.Product;
import java.util.List;
public interface ProductMapper {
/* Check the top four selling products */
List<Product> findHotList();
}
3.3 To configure SQL mapping
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cy.store.mapper.ProductMapper">
<resultMap id="ProductEntityMap" type="com.cy.store.entity.Product">
<id column="id" property="id"/>
<result column="category_id" property="categoryId"/>
<result column="item_type" property="itemType"/>
<result column="sell_point" property="sellPoint"/>
<result column="created_user" property="createdUser"/>
<result column="created_time" property="createdTime"/>
<result column="modified_user" property="modifiedUser"/>
<result column="modified_time" property="modifiedTime"/>
</resultMap>
<!-- Check the top four selling products :List<Product> findHostList() -->
<select id="findHotList" resultMap="ProductEntityMap">
SELECT * FROM t_product WHERE status=1 ORDER BY priority DESC LIMIT 0,4
</select>
</mapper>
ProductMapper–findHotList
4. Best selling ranking of goods – The business layer
4.1 Planning exception
explain : No abnormality
4.2 Implement interfaces and abstract methods
package com.cy.store.service;
import com.cy.store.entity.Product;
import java.util.List;
/* Business layer interface for processing commodity data */
public interface IProductService {
/* Check the top four selling products */
List<Product> findHotList();
}
4.3 Implement abstract methods
establish IProductService Interface , And add... In the interface findHotList() Method .
package com.cy.store.service.impl;
import com.cy.store.entity.Product;
import com.cy.store.mapper.ProductMapper;
import com.cy.store.service.IProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/** Business layer implementation class for processing commodity data */
@Service
public class ProductServiceImpl implements IProductService {
@Autowired
private ProductMapper productMapper;
@Override
public List<Product> findHotList() {
List<Product> list = productMapper.findHotList();
for (Product product : list) {
product.setPriority(null);
product.setCreatedUser(null);
product.setCreatedTime(null);
product.setModifiedUser(null);
product.setModifiedTime(null);
}
return list;
}
}
ProductServiceImpl–findHotList
5. Best selling ranking of goods – controller
5.1 Handling exceptions
explain : No abnormality
5.2 Design request
1. Requests submitted by design users , And design the response method
Request path :/products/hot_list
Request parameters : nothing
Request type : GET
In response to the results :JsonResult<List<Product>>
Intercept or not : no , Need to put index.html and /products/** Request to add whitelist 2. stay LoginInterceptorConfigurer Lieutenant general index.html Page and /products/** Request to add whitelist
patterns.add("/web/index.html");
patterns.add("/products/**");
LoginInterceptorConfigurer–/products
5.3 Processing requests
1. establish ProductController Class inheritance BaseController class , Class add @RestController and @RequestMapping(“products”) annotation , And add business layer objects to the class .
2. Add... To the class that handles the request getHotList() Method .
package com.cy.store.controller;
import com.cy.store.entity.Product;
import com.cy.store.service.IProductService;
import com.cy.store.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("products")
public class ProductController extends BaseController {
@Autowired
private IProductService productService;
@RequestMapping("hot_list")
public JsonResult<List<Product>> getHotList() {
List<Product> data = productService.findHotList();
return new JsonResult<List<Product>>(OK, data);
}
}
ProductController–getHotList
3. Start the project after completion , Direct access to test .
6 Best selling ranking of goods – Front page
1. stay index.html to “ Top sellers ” List div Label settings id Property value .
<div id="hot-list" class="panel-body panel-item">
2. stay index.html On the page body The last inside the label , Add the code to display the top selling products .
<!-- showHotList -->
<script type="text/javascript">
$(document).ready(function() {
showHotList();
});
function showHotList() {
$("#hot-list").empty();
$.ajax({
url: "/products/hot_list",
type: "GET",
dataType: "JSON",
success: function(json) {
let list = json.data;
console.log("count=" + list.length);
for (let i = 0; i < list.length; i++) {
console.log(list[i].title);
let html = '<div class="col-md-12">'
+ '<div class="col-md-7 text-row-2"><a href="product.html?id=#{id}">#{title}</a></div>'
+ '<div class="col-md-2">¥#{price}</div>'
+ '<div class="col-md-3"><img src="..#{image}collect.png" class="img-responsive" /></div>'
+ '</div>';
html = html.replace(/#{id}/g, list[i].id);
html = html.replace(/#{title}/g, list[i].title);
html = html.replace(/#{price}/g, list[i].price);
html = html.replace(/#{image}/g, list[i].image);
$("#hot-list").append(html);
}
}
});
}
</script>
<!-- showHotList -->
index.html–showHotList
Final test

explain : Pictures are stored in portal Next 
README– Best selling ranking of goods
边栏推荐
- Si4432 RF chip scheme typical application of data transmission of wireless communication module of Internet of things
- Teacher lihongyi, NTU -- tips for DNN regulation
- How to construct PostgreSQL error codes
- Small program startup performance optimization practice
- 2022年安全员-A证考题模拟考试平台操作
- How to completely modify the user name in win10 system and win11 system
- What are the pitfalls of redis's current network: using a cache and paying for disk failures?
- 2022年安全员-A证考题模拟考试平台操作
- H. 265 introduction to coding principles
- [naturallanguageprocessing] [multimodal] albef: visual language representation learning based on momentum distillation
猜你喜欢

Lake Shore—SuperTran 连续流低温恒温器系统

The second bullet of in-depth dialogue with the container service ack distribution: how to build a hybrid cloud unified network plane with the help of hybridnet

Implementation scheme of iteration and combination pattern for general tree structure

Is the product stronger or weaker, and is the price unchanged or reduced? Talk about domestic BMW X5

一文读懂Logstash原理

Pourquoi Google Search ne peut - il pas Pager indéfiniment?

2022年安全员-A证考题模拟考试平台操作

基于模板配置的数据可视化平台

Toyota suppliers shut down Japanese factories due to cyber attacks, NVIDIA counterattacks extortion gangs to prevent data leakage | global cyber security hotspot on March 1
![[naturallanguageprocessing] [multimodal] albef: visual language representation learning based on momentum distillation](/img/b7/0ccd11bd97aa0e217775b31fff3511.jpg)
[naturallanguageprocessing] [multimodal] albef: visual language representation learning based on momentum distillation
随机推荐
Antigen products enter the family, and Chinese medical device enterprises usher in a new blue ocean
mysql——find_ in_ Set usage
Summary of personal wrong questions (the wrong questions have not been solved and are used for help)
[day4 literature intensive reading] space – time interdependence: evidence against Asymmetric mapping between time and space
Research Report on development trend and competitive strategy of global reverse osmosis membrane cleaning agent industry
Leetcode must review 20 lintcode (5466421166978227)
2022 high voltage electrician test question simulation test question bank and online simulation test
2022年安全員-A證考題模擬考試平臺操作
Mysql5 and mysql8 are installed at the same time
MySQL 8.0 解压版安装教程
[day11-12 intensive literature reading] on languages in memory: an internal clock account of space-time interaction
C language simple exercise No.17, about the combination of for and while loops
GMN of AI medicine article interpretation
oracle中dblink操作
Read the logstash principle
Lake Shore—SuperTran-VP 连续流低温恒温器系统
What are the pitfalls of redis's current network: using a cache and paying for disk failures?
Small program startup performance optimization practice
Two ways of using reuqests in RF
Lekao.com: what is the difference between Level 3 health managers and level 2 health managers?