ssm框架分页详解

分页要先创建分页实体类

package com.yun.entity;

import java.util.List;

public class PageTableForm2<T> {
	private int currentPage;// 当前页
	private int pageSize = 20;// 每页记录数  可以自己定义
	private int beginIndex;// 开始位置
	private int endIndex;// 结束位置
	private int pageCount;// 共多少页
	private int userCount;// 共多少条记录

	private List<T> list;

	public PageTableForm2() {
		super();
		// TODO Auto-generated constructor stub
	}

	public PageTableForm2(int currentPage, int pageSize, int beginIndex,
			int endIndex, int pageCount, int userCount, List<T> list) {
		super();
		this.currentPage = currentPage;
		this.pageSize = pageSize;
		this.beginIndex = beginIndex;
		this.endIndex = endIndex;
		this.pageCount = pageCount;
		this.userCount = userCount;
		this.list = list;
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getBeginIndex() {
		return beginIndex;
	}

	public void setBeginIndex(int beginIndex) {
		this.beginIndex = beginIndex;
	}

	public int getEndIndex() {
		return endIndex;
	}

	public void setEndIndex(int endIndex) {
		this.endIndex = endIndex;
	}

	public int getPageCount() {
		return pageCount;
	}

	public void setPageCount(int pageCount) {
		this.pageCount = pageCount;
	}

	public int getUserCount() {
		return userCount;
	}

	public void setUserCount(int userCount) {
		this.userCount = userCount;
	}

	public List<T> getList() {
		return list;
	}

	public void setList(List<T> list) {
		this.list = list;
	}

	@Override
	public String toString() {
		return "PageTableForm2 [currentPage=" + currentPage + ", pageSize="
				+ pageSize + ", beginIndex=" + beginIndex + ", endIndex="
				+ endIndex + ", pageCount=" + pageCount + ", userCount="
				+ userCount + ", list=" + list + "]";
	}

}

先从jsp页面

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>文章管理</title>
    
	<link href="/dahenet/admin/css.css" rel="stylesheet" type="text/css" />
    <link href="/dahenet/admin/style.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="js/pony.js"></script>
	<script src="js/My97DatePicker/WdatePicker.js"
			type="text/javascript"></script>
	<style type="text/css">
	<!--
	body {
		margin-left: 0px;
		margin-top: 0px;
		margin-right: 0px;
		margin-bottom: 0px;
	}
	.tabfont01 {	
		font-family: "宋体";
		font-size: 9px;
		color: #555555;
		text-decoration: none;
		text-align: center;
	}
	.font051 {font-family: "宋体";
		font-size: 12px;
		color: #333333;
		text-decoration: none;
		line-height: 20px;
	}
	.font201 {font-family: "宋体";
		font-size: 12px;
		color: #FF0000;
		text-decoration: none;
	}
	.button {
		font-family: "宋体";
		font-size: 14px;
		height: 37px;
	}
	html { overflow-x: auto; overflow-y: auto; border:0;} 
	-->
	</style>
	<script type="text/javascript" src="/dahenet/js/jquery-1.4.4.min.js"></script>
	<script type="text/javascript">
	
	function selectAll(){
		var obj = document.fom.elements;
		for (var i=0;i<obj.length;i++){
			if (obj[i].name == "articlelistIds"){
				obj[i].checked = true;
			}
		}
	}
	
	function unselectAll(){
		var obj = document.fom.elements;
		for (var i=0;i<obj.length;i++){
			if (obj[i].name == "articlelistIds"){
				if (obj[i].checked==true) obj[i].checked = false;
				else obj[i].checked = true;
			}
		}
	}
	//--------------------------------------以下为分页
	$(function() {
		$("#Submit4").click(function(){//点击查询分页跳转到第一页
		           var currentPage = 1;
	                    $("#currentPage").val(currentPage);
	                    $("#fom").submit();
	                    
		     });
	     $("#first").click(function(){//首页跳转
                 var currentPage = 1;
                    $("#currentPage").val(currentPage);
                    $("#fom").submit();
        }); 
        $("#prev").click(//上一页
                function() {
                    var currentPage = parseInt($("#currentPage").val()) - 1;
                    $("#currentPage").val(currentPage);
                    $("#fom").submit();
                });

        $("#next").click(//下一页
                function() {
                    var currentPage = parseInt($("#currentPage").val()) + 1;
                    $("#currentPage").val(currentPage);
                    $("#fom").submit();
                });
        $("#last").click(function(){//最后一页
                 var currentPage = ${tals.pageCount};
                    $("#currentPage").val(currentPage);
                    $("#fom").submit();
        }); 
        
        //-------------------------------------------------------
        //多选删除
        $("#Submit").click(function(){
			   var ids=[];
			   $("input[name='articlelistIds']:checked").each(function(i) {//把所有被选中的复选框的值存入数组
							ids[i] = $(this).val();
						});
               $.ajax({
                   url : "/dahenet/deleteall.action", // 要提交的URL路径
				   type : "post", // 发送请求的方式
				   data : {"ids":ids}, // 要发送到服务器的数据
				   traditional:true,
				   success:function(msg){
					      location.href = "http://localhost:8080/dahenet"+msg;
				   }
               });
			});
		})
	</script>

  </head>
  
  <body>
    <form name="fom" id="fom" method="post" action="/dahenet/findarticles.action" >
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
    	<td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td height="62" background="/dahenet/admin/images/nav04.gif">
		<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td width="21"><img src="/dahenet/admin/images/ico07.gif" width="20" height="18" /></td>
		<td width="538">
		按报纸名称:<input name="newsname" type="text" size="12" id="newsname" value="${newsname}"/>
		文章名称:<input name="filetitle" type="text" size="12" id="filetitle" value="${filetitle }"/>
		按日期:
			<input name="fdate" type="text" size="12" class="Wdate" "WdatePicker({dateFmt:'yyyy-MM-dd'})" value="${fdate}"/>
			<span class="newfont06">至</span>
			<input name="edate" type="text" size="12" class="Wdate" "WdatePicker({dateFmt:'yyyy-MM-dd'})" value="${edate}"/>
			<input name="Submit4" id="Submit4" type="button" class="right-button02" value="查 询" "check();" />
		</td>
	</tr>
	 	</table>
	 	</td>
    </tr>
    					</table>
    </td></tr>
    <tr>
    	<td><table id="subtree1" style="DISPLAY: " width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td height="20"><span class="newfont07">选择:<a href="#" class="right-font08" "selectAll();">全选</a>-<a href="#" class="right-font08" "unselectAll();">反选</a></span>
	    <input name="Submit" id="Submit" type="button" class="right-button08" value="删除所选文章" />
	    <a href="/dahenet/admin/ArticleAdd.jsp"><input name="Submit2" id="Submit2" type="button" class="right-button08" value="添加文章" /></a>
    <tr>
        <td height="40" class="font42">
	    <table width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#464646" class="newfont03">
	<tr class="CTitle" >
        <td height="22" colspan="16" align="center" style="font-size:16px">文章列表</td>
    </tr>
    
    <tr bgcolor="#EEEEEE">
		<td width="5%" align="center" height="30">选择</td>
		<td width="8%" align="center">报纸名称</td>
		<td width="8%" align="center">日期</td>
        <td width="6%" align="center">期次</td>
		<td width="6%" align="center">版次号</td>
		<td width="5%" align="center">版名</td>
		<td width="6%" align="center">pdf路径</td>
		<td width="6%" align="center">版面图</td>
		<td width="8%" align="center">文章标题</td>
		<td width="8%" align="center">文章作者</td>
		<td width="8%" align="center">发表时间</td>
		<td width="8%" align="center">操作</td>
     </tr>
    
     <c:forEach items="${tals.list}" var="tals">
		<tr bgcolor="#FFFFFF">
			<td height="20" align="center"><input type="checkbox" name="articlelistIds" id="articlelistIds" value="${tals.id }"/></td>
			<td align="center">${tals.newspname }</td>
			<td align="center">
			<fmt:formatDate value="${tals.newspdate }" pattern="yyyy-MM-dd"/>
			</td>
			<td align="center">${tals.newspissue }</td>
			<td align="center">${tals.newsprev }</td>
			<td align="center">${tals.layoutname }</td>
			<td align="center">${tals.pdfpath }</td>
			<td align="center">${tals.layoutplans }</td>
			<td align="center"><a href="${tals.urlpath }" target="_blank" >${tals.filetitle }</a></td>
			
			<td align="center">${tals.fileauthor }</td>
			<td align="center">
			<fmt:formatDate value="${tals.dateline }" pattern="yyyy-MM-dd HH:mm:ss"/>
			</td>
	        <td align="center"><a href='/dahenet/updateArticleByid.action?id=${tals.id }'>编辑|</a>
			<a href='/dahenet/deleteArticleByid.action?id=${tals.id }'>删除</a></td>
        </tr>
       </c:forEach>
       <tr>
           <td align="center" colspan="2">
                        <c:if test="${tals.currentPage > 1}">
                            <input id="first" type="button" value="首页">
                        </c:if>
            </td>
            <td align="center" colspan="3">
                        <c:if test="${tals.currentPage > 1}">
                            <input id="prev" type="button" value="上一页">
                        </c:if>
            </td>
            <td align="center" colspan="3">
                                                          当前<label>${tals.currentPage}</label>页/共<label>${tals.pageCount}</label>页
            </td>
            <td align="center" colspan="3">
                        <c:if test="${tals.currentPage < tals.pageCount}">
                            <input id="next" type="button" value="下一页">
                        </c:if>
            </td>
            <td align="center" colspan="2">
                        <c:if test="${tals.currentPage < tals.pageCount}">
                            <input id="last" type="button" value="尾页">
                        </c:if>
            </td>
        </tr>
    </table>
    <input id="currentPage" type="hidden" name="currentPage" value="${tals.currentPage}">
    </td></tr>
    	</table>
    	<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td height="6"><img src="images/spacer.gif" width="1" height="1" /></td>
    </tr>
    <tr>
        <td height="33"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="right-font08">
    <tr>
    <tfoot>
         
	 </tfoot>
	</table></td></tr></table></td></tr></table></td></tr></table>
	</form>
  </body>
</html>

controller层

package com.yun.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.yun.entity.PageTableForm2;
import com.yun.entity.TNewspArticleList;
import com.yun.entity.TNewspLayoutList;
import com.yun.entity.TNewspaperList;
import com.yun.service.TNewspArticleListService;

@Controller
public class TNewspArticleListController {
	@Autowired
	TNewspArticleListService tNewspArticleListService;
	//查询所有
	@RequestMapping("/findarticles.action")
     public String findarticles(Model model,PageTableForm2<TNewspArticleList> pageTableForm2,String newsname,String filetitle,String fdate,String edate){
		System.out.println(newsname);
		System.out.println(filetitle);
		System.out.println(fdate);
		System.out.println(edate);
		//当前是第几页
		 int currentPage = pageTableForm2.getCurrentPage() == 0 ? 1 : pageTableForm2.getCurrentPage();
		//给当前页赋值
		 pageTableForm2.setCurrentPage(currentPage);
		//对象接收数据
	     pageTableForm2 = tNewspArticleListService.findarticles(pageTableForm2,newsname,filetitle,fdate,edate);
	     model.addAttribute("tals", pageTableForm2);
	     model.addAttribute("newsname",newsname);
	     model.addAttribute("filetitle",filetitle);
	     model.addAttribute("fdate",fdate);
	     model.addAttribute("edate",edate);
		return "ArticleManage";
    	 
     }
	//删除信息Byid
	@RequestMapping("/deleteArticleByid.action")
	public String deletearticles(String id){
		tNewspArticleListService.deleteArticle(id);
		return "redirect:/findarticles.action";
	}
	
//二级联动
	@RequestMapping("/getnewsname.action")
	@ResponseBody
	public List<TNewspaperList> getnewsname(){
		List<TNewspaperList> tNewspaperLists = tNewspArticleListService.findnewspapername();
		return tNewspaperLists;
	}
	@RequestMapping("/getlayoutname.action")
	@ResponseBody
	public List<TNewspLayoutList> getlayoutname(String newspno){
		List<TNewspLayoutList> tNewspLayoutLists=tNewspArticleListService.findlayoutname(newspno);
		return tNewspLayoutLists;
		
	}
	//添加信息
	@RequestMapping("/addArticle.action")
	public String addArticle(TNewspArticleList tNewspArticleList){
		tNewspArticleListService.addArticle(tNewspArticleList);
		return "redirect:/findarticles.action";
		
	}
	//通过id获取一条数据     修改数据
	@RequestMapping("/updateArticleByid.action")
	public String updateArticleByid(Model model,String id){
		TNewspArticleList tNewspArticleList=tNewspArticleListService.updateArticleByid(id);
		model.addAttribute("tpl", tNewspArticleList);
		return "ArticleUpdate";
		
	}
	//更新数据
	@RequestMapping("/updateArticle.action")
	public String updateArticle(TNewspArticleList tNewspArticleList){
		tNewspArticleListService.updateArticle(tNewspArticleList);
		return "redirect:/findarticles.action";
		
	}
	//删除选中数据
	@RequestMapping("/deleteall.action")
	@ResponseBody
	public String deleteall(@RequestParam(value="ids") String[] ids){
		if(ids!=null){
			for(int i=0;i<ids.length;i++){
				String id=ids[i];
				tNewspArticleListService.deleteArticle(id);
			}
		}
		return "/findarticles.action";
	}
}

service层

package com.yun.service;

import java.util.List;
import java.util.Map;

import com.yun.entity.PageTableForm2;
import com.yun.entity.TNewspArticleList;
import com.yun.entity.TNewspLayoutList;
import com.yun.entity.TNewspaperList;

public interface TNewspArticleListService {
	// 查询所有
	PageTableForm2<TNewspArticleList> findarticles(PageTableForm2<TNewspArticleList> pageTableForm2,String newsname, String filetitle, String fdate, String edate);

	// 获取数据条数
	int getCount(Map<String, Object> map);

	// 获取所有报纸名
	List<TNewspaperList> findnewspapername();

	// 获取所有板块名
	List<TNewspLayoutList> findlayoutname(String newspno);

	// 添加一条数据
	void addArticle(TNewspArticleList tNewspArticleList);

	// 删除一条信息
	void deleteArticle(String id);

	//根据id查询一条数据
	TNewspArticleList updateArticleByid(String id);
	
    //更新数据
	void updateArticle(TNewspArticleList tNewspArticleList);
}

serviceImpl层

package com.yun.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yun.entity.PageTableForm2;
import com.yun.entity.TNewspArticleList;
import com.yun.entity.TNewspLayoutList;
import com.yun.entity.TNewspaperList;
import com.yun.mapper.TNewspArticleListMapper;
import com.yun.service.TNewspArticleListService;
@Service
public class TNewspArticleListServiceImpl implements TNewspArticleListService{
	@Autowired
   TNewspArticleListMapper tNewspArticleListMapper;
	List<TNewspArticleList> tNewspArticleLists;
	//获取所有数据信息  和分页
	@Override
	public PageTableForm2<TNewspArticleList> findarticles(PageTableForm2<TNewspArticleList> pageTableForm2,String newsname, String filetitle, String fdate, String edate) {
		//创建一个map接收参数
        Map<String, Object> map=new HashMap<String, Object>();
		//每页开始索引
        int beginIndex = (pageTableForm2.getCurrentPage()-1)*pageTableForm2.getPageSize();
        System.out.println(beginIndex);
        //每页结束索引
        int endIndex=beginIndex+pageTableForm2.getPageSize();
        //向map中放参数
        map.put("beginIndex", beginIndex);
        map.put("endIndex", endIndex);
        map.put("newsname", newsname);
        map.put("filetitle", filetitle);
        map.put("fdate", fdate);
        map.put("edate", edate);
        
        pageTableForm2 = getOperation(pageTableForm2,map);
        tNewspArticleLists = tNewspArticleListMapper.findarticles(map);
        pageTableForm2.setList(tNewspArticleLists);
		return pageTableForm2;
	}
	
	//分页
	public PageTableForm2<TNewspArticleList> getOperation(PageTableForm2<TNewspArticleList> pageTableForm2,Map<String, Object> map){
		pageTableForm2.setUserCount(getCount(map));
        if (pageTableForm2.getUserCount() % 20 == 0) {
            pageTableForm2.setPageCount(pageTableForm2.getUserCount() / pageTableForm2.getPageSize());
        } else {
            pageTableForm2.setPageCount((pageTableForm2.getUserCount() / pageTableForm2.getPageSize()) + 1);
        }
        
        pageTableForm2.setBeginIndex(pageTableForm2.getCurrentPage() * 20 - 20);
        pageTableForm2.setEndIndex(pageTableForm2.getCurrentPage() * 20);
		return pageTableForm2;
	}
	//获取数据条数
	@Override
	public int getCount(Map<String, Object> map) {
		return tNewspArticleListMapper.getCount(map);
	}
    //获取报纸名
	@Override
	public List<TNewspaperList> findnewspapername() {
		return tNewspArticleListMapper.findnewspapername();
	}
   //获取版名
	@Override
	public List<TNewspLayoutList> findlayoutname(String newspno) {
		return tNewspArticleListMapper.findlayoutname(newspno);
	}

	@Override
	public void addArticle(TNewspArticleList tNewspArticleList) {
		tNewspArticleListMapper.addArticle(tNewspArticleList);
	}

	@Override
	public void deleteArticle(String id) {
		tNewspArticleListMapper.deleteArticle(id);
	}
    //根据id获取信息
	@Override
	public TNewspArticleList updateArticleByid(String id) {
		return tNewspArticleListMapper.updateArticleByid(id);
	}
    //更新一条信息
	@Override
	public void updateArticle(TNewspArticleList tNewspArticleList) {
		tNewspArticleListMapper.updateArticle(tNewspArticleList);
	}

}

mapper.java层

package com.yun.mapper;

import java.util.List;
import java.util.Map;

import com.yun.entity.TNewspArticleList;
import com.yun.entity.TNewspLayoutList;
import com.yun.entity.TNewspaperList;

public interface TNewspArticleListMapper {

	// 获取页面信息
	List<TNewspArticleList> findarticles(Map<String, Object> map);

	// 获取所有数据总条数
	int getCount(Map<String, Object> map);

	// 获取所有报纸名
	List<TNewspaperList> findnewspapername();

	// 获取所有板块名
	List<TNewspLayoutList> findlayoutname(String newspno);

	// 添加一条数据
	void addArticle(TNewspArticleList tNewspArticleList);
	
	//删除一条信息
	void deleteArticle(String id);
    //根据id获取一条信息
	TNewspArticleList updateArticleByid(String id);
   //更新一条信息
	void updateArticle(TNewspArticleList tNewspArticleList);

}

mapper.xml层

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yun.mapper.TNewspArticleListMapper" >
     <!-- 获取报名    NewsPNO-->
     <select id="findnewspapername" resultType="TNewspaperList">
      select ID id,NewsPName newspname from t_newspaper_list
     </select>
     <!-- 获取版名    -->
     <select id="findlayoutname" parameterType="String" resultType="TNewspLayoutList">
     select ID id,NewsPNO newspno,LayoutName layoutname from t_newsp_layout_list where NewsPNO=#{newspno}
     </select>
     <!-- 获取文章列表信息 -->
     <select id="findarticles" parameterType="HashMap" resultType="TNewspArticleList">
     select t1.ID id,t1.NewsPNO newspno,t2.NewsPName newspname,t1.NewsPDate newspdate,t1.NewsPIssue newspissue,t1.NewsPrev newsprev,t1.NPLayoutNO nplayoutno,t3.LayoutName layoutname,t1.PDFPath pdfpath,t1.LayoutPlans layoutplans,t1.FileTitle filetitle,t1.FileAuthor fileauthor,t1.Dateline dateline,t1.URLPath urlpath
     from (t_newsp_article_list t1 left join t_newspaper_list t2 on t1.NewsPNO=t2.ID) left join t_newsp_layout_list t3
     on t1.NPLayoutNO=t3.ID where 1=1 
     <if test="newsname!=null and newsname!='' ">
        and t2.NewsPName like concat('%',#{newsname},'%')
     </if>
     <if test="filetitle!=null and filetitle!='' ">
        and t1.FileTitle like concat('%',#{filetitle},'%')
     </if>
     <if test="fdate!=null and fdate!='undefined'  and fdate!='' ">
        and t1.Dateline &gt;= #{fdate}
     </if>
     <if test="edate!=null and edate!='undefined' and edate!='' ">
        and t1.Dateline &lt;= #{edate}
     </if>
     limit #{beginIndex},#{endIndex}
     </select>
     <!-- 获取总数据的条数 -->
     <select id="getCount" resultType="int" parameterType="HashMap">
     select count(*)
     from (t_newsp_article_list t1 left join t_newspaper_list t2 on t1.NewsPNO=t2.ID) left join t_newsp_layout_list t3
     on t1.NPLayoutNO=t3.ID where 1=1
     <if test="newsname!=null and newsname!='' ">
        and t2.NewsPName like concat('%',#{newsname},'%')
     </if>
     <if test="filetitle!=null and filetitle!='' ">
        and t1.FileTitle like concat('%',#{filetitle},'%')
     </if>
     <if test="fdate!=null and fdate!='undefined'  and fdate!='' ">
        and t1.Dateline &gt;= #{fdate}
     </if>
     <if test="edate!=null and edate!='undefined' and edate!='' ">
        and t1.Dateline &lt;= #{edate}
     </if>
     </select>
     <!-- 添加一条信息 -->
     <insert id="addArticle" parameterType="TNewspArticleList">
     insert into 
      t_newsp_article_list(NewsPNO,NewsPDate,NewsPIssue,NewsPrev,NPLayoutNO,PDFPath,LayoutPlans,FileTitle,FileAuthor,FileContent,Dateline,Summary) 
      values(#{newspno},#{newspdate},#{newspissue},#{newsprev},#{nplayoutno},#{pdfpath},#{layoutplans},#{filetitle},#{fileauthor},#{filecontent},NOW(),#{summary})
     </insert>
     <!-- 删除一条信息 -->
     <delete id="deleteArticle" parameterType="String">
     delete from t_newsp_article_list where ID=#{id}
     </delete>
     <!-- 根据id获取数据 -->
     <select id="updateArticleByid" parameterType="String" resultType="TNewspArticleList">
     select t1.ID id,t1.NewsPNO newspno,t2.NewsPName newspname,t1.NewsPDate newspdate,t1.NewsPIssue newspissue,t1.NewsPrev newsprev,t1.NPLayoutNO nplayoutno,t3.LayoutName layoutname,t1.PDFPath pdfpath,t1.LayoutPlans layoutplans,t1.FileTitle filetitle,t1.FileAuthor fileauthor,t1.Summary summary,t1.FileContent filecontent,t1.Dateline dateline
     from (t_newsp_article_list t1 left join t_newspaper_list t2 on t1.NewsPNO=t2.ID) left join t_newsp_layout_list t3
     on t1.NPLayoutNO=t3.ID 
     where t1.ID=#{id}
     </select>
     <!-- 更新一条数据 -->
     <update id="updateArticle" parameterType="TNewspArticleList">
     update t_newsp_article_list set NewsPNO=#{newspno},NewsPDate=#{newspdate},NewsPIssue=#{newspissue},NewsPrev=#{newsprev},NPLayoutNO=#{nplayoutno},PDFPath=#{pdfpath},LayoutPlans=#{layoutplans},FileTitle=#{filetitle},FileAuthor=#{fileauthor},FileContent=#{filecontent},Summary=#{summary} where ID=#{id}
     </update>
</mapper>

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值