jeefast 框架(SpringBoot+Mybatis-Plus+Bootstrap+Vue)实现选中那条 导出那条
在做后台系统的时候看经常会遇到导入和导出数据 ,今天分享一下怎么做导出以及选中那条导出那条
自动生成代码等省略
第一步:
在生成的.xml文件中书写sql语句:
<select id="selectBatchIds" resultType="cn.jeefast.stu.entity.StuStudent">
SELECT s.*,c.`cname` ccName FROM stu_student s
LEFT JOIN stu_class c ON s.`ccid`=c.`cid`
where sid in
<foreach item="ids" collection="list" open="(" separator="," close=")">
#{
ids}
</foreach>
</select>
在这里用到的是selectBatchIds
这个方法,这个是基类的方法,是不需要在service ,impl,dao等文件中声明 ,因为已经默认继承了 collection=“list”,等于list的原因也是因为selectBatchIds
这个方法只认list类型的,
var noticeIds = getSelectedRows();
if(noticeIds == null){
var ids=0;
}else{
var ids=noticeIds.join