zoukankan      html  css  js  c++  java
  • 多对一的增删改查-service和impl

    package com.lzl.service;

    import java.util.List;

    import com.github.pagehelper.PageInfo;
    import com.lzl.pojo.Company;
    import com.lzl.pojo.Pantent;

    public interface PantentService {
    /**
    * 列表展示
    * @param pageNum
    * @param pageSize
    * @return
    */
    PageInfo<Pantent> list(Integer pageNum,Integer pageSize,Pantent pantent);
    /**
    * 总销售额
    * @return
    */
    Pantent zong();
    /**
    * 所有单位
    * @return
    */
    List<Company> coms();
    /**
    * 添加
    * @param pantent
    * @return
    */
    int add(Pantent pantent);
    /**
    * 分组查询奖励
    * @return
    */
    List<Pantent> tongji();
    /**
    * 查询单条数据
    * @param id
    * @return
    */
    Pantent selectOne(Integer id);
    /**
    * 执行修改
    * @param pantent
    * @return
    */
    int update(Pantent pantent);

    }

    --------------------------------------------------------------------------------

    package com.lzl.service.impl;

    import java.util.List;

    import org.apache.dubbo.config.annotation.Service;
    import org.springframework.beans.factory.annotation.Autowired;

    import com.github.pagehelper.PageHelper;
    import com.github.pagehelper.PageInfo;
    import com.lzl.dao.PantentDao;
    import com.lzl.pojo.Company;
    import com.lzl.pojo.Pantent;
    import com.lzl.service.PantentService;

    @Service
    public class PantentServiceImpl implements PantentService {

    @Autowired
    PantentDao dao;

    @Override
    public PageInfo<Pantent> list(Integer pageNum, Integer pageSize,Pantent pantent) {
    PageHelper.startPage(pageNum, pageSize);
    List<Pantent> list = dao.list(pantent);
    return new PageInfo<Pantent>(list);
    }


    @Override
    public Pantent zong() {
    // TODO Auto-generated method stub
    Pantent pz = dao.zong();
    return pz;
    }


    @Override
    public List<Company> coms() {
    // TODO Auto-generated method stub
    List<Company> coms = dao.coms();
    return coms;
    }


    @Override
    public int add(Pantent pantent) {
    // TODO Auto-generated method stub
    int i = dao.add(pantent);
    return i;
    }


    @Override
    public List<Pantent> tongji() {
    List<Pantent> list = dao.tongji();
    return list;
    }


    @Override
    public Pantent selectOne(Integer id) {
    // TODO Auto-generated method stub
    Pantent pantent = dao.selectOne(id);
    return pantent;
    }


    @Override
    public int update(Pantent pantent) {
    // TODO Auto-generated method stub
    int i = dao.update(pantent);
    return i;
    }

    }

  • 相关阅读:
    File初识和练习
    图床
    servlet
    css伪类及伪元素用法
    css中的定位position
    块级元素与行级元素
    清除浮动
    CSS浮动
    fastjson 1.2.6以下版本 解析字符串末尾出现/x会陷入死循环 报oom异常
    记一次select2赋值动态数组的坑
  • 原文地址:https://www.cnblogs.com/liuzhaolong/p/12921348.html
Copyright © 2011-2022 走看看