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

    }

  • 相关阅读:
    数据结构:关于重建二叉树的三种思路
    操作系统:进程调度算法详解之FCFS和SPF篇
    Java反射机制浅析
    数据挖掘:基于TF-IDF算法的数据集选取优化
    RC隔离 更新where条件列 没有索引的情况
    RR区间锁 不是唯一索引,即使区间内没值,也锁
    If one session has a shared or exclusive lock on record R in an index, another session cannot insert
    RR模式下利用区间锁防止幻读,RC模式没有区间锁会出现幻读
    使用next-key locks 用于搜索和索引扫描,可以防止幻读
    Gap Locks 区间锁
  • 原文地址:https://www.cnblogs.com/liuzhaolong/p/12921348.html
Copyright © 2011-2022 走看看