增加设置转科用户查阅
parent
99b981a314
commit
99e0ce39c5
@ -0,0 +1,65 @@
|
||||
package com.emr.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.emr.entity.ArchiveRemindDeptUser;
|
||||
import com.emr.entity.ArchiveTransferDeptUser;
|
||||
import com.emr.service.ArchiveTransferDeptUserService;
|
||||
import com.emr.util.ExceptionPrintUtil;
|
||||
import com.emr.util.Msg;
|
||||
import com.emr.vo.CommomTree;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ProjectName:
|
||||
* @Description:
|
||||
* @Param 传输参数
|
||||
* @Return
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2020/11/5 17:07
|
||||
* @UpdateUser: 曾文和
|
||||
* @UpdateDate: 2020/11/5 17:07
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("transferDeptUser")
|
||||
public class ArchiveTransferDeptUserController {
|
||||
@Autowired
|
||||
private ArchiveTransferDeptUserService transferDeptUserService;
|
||||
/**
|
||||
* 科室用户树
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="selectTranferDeptUserTree",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public List<CommomTree> selectTranferDeptUserTree(String deptName, String masterId){
|
||||
try {
|
||||
return transferDeptUserService.selectTranferDeptUserTree(deptName,masterId);
|
||||
} catch (Exception e) {
|
||||
ExceptionPrintUtil.printException(e);
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存选中项
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="updateTransferDeptUserSet")
|
||||
@ResponseBody
|
||||
public Msg updateTransferDeptUserSet(String jsonStr, HttpServletRequest request) throws Exception{
|
||||
//json字符串转换成list集合
|
||||
List<ArchiveTransferDeptUser> list = JSON.parseArray(jsonStr, ArchiveTransferDeptUser.class);
|
||||
//批量添加
|
||||
transferDeptUserService.updateTransferDeptUserSet(list,request);
|
||||
return Msg.success();
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.emr.dao;
|
||||
|
||||
import com.emr.entity.ArchiveTransferDeptUser;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ArchiveTransferDeptUserMapper extends CommomMapper{
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(ArchiveTransferDeptUser record);
|
||||
|
||||
int insertSelective(ArchiveTransferDeptUser record);
|
||||
|
||||
ArchiveTransferDeptUser selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(ArchiveTransferDeptUser record);
|
||||
|
||||
int updateByPrimaryKey(ArchiveTransferDeptUser record);
|
||||
|
||||
List<ArchiveTransferDeptUser> selectAllByMasterId(@Param("masterId")String masterId);
|
||||
|
||||
void deleteTransferDeptUserByMasterId(@Param("masterId")String masterId);
|
||||
}
|
@ -0,0 +1,139 @@
|
||||
package com.emr.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
public class ArchiveTransferDeptUser implements Serializable {
|
||||
private Integer id;
|
||||
|
||||
private String masterId;
|
||||
|
||||
private String userName;
|
||||
|
||||
private String deptCode;
|
||||
|
||||
private String createUser;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private String remark;
|
||||
|
||||
private Integer int1;
|
||||
|
||||
private Integer int2;
|
||||
|
||||
private String str1;
|
||||
|
||||
private String str2;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getMasterId() {
|
||||
return masterId;
|
||||
}
|
||||
|
||||
public void setMasterId(String masterId) {
|
||||
this.masterId = masterId == null ? null : masterId.trim();
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName == null ? null : userName.trim();
|
||||
}
|
||||
|
||||
public String getDeptCode() {
|
||||
return deptCode;
|
||||
}
|
||||
|
||||
public void setDeptCode(String deptCode) {
|
||||
this.deptCode = deptCode == null ? null : deptCode.trim();
|
||||
}
|
||||
|
||||
public String getCreateUser() {
|
||||
return createUser;
|
||||
}
|
||||
|
||||
public void setCreateUser(String createUser) {
|
||||
this.createUser = createUser == null ? null : createUser.trim();
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark == null ? null : remark.trim();
|
||||
}
|
||||
|
||||
public Integer getInt1() {
|
||||
return int1;
|
||||
}
|
||||
|
||||
public void setInt1(Integer int1) {
|
||||
this.int1 = int1;
|
||||
}
|
||||
|
||||
public Integer getInt2() {
|
||||
return int2;
|
||||
}
|
||||
|
||||
public void setInt2(Integer int2) {
|
||||
this.int2 = int2;
|
||||
}
|
||||
|
||||
public String getStr1() {
|
||||
return str1;
|
||||
}
|
||||
|
||||
public void setStr1(String str1) {
|
||||
this.str1 = str1 == null ? null : str1.trim();
|
||||
}
|
||||
|
||||
public String getStr2() {
|
||||
return str2;
|
||||
}
|
||||
|
||||
public void setStr2(String str2) {
|
||||
this.str2 = str2 == null ? null : str2.trim();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getClass().getSimpleName());
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", id=").append(id);
|
||||
sb.append(", masterId=").append(masterId);
|
||||
sb.append(", userName=").append(userName);
|
||||
sb.append(", deptCode=").append(deptCode);
|
||||
sb.append(", createUser=").append(createUser);
|
||||
sb.append(", createTime=").append(createTime);
|
||||
sb.append(", remark=").append(remark);
|
||||
sb.append(", int1=").append(int1);
|
||||
sb.append(", int2=").append(int2);
|
||||
sb.append(", str1=").append(str1);
|
||||
sb.append(", str2=").append(str2);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,180 @@
|
||||
package com.emr.service;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.emr.dao.ArchiveTransferDeptUserMapper;
|
||||
import com.emr.entity.ArchiveTransferDeptUser;
|
||||
import com.emr.entity.Emr_Dictionary;
|
||||
import com.emr.entity.Power_User;
|
||||
import com.emr.service.ipml.CommomService;
|
||||
import com.emr.service.ipml.StatisticsService;
|
||||
import com.emr.vo.CommomTree;
|
||||
import com.emr.vo.User;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.util.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ProjectName:
|
||||
* @Description:
|
||||
* @Param 传输参数
|
||||
* @Return
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2020/11/5 17:09
|
||||
* @UpdateUser: 曾文和
|
||||
* @UpdateDate: 2020/11/5 17:09
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional
|
||||
public class ArchiveTransferDeptUserService {
|
||||
@Autowired
|
||||
private Emr_DictionaryService dictionaryService;
|
||||
@Autowired
|
||||
private StatisticsService statisticsService;
|
||||
@Autowired
|
||||
private ArchiveTransferDeptUserMapper transferDeptUserMapper;
|
||||
@Autowired
|
||||
private CommomService commomService;
|
||||
public List<CommomTree> selectTranferDeptUserTree(String deptName, String masterId) throws Exception {
|
||||
//查询科室
|
||||
List<Emr_Dictionary> dictionaries = dictionaryService.dicByClo(new Emr_Dictionary());
|
||||
List<CommomTree> list = new ArrayList<>();
|
||||
if(!CollectionUtils.isEmpty(dictionaries)){
|
||||
//查询用户信息
|
||||
List<User> userList = statisticsService.getUserList();
|
||||
if(!CollectionUtils.isEmpty(userList)){
|
||||
//查询有选中的用户
|
||||
List<ArchiveTransferDeptUser> transferDeptUsers = transferDeptUserMapper.selectAllByMasterId(masterId);
|
||||
//定义角色id集合
|
||||
String roleListJson = "[" +
|
||||
"{'roleId':1,roleName:'医生'}," +
|
||||
"{'roleId':5,roleName:'医生质控员'}," +
|
||||
"{'roleId':6,roleName:'科主任'}," +
|
||||
"{'roleId':2,roleName:'护士'}," +
|
||||
"{'roleId':8,roleName:'护士质控员'}," +
|
||||
"{'roleId':7,roleName:'护士长'}," +
|
||||
"{'roleId':3,roleName:'病案室人员'}" +
|
||||
"]";
|
||||
List<User> roleList = JSON.parseArray(roleListJson, User.class);
|
||||
//设定用户id从20000开始
|
||||
int id = 1;
|
||||
int twoParentId = 0;
|
||||
int threeParentId = 0;
|
||||
//组织用户
|
||||
for(Emr_Dictionary dictionary : dictionaries) {
|
||||
//获取科室编码
|
||||
String code = dictionary.getCode();
|
||||
if(StringUtils.isNotBlank(code) && !dictionary.getName().equals(deptName)) {
|
||||
//第一层,科室层
|
||||
CommomTree tree1 = new CommomTree();
|
||||
tree1.setId(id);
|
||||
twoParentId = id;
|
||||
id++;
|
||||
tree1.setCode(dictionary.getCode());
|
||||
tree1.setName(dictionary.getName());
|
||||
tree1.setParentId(0);
|
||||
//过滤字典类别科室 科室code=null
|
||||
//定义存在用户的科室
|
||||
boolean deptFlag = false;
|
||||
boolean deptCheckedFlag = false;
|
||||
for(User role : roleList){
|
||||
//第二层,审核角色层
|
||||
CommomTree tree2 = new CommomTree();
|
||||
tree2.setId(id);
|
||||
threeParentId = id;
|
||||
id++;
|
||||
tree2.setParentId(twoParentId);
|
||||
tree2.setName(role.getRoleName());
|
||||
//定义存在用户的角色
|
||||
boolean roleFlag = false;
|
||||
boolean roleCheckedFlag = false;
|
||||
for (User user : userList) {
|
||||
//第三层,用户层
|
||||
//获取用户所属科室
|
||||
String deptCode = user.getDeptCode();
|
||||
if (StringUtils.isNotBlank(deptCode) && deptCode.equals(code) && role.getRoleId().equals(user.getRoleId())) {
|
||||
CommomTree tree3 = new CommomTree();
|
||||
tree3.setId(id);
|
||||
id++;
|
||||
tree3.setParentId(threeParentId);
|
||||
String name = user.getName();
|
||||
if(StringUtils.isNotBlank(name)){
|
||||
tree3.setName(user.getUserName() + "-" + name);
|
||||
}else{
|
||||
tree3.setName(user.getUserName());
|
||||
}
|
||||
//设置工号
|
||||
tree3.setRealName(user.getUserName());
|
||||
//设置科室编号
|
||||
tree3.setCode(deptCode);
|
||||
//设置角色id
|
||||
tree3.setRealParentId(user.getRoleId());
|
||||
//判断是否用户选中
|
||||
if(!CollectionUtils.isEmpty(transferDeptUsers)){
|
||||
for(ArchiveTransferDeptUser userTemp : transferDeptUsers){
|
||||
if(userTemp.getUserName().equals(user.getUserName())){
|
||||
tree3.setChecked("true");
|
||||
deptCheckedFlag = true;
|
||||
roleCheckedFlag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
list.add(tree3);
|
||||
deptFlag = true;
|
||||
roleFlag = true;
|
||||
}
|
||||
}
|
||||
//角色不存在用户则移除。不添加
|
||||
if(roleFlag){
|
||||
if(roleCheckedFlag) {
|
||||
tree2.setChecked("true");
|
||||
}
|
||||
list.add(tree2);
|
||||
}
|
||||
}
|
||||
//科室不存在用户则移除。不添加
|
||||
if(deptFlag){
|
||||
if(deptCheckedFlag) {
|
||||
tree1.setChecked("true");
|
||||
}
|
||||
list.add(tree1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存跨科查看用户信息
|
||||
* @param list
|
||||
*/
|
||||
public void updateTransferDeptUserSet(List<ArchiveTransferDeptUser> list, HttpServletRequest request) {
|
||||
if(!CollectionUtils.isEmpty(list)) {
|
||||
String masterId = list.get(0).getMasterId();
|
||||
//先清空表
|
||||
transferDeptUserMapper.deleteTransferDeptUserByMasterId(masterId);
|
||||
//填充数据
|
||||
//获取用户
|
||||
Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER");
|
||||
//获取当前时间
|
||||
Date date = new Date();
|
||||
for(ArchiveTransferDeptUser obj : list){
|
||||
obj.setCreateTime(date);
|
||||
obj.setCreateUser(user.getUserName());
|
||||
}
|
||||
//批量插入
|
||||
commomService.insertBatch("archive_transfer_dept_user", list, transferDeptUserMapper);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,186 @@
|
||||
<?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.emr.dao.ArchiveTransferDeptUserMapper" >
|
||||
<resultMap id="BaseResultMap" type="com.emr.entity.ArchiveTransferDeptUser" >
|
||||
<id column="id" property="id" jdbcType="INTEGER" />
|
||||
<result column="master_id" property="masterId" jdbcType="VARCHAR" />
|
||||
<result column="user_name" property="userName" jdbcType="NVARCHAR" />
|
||||
<result column="dept_code" property="deptCode" jdbcType="VARCHAR" />
|
||||
<result column="create_user" property="createUser" jdbcType="NVARCHAR" />
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
<result column="remark" property="remark" jdbcType="NVARCHAR" />
|
||||
<result column="int1" property="int1" jdbcType="INTEGER" />
|
||||
<result column="int2" property="int2" jdbcType="INTEGER" />
|
||||
<result column="str1" property="str1" jdbcType="NVARCHAR" />
|
||||
<result column="str2" property="str2" jdbcType="NVARCHAR" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List" >
|
||||
id, master_id, user_name, dept_code, create_user, create_time, remark, int1, int2,
|
||||
str1, str2
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from archive_transfer_dept_user
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
|
||||
delete from archive_transfer_dept_user
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.emr.entity.ArchiveTransferDeptUser" >
|
||||
insert into archive_transfer_dept_user (id, master_id, user_name,
|
||||
dept_code, create_user, create_time,
|
||||
remark, int1, int2,
|
||||
str1, str2)
|
||||
values (#{id,jdbcType=INTEGER}, #{masterId,jdbcType=VARCHAR}, #{userName,jdbcType=NVARCHAR},
|
||||
#{deptCode,jdbcType=VARCHAR}, #{createUser,jdbcType=NVARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{remark,jdbcType=NVARCHAR}, #{int1,jdbcType=INTEGER}, #{int2,jdbcType=INTEGER},
|
||||
#{str1,jdbcType=NVARCHAR}, #{str2,jdbcType=NVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.emr.entity.ArchiveTransferDeptUser" >
|
||||
insert into archive_transfer_dept_user
|
||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
id,
|
||||
</if>
|
||||
<if test="masterId != null" >
|
||||
master_id,
|
||||
</if>
|
||||
<if test="userName != null" >
|
||||
user_name,
|
||||
</if>
|
||||
<if test="deptCode != null" >
|
||||
dept_code,
|
||||
</if>
|
||||
<if test="createUser != null" >
|
||||
create_user,
|
||||
</if>
|
||||
<if test="createTime != null" >
|
||||
create_time,
|
||||
</if>
|
||||
<if test="remark != null" >
|
||||
remark,
|
||||
</if>
|
||||
<if test="int1 != null" >
|
||||
int1,
|
||||
</if>
|
||||
<if test="int2 != null" >
|
||||
int2,
|
||||
</if>
|
||||
<if test="str1 != null" >
|
||||
str1,
|
||||
</if>
|
||||
<if test="str2 != null" >
|
||||
str2,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="masterId != null" >
|
||||
#{masterId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userName != null" >
|
||||
#{userName,jdbcType=NVARCHAR},
|
||||
</if>
|
||||
<if test="deptCode != null" >
|
||||
#{deptCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createUser != null" >
|
||||
#{createUser,jdbcType=NVARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null" >
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="remark != null" >
|
||||
#{remark,jdbcType=NVARCHAR},
|
||||
</if>
|
||||
<if test="int1 != null" >
|
||||
#{int1,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="int2 != null" >
|
||||
#{int2,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="str1 != null" >
|
||||
#{str1,jdbcType=NVARCHAR},
|
||||
</if>
|
||||
<if test="str2 != null" >
|
||||
#{str2,jdbcType=NVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.emr.entity.ArchiveTransferDeptUser" >
|
||||
update archive_transfer_dept_user
|
||||
<set >
|
||||
<if test="masterId != null" >
|
||||
master_id = #{masterId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userName != null" >
|
||||
user_name = #{userName,jdbcType=NVARCHAR},
|
||||
</if>
|
||||
<if test="deptCode != null" >
|
||||
dept_code = #{deptCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createUser != null" >
|
||||
create_user = #{createUser,jdbcType=NVARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null" >
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="remark != null" >
|
||||
remark = #{remark,jdbcType=NVARCHAR},
|
||||
</if>
|
||||
<if test="int1 != null" >
|
||||
int1 = #{int1,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="int2 != null" >
|
||||
int2 = #{int2,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="str1 != null" >
|
||||
str1 = #{str1,jdbcType=NVARCHAR},
|
||||
</if>
|
||||
<if test="str2 != null" >
|
||||
str2 = #{str2,jdbcType=NVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.emr.entity.ArchiveTransferDeptUser" >
|
||||
update archive_transfer_dept_user
|
||||
set master_id = #{masterId,jdbcType=VARCHAR},
|
||||
user_name = #{userName,jdbcType=NVARCHAR},
|
||||
dept_code = #{deptCode,jdbcType=VARCHAR},
|
||||
create_user = #{createUser,jdbcType=NVARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
remark = #{remark,jdbcType=NVARCHAR},
|
||||
int1 = #{int1,jdbcType=INTEGER},
|
||||
int2 = #{int2,jdbcType=INTEGER},
|
||||
str1 = #{str1,jdbcType=NVARCHAR},
|
||||
str2 = #{str2,jdbcType=NVARCHAR}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<!--根据masterId查询对应记录-->
|
||||
<select id="selectAllByMasterId" resultMap="BaseResultMap">
|
||||
select * from archive_transfer_dept_user where master_id = ${masterId}
|
||||
</select>
|
||||
<!--根据masterId删除对应记录-->
|
||||
<delete id="deleteTransferDeptUserByMasterId">
|
||||
delete from archive_transfer_dept_user where master_id = ${masterId}
|
||||
</delete>
|
||||
<!--批量插入-->
|
||||
<insert id="insertBatch">
|
||||
insert into archive_transfer_dept_user (master_id, user_name,
|
||||
dept_code, create_user, create_time,
|
||||
remark, int1, int2,
|
||||
str1, str2)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.masterId,jdbcType=VARCHAR}, #{item.userName,jdbcType=NVARCHAR},
|
||||
#{item.deptCode,jdbcType=VARCHAR}, #{item.createUser,jdbcType=NVARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
|
||||
#{item.remark,jdbcType=NVARCHAR}, #{item.int1,jdbcType=INTEGER}, #{item.int2,jdbcType=INTEGER},
|
||||
#{item.str1,jdbcType=NVARCHAR}, #{item.str2,jdbcType=NVARCHAR})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
Loading…
Reference in New Issue