当前位置: 首页 > news >正文

商品小类管理实现B

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapperPUBLIC "-//mybatis.org//DTD Mapper 3.0//EN""http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.java1234.mapper.SmallTypeMapper"><resultMap id="smallTypeResult" type="com.java1234.entity.SmallType"><association property="bigType" column="bigTypeId" select="com.java1234.mapper.BigTypeMapper.findById"></association></resultMap><select id="list" parameterType="Map" resultMap="smallTypeResult">select * from t_smallType<where><if test="name!=null and name!='' ">and name like concat('%',#{name},'%')</if></where><if test="start!=null and pageSize!=null">limit #{start},#{pageSize}</if></select><select id="getTotal" parameterType="Map" resultType="Long">select count(*) from t_smallType<where><if test="name!=null and name!='' ">and name like concat('%',#{name},'%')</if></where></select><insert id="add" parameterType="com.java1234.entity.SmallType">insert into t_smallType values(null,#{name},#{remark},#{bigType.id});</insert><update id="update" parameterType="com.java1234.entity.SmallType">update t_smallType<set><if test="name!=null and name!=''">name=#{name},</if><if test="remark!=null and remark!=''">remark=#{remark},</if><if test="bigType.id!=null">bigTypeId=#{bigType.id},</if></set>where id=#{id}</update>
</mapper>
package com.java1234.mapper;import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.java1234.entity.BigType;
import com.java1234.entity.SmallType;import java.util.List;
import java.util.Map;/*** 商品小类Mapper接口*/
public interface SmallTypeMapper extends BaseMapper<SmallType> {List<SmallType> list(Map<String, Object> map);Long getTotal(Map<String, Object> map);/*** 添加商品小类* @param smallType* @return*/public Integer add(SmallType smallType);/*** 修改商品小类* @param smallType* @return*/public Integer update(SmallType smallType);
}
package com.java1234.service.impl;import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.java1234.entity.SmallType;
import com.java1234.mapper.SmallTypeMapper;
import com.java1234.service.ISmallTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;import java.util.List;
import java.util.Map;/*** 商品小类Service实现类*/
@Service("smallTypeService")
public class ISmallTypeServiceImpl extends ServiceImpl<SmallTypeMapper, SmallType> implements ISmallTypeService {@Autowiredprivate SmallTypeMapper smallTypeMapper;@Overridepublic List<SmallType> list(Map<String, Object> map) {return smallTypeMapper.list(map);}@Overridepublic Long getTotal(Map<String, Object> map) {return small
http://www.lryc.cn/news/225881.html

相关文章:

  • Unity--视觉组件(Raw Image,Mask)||Unity--视觉组件(Text,Image)
  • 在Node.js中,什么是事件发射器(EventEmitter)?
  • STM32——NVIC中断优先级管理分析
  • YOLOV5----修改损失函数-SimAM
  • MongoDB单实例安装(windows)
  • Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException:
  • 安卓RadioButton设置图片大小
  • 电脑怎么录制视频,录制的视频怎么剪辑?
  • 外接式网络隔离变压器/网络隔离滤波器/网口变压器/脉冲变压器/网络隔离变压器模块
  • AI:83-基于深度学习的手势识别与实时控制
  • MySQL---存储过程
  • 宠物社区系统宠物领养小程序,宠物救助小程序系统多少钱?
  • d3.js
  • okhttp关于header修改
  • pytorch代码实现注意力机制之Flatten Attention
  • 激光雷达和人工智能
  • 【算法练习Day44】最长递增子序列最长连续递增序列最长重复子数组
  • STM32H743XX/STM32H563XX芯片烧录一次后,再次上电无法烧录
  • 21. 合并两个有序链表 --力扣 --JAVA
  • Linux 基本语句_10_进程
  • 矩阵起源加入 OpenCloudOS 操作系统开源社区,完成技术兼容互认证
  • 3D物理模拟和视觉特效软件SideFX Houdini mac中文介绍
  • GPT-4.0网页平台-ChatYY
  • mysql,redis导入导出数据库数据
  • conda修改虚拟环境名称
  • c语言,将奇数和偶数分类
  • 前端设计模式之【观察者模式】
  • HTTPS安全相关-通信安全的四个特性-ssl/tls
  • 并查集:Leetcode765 情侣牵手
  • 如何设计一个网盘系统的架构