新增DAO批量更新语句,动态ExecutorType指定

This commit is contained in:
thinkgem
2022-06-06 23:39:32 +08:00
parent 51cbd7b945
commit 91319555f6
2 changed files with 46 additions and 51 deletions

View File

@@ -90,10 +90,10 @@ $('#dataGrid').dataGrid({
{header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){
var actions = [];
if(row.status == Global.STATUS_DRAFT){
<% if(hasPermi('msg:msgInner:edit')){ %>
//<% if(hasPermi('msg:msgInner:edit')){ %>
actions.push('<a href="${ctx}/msg/msgInner/form?id='+row.id+'" class="btnList" title="${text("编辑消息")}"><i class="fa fa-pencil"></i></a>&nbsp;');
actions.push('<a href="${ctx}/msg/msgInner/delete?id='+row.id+'" class="btnList" title="${text("删除消息")}" data-confirm="${text("确认要删除该消息吗?")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
<% } %>
//<% } %>
}else{
actions.push('<a href="${ctx}/msg/msgInner/view?id='+row.id+'" class="btnList" title="${text("查看消息")}"><i class="fa fa-book"></i></a>&nbsp;');
}

View File

@@ -4,19 +4,17 @@
*/
package com.jeesite.test;
import java.util.List;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import com.jeesite.common.callback.MethodCallback;
import com.jeesite.common.collect.ListUtils;
import com.jeesite.common.tests.BaseSpringContextTests;
import com.jeesite.modules.Application;
import com.jeesite.modules.test.dao.TestDataDao;
import com.jeesite.modules.test.entity.TestData;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import java.util.List;
/**
* 批量插入测试
@@ -38,14 +36,11 @@ public class InsertBatchTest extends BaseSpringContextTests {
testData.setTestInput("test"+i);
list.add(testData);
}
ListUtils.pageList(list, 100, new MethodCallback() {
@SuppressWarnings("unchecked")
public Object execute(Object... objs) {
return testDataDao.insertBatch((List<TestData>)objs[0]);
}
});
testDataDao.insertBatch(list, null);
list = testDataDao.findList(new TestData());
System.out.println("size: " + list.size());
long count = testDataDao.updateBatch(list, null);
System.out.println("update: " + count);
}
}