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;
    }

    }

  • 相关阅读:
    关于System.currentTimeMillis()
    jpa
    java登录密码效验
    Yum 命令语法
    yum 源的配置与使用
    通过yum安装mysql
    centos 验证mysql的安装
    rpm
    GIT 切换到远程分支
    spring mvc 官方下载
  • 原文地址:https://www.cnblogs.com/liuzhaolong/p/12921348.html
Copyright © 2011-2022 走看看