package com.tim.mall.mapper;
import com.tim.mall.model.Goods;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface GoodsMapper extends Mapper<Goods> {
/**
* 查询某一个搜索的内容
* @param query
* @param start
* @param limit
* @return
*/
@Select({"select id,name,short_name,category_id,length,width,high,weight,cost_price,selling_price,original_price," +
"detail,basic_stock,upper_shelf," +
"examine,deleted,create_time,update_time from goods where name like \"%\""+"#{query} "+"\"%\""+"limit #{start},#{limit}"})
@Results({
@Result(column="id",property = "id",jdbcType = JdbcType.INTEGER,id=true),
@Result(column="name", property="name", jdbcType= JdbcType.VARCHAR),
@Result(column="short_name", property="shortName", jdbcType= JdbcType.DATE),
@Result(column="category_id", property="categoryId", jdbcType= JdbcType.INTEGER),
@Result(column="length", property="length", jdbcType= JdbcType.DOUBLE),
@Result(column="width", property="width", jdbcType= JdbcType.DOUBLE),
@Result(column="high", property="high", jdbcType= JdbcType.DOUBLE),
@Result(column="weight", property="weight", jdbcType= JdbcType.DOUBLE),
@Result(column="cost_price", property="costPrice", jdbcType= JdbcType.DOUBLE),
@Result(column="selling_price", property="sellingPrice", jdbcType= JdbcType.DOUBLE),
@Result(column="original_price", property="originalPrice", jdbcType= JdbcType.DOUBLE),
@Result(column="detail", property="detail", jdbcType= JdbcType.VARCHAR),
@Result(column="basic_stock", property="basicStock", jdbcType= JdbcType.INTEGER),
@Result(column="upper_shelf", property="upperShelf", jdbcType= JdbcType.CHAR),
@Result(column="examine", property="examine", jdbcType= JdbcType.CHAR),
@Result(column="deleted", property="deleted", jdbcType= JdbcType.CHAR),
@Result(column="create_time", property="createTime", jdbcType= JdbcType.DATE),
@Result(column="update_time", property="updateTime", jdbcType= JdbcType.DATE),
})
List<Goods> selectByName(@Param("query")String query, @Param("start")int start, @Param("limit")int limit);
@Select({"select count(id) from goods where name like \"%\""+"#{query}"+"\"%\""})
Integer selectCountByName(@Param("query")String query);
/**
* 查询某一个分类的所有
* @param query
* @param start
* @param limit
* @param categoryId
* @return
*/
@Select({"select id,name,short_name,category_id,length,width,high,weight,cost_price,selling_price,original_price," +
"detail,basic_stock,upper_shelf," +
"examine,deleted,create_time,update_time from goods where name like \"%\""+"#{query} "+"\"%\""+" and category_id=#{categoryId} limit #{start},#{limit}"})
@Results({
@Result(column="id",property = "id",jdbcType = JdbcType.INTEGER,id=true),
@Result(column="name", property="name", jdbcType= JdbcType.VARCHAR),
@Result(column="short_name", property="shortName", jdbcType= JdbcType.DATE),
@Result(column="category_id", property="categoryId", jdbcType= JdbcType.INTEGER),
@Result(column="length", property="length", jdbcType= JdbcType.DOUBLE),
@Result(column="width", property="width", jdbcType= JdbcType.DOUBLE),
@Result(column="high", property="high", jdbcType= JdbcType.DOUBLE),
@Result(column="weight", property="weight", jdbcType= JdbcType.DOUBLE),
@Result(column="cost_price", property="costPrice", jdbcType= JdbcType.DOUBLE),
@Result(column="selling_price", property="sellingPrice", jdbcType= JdbcType.DOUBLE),
@Result(column="original_price", property="originalPrice", jdbcType= JdbcType.DOUBLE),
@Result(column="detail", property="detail", jdbcType= JdbcType.VARCHAR),
@Result(column="basic_stock", property="basicStock", jdbcType= JdbcType.INTEGER),
@Result(column="upper_shelf", property="upperShelf", jdbcType= JdbcType.CHAR),
@Result(column="examine", property="examine", jdbcType= JdbcType.CHAR),
@Result(column="deleted", property="deleted", jdbcType= JdbcType.CHAR),
@Result(column="create_time", property="createTime", jdbcType= JdbcType.DATE),
@Result(column="update_time", property="updateTime", jdbcType= JdbcType.DATE),
})
List<Goods> selectCategoryByName(@Param("query")String query, @Param("start")int start, @Param("limit")int limit,@Param("categoryId") int categoryId);
@Select({"select count(id) from goods where name like \"%\""+"#{query}"+"\"%\" and category_id=#{categoryId}"})
Integer selectCategoryCount(@Param("query") String query, @Param("categoryId") int categoryId);
@Select({"select id,name,short_name,category_id,length,width,high,weight,cost_price,selling_price,original_price,detail,basic_stock,upper_shelf, examine,deleted,create_time,update_time from goods where id=#{id}"})
@Results({
@Result(column="id",property = "id",jdbcType = JdbcType.INTEGER,id=true),
@Result(column="name", property="name", jdbcType= JdbcType.VARCHAR),
@Result(column="short_name", property="shortName", jdbcType= JdbcType.DATE),
@Result(column="category_id", property="categoryId", jdbcType= JdbcType.INTEGER),
@Result(column="length", property="length", jdbcType= JdbcType.DOUBLE),
@Result(column="width", property="width", jdbcType= JdbcType.DOUBLE),
@Result(column="high", property="high", jdbcType= JdbcType.DOUBLE),
@Result(column="weight", property="weight", jdbcType= JdbcType.DOUBLE),
@Result(column="cost_price", property="costPrice", jdbcType= JdbcType.DOUBLE),
@Result(column="selling_price", property="sellingPrice", jdbcType= JdbcType.DOUBLE),
@Result(column="original_price", property="originalPrice", jdbcType= JdbcType.DOUBLE),
@Result(column="detail", property="detail", jdbcType= JdbcType.VARCHAR),
@Result(column="basic_stock", property="basicStock", jdbcType= JdbcType.INTEGER),
@Result(column="upper_shelf", property="upperShelf", jdbcType= JdbcType.CHAR),
@Result(column="examine", property="examine", jdbcType= JdbcType.CHAR),
@Result(column="deleted", property="deleted", jdbcType= JdbcType.CHAR),
@Result(column="create_time", property="createTime", jdbcType= JdbcType.DATE),
@Result(column="update_time", property="updateTime", jdbcType= JdbcType.DATE),
})
Goods selectById(int id);
@Update({"UPDATE goods SET name = #{good.name},short_name = #{good.shortName},category_id = #{good.categoryId},length = #{good.length},width = #{good.width},high = #{good.high},weight = #{good.weight},cost_price = #{good.costPrice},selling_price = #{good.sellingPrice},original_price = #{good.originalPrice},basic_stock = #{good.basicStock},upper_shelf = #{good.upperShelf},examine = #{good.examine},deleted = #{good.deleted},detail = #{good.detail} WHERE id = #{good.id}"})
Integer updateByID(@Param("good") Goods good);
@Select({"SELECT g.id,g.name,g.short_name,g.category_id,g.length,g.width,g.high,g.weight,g.cost_price,g.selling_price,g.original_price,g.detail,g.basic_stock,g.upper_shelf,\n" +
" g.examine,g.deleted,g.create_time,g.update_time,gi.image_url FROM goods g LEFT JOIN goods_image gi ON (g.id=gi.id) where name like \"%\""+"#{query} "+"\"%\""+" limit #{start},#{limit}"})
@Results({
@Result(column="id",property = "id",jdbcType =
没有合适的资源?快使用搜索试试~ 我知道了~
基于Spring Boot的购物商城的设计与开发
共941个文件
jpg:246个
js:186个
png:127个
需积分: 0 13 下载量 47 浏览量
2023-03-12
15:10:22
上传
评论 2
收藏 39.7MB RAR 举报
温馨提示
项目简介: 为了简化开发并实现程序解耦,选用了Spring Boot框架去搭建后台,在此基础上使用Mybatis连接数据库,避免了繁琐的JDBC代码,利用Freemarker框架减少了业务逻辑代码在表现层的耦合并实现数据展示,从0到1设计并开发了衣物购物网站和后台一体化管理系统。实现了注册、登录、分类排序、搜索、加入购物车、订单结算、支付等功能 项目优势: 项目包含完整代码、作品图片、使用说明以及全部的数据库sql导出,即下即用 使用技术: J2EE,Spring Boot,Mybatis,Freemarker 适用人群: 想学习完整项目搭建的Java学习开发者
资源推荐
资源详情
资源评论
收起资源包目录
基于Spring Boot的购物商城的设计与开发
(941个子文件)
_DS_Store 8KB
_DS_Store 8KB
GoodsMapper.class 14KB
PayController.class 9KB
UserServiceImpl.class 6KB
CartServiceImpl.class 6KB
UserController.class 6KB
RoleController.class 5KB
RoleServiceImpl.class 5KB
MyOrderServiceImpl.class 5KB
Goods.class 4KB
MenuServiceImpl.class 4KB
Menu.class 4KB
GoodsServiceImpl.class 4KB
GoodsController.class 4KB
UserMapper.class 4KB
MainController.class 4KB
AlipayConfig.class 4KB
OrderController.class 4KB
CartController.class 4KB
OrderMapper.class 4KB
RoleMapper.class 3KB
MyOrder.class 3KB
MainController.class 3KB
CheckoutController.class 3KB
MenuController.class 3KB
User.class 3KB
Cart.class 3KB
IndexController.class 3KB
UserServiceImpl.class 2KB
CartMapper.class 2KB
SecurityAspect.class 2KB
Shipping.class 2KB
Role.class 2KB
OrderItemServcieImpl.class 2KB
MenuMapper.class 2KB
RecursiveFile.class 2KB
DeleteMenuTest.class 2KB
ShippingServiceImpl.class 2KB
WebResult.class 2KB
MybatiTest.class 2KB
GoodsService.class 1KB
OrderItem.class 1KB
CartService.class 1KB
GoodsDetailsController.class 1KB
UserService.class 1KB
MyOrderService.class 1KB
RoleService.class 1KB
StringUtils.class 1016B
AdminApplication.class 990B
WebApplication.class 978B
UploadController.class 964B
UserRole.class 937B
RoleMenu.class 937B
ShippingMapper.class 818B
Test.class 766B
Test.class 749B
MenuService.class 523B
UserService.class 466B
Context.class 439B
ShippingServcie.class 400B
UserRoleMapper.class 285B
RoleMenuMapper.class 285B
OrderItemMapper.class 284B
OrderItemService.class 278B
ace.min.css 388KB
ace.min.css 388KB
bootstrap.css 188KB
bootstrap.css 188KB
ace-part2.min.css 126KB
ace-part2.min.css 126KB
style.css 118KB
style.css 118KB
ace-rtl.min.css 114KB
ace-rtl.min.css 114KB
bootstrap.min.css 113KB
bootstrap.min.css 113KB
ace-skins.min.css 76KB
ace-skins.min.css 76KB
animate.css 74KB
animate.css 74KB
animated.css 66KB
animated.css 66KB
jquery-ui.css 36KB
jquery-ui.css 36KB
font-awesome.min.css 27KB
font-awesome.min.css 27KB
font-awesome.min.css 27KB
font-awesome.min.css 27KB
font-awesome.min.css 27KB
font-awesome.min.css 27KB
bootstrap-datepicker3.min.css 20KB
bootstrap-datepicker3.min.css 20KB
bootstrap-editable.min.css 17KB
bootstrap-editable.min.css 17KB
jquery-ui.min.css 15KB
jquery-ui.min.css 15KB
responsive.css 14KB
responsive.css 14KB
select2.min.css 14KB
共 941 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10
资源评论
程序员bling
- 粉丝: 1w+
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功