巡检计划

highway
wws 1 year ago
parent 5299c1e27d
commit e56dc7446b

@ -28,98 +28,110 @@ import com.op.common.core.web.page.TableDataInfo;
/**
* Controller
*
*
* @author Open Platform
* @date 2023-10-16
*/
@RestController
@RequestMapping("/plan")
public class EquPlanController extends BaseController {
@Autowired
private IEquPlanService equPlanService;
@Autowired
private IEquPlanService equPlanService;
/**
* -
* @param equPlanEquList
* @return
*/
@PostMapping("/formatEquItem")
public AjaxResult formatEquItem(@RequestBody List<EquPlanEqu> equPlanEquList) {
return equPlanService.formatEquItem(equPlanEquList);
}
/**
* list
*
* @return
*/
@GetMapping("/getPersonList")
public AjaxResult getPersonList() {
return equPlanService.getPersonList();
}
/**
* list
* @param baseEquipment
* @return
*/
@RequiresPermissions("device:plan:list")
@GetMapping("/getEquList")
public TableDataInfo getEquList(BaseEquipment baseEquipment) {
startPage();
List<BaseEquipment> list = equPlanService.getEquList(baseEquipment);
return getDataTable(list);
}
/**
* -
*
* @param equPlanEquList
* @return
*/
@PostMapping("/formatEquItem")
public AjaxResult formatEquItem(@RequestBody List<EquPlanEqu> equPlanEquList) {
return equPlanService.formatEquItem(equPlanEquList);
}
/**
*
*/
@RequiresPermissions("device:plan:list")
@GetMapping("/list")
public TableDataInfo list(EquPlan equPlan) {
startPage();
List<EquPlan> list = equPlanService.selectEquPlanList(equPlan);
return getDataTable(list);
}
/**
* list
*
* @param baseEquipment
* @return
*/
@RequiresPermissions("device:plan:list")
@GetMapping("/getEquList")
public TableDataInfo getEquList(BaseEquipment baseEquipment) {
startPage();
List<BaseEquipment> list = equPlanService.getEquList(baseEquipment);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("device:plan:export")
@Log(title = "计划", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EquPlan equPlan) {
List<EquPlan> list = equPlanService.selectEquPlanList(equPlan);
ExcelUtil<EquPlan> util = new ExcelUtil<EquPlan>(EquPlan.class);
util.exportExcel(response, list, "计划数据");
}
/**
*
*/
@RequiresPermissions("device:plan:list")
@GetMapping("/list")
public TableDataInfo list(EquPlan equPlan) {
startPage();
List<EquPlan> list = equPlanService.selectEquPlanList(equPlan);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("device:plan:query")
@GetMapping(value = "/{planId}")
public AjaxResult getInfo(@PathVariable("planId") String planId) {
return success(equPlanService.selectEquPlanByPlanId(planId));
}
/**
*
*/
@RequiresPermissions("device:plan:export")
@Log(title = "计划", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EquPlan equPlan) {
List<EquPlan> list = equPlanService.selectEquPlanList(equPlan);
ExcelUtil<EquPlan> util = new ExcelUtil<EquPlan>(EquPlan.class);
util.exportExcel(response, list, "计划数据");
}
/**
*
*/
@RequiresPermissions("device:plan:add")
@Log(title = "计划", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EquPlan equPlan) {
return toAjax(equPlanService.insertEquPlan(equPlan));
}
/**
*
*/
@RequiresPermissions("device:plan:query")
@GetMapping(value = "/{planId}")
public AjaxResult getInfo(@PathVariable("planId") String planId) {
return success(equPlanService.selectEquPlanByPlanId(planId));
}
/**
*
*/
@RequiresPermissions("device:plan:edit")
@Log(title = "计划", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EquPlan equPlan) {
return toAjax(equPlanService.updateEquPlan(equPlan));
}
/**
*
*/
@RequiresPermissions("device:plan:add")
@Log(title = "计划", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EquPlan equPlan) {
return equPlanService.insertEquPlan(equPlan);
}
/**
*
*/
@RequiresPermissions("device:plan:remove")
@Log(title = "计划", businessType = BusinessType.DELETE)
@DeleteMapping("/{planIds}")
public AjaxResult remove(@PathVariable String[] planIds) {
return toAjax(equPlanService.deleteEquPlanByPlanIds(planIds));
}
/**
*
*/
@RequiresPermissions("device:plan:edit")
@Log(title = "计划", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EquPlan equPlan) {
return toAjax(equPlanService.updateEquPlan(equPlan));
}
/**
*
*/
@RequiresPermissions("device:plan:remove")
@Log(title = "计划", businessType = BusinessType.DELETE)
@DeleteMapping("/{planIds}")
public AjaxResult remove(@PathVariable String[] planIds) {
return toAjax(equPlanService.deleteEquPlanByPlanIds(planIds));
}
}

@ -95,6 +95,16 @@ public class EquCheckItem extends BaseEntity {
// 更新日期结束
private String updateTimeEnd;
private List<EquCheckItemDetail> equCheckItemDetailList;
public List<EquCheckItemDetail> getEquCheckItemDetailList() {
return equCheckItemDetailList;
}
public void setEquCheckItemDetailList(List<EquCheckItemDetail> equCheckItemDetailList) {
this.equCheckItemDetailList = equCheckItemDetailList;
}
public List<Date> getUpdateTimeArray() {
return updateTimeArray;
}

@ -85,6 +85,36 @@ public class EquCheckItemDetail extends BaseEntity {
@Excel(name = "详情编码")
private String detailCode;
private Boolean showFlag;
private String standardTypeName;
private String itemName;
public String getItemName() {
return itemName;
}
public void setItemName(String itemName) {
this.itemName = itemName;
}
public String getStandardTypeName() {
return standardTypeName;
}
public void setStandardTypeName(String standardTypeName) {
this.standardTypeName = standardTypeName;
}
public Boolean getShowFlag() {
return showFlag;
}
public void setShowFlag(Boolean showFlag) {
this.showFlag = showFlag;
}
public String getDetailCode() {
return detailCode;
}

@ -4,6 +4,7 @@ import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.system.api.domain.SysUser;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
@ -128,6 +129,26 @@ public class EquPlan extends BaseEntity {
// 关联-计划->设备list
private List<EquPlanEqu> equPlanEquList;
private List<EquPlanEqu> equipmentItem;
public List<EquPlanEqu> getEquipmentItem() {
return equipmentItem;
}
public void setEquipmentItem(List<EquPlanEqu> equipmentItem) {
this.equipmentItem = equipmentItem;
}
private List<SysUser> personList;
public List<SysUser> getPersonList() {
return personList;
}
public void setPersonList(List<SysUser> personList) {
this.personList = personList;
}
public List<EquPlanEqu> getEquPlanEquList() {
return equPlanEquList;
}

@ -57,6 +57,26 @@ public class EquPlanEqu extends BaseEntity {
// 关联-设备->检查项list
private List<EquPlanDetail> equPlanDetailList;
private List<EquCheckItem> equCheckItemList;
private String itemTempName;
public String getItemTempName() {
return itemTempName;
}
public void setItemTempName(String itemTempName) {
this.itemTempName = itemTempName;
}
public List<EquCheckItem> getEquCheckItemList() {
return equCheckItemList;
}
public void setEquCheckItemList(List<EquCheckItem> equCheckItemList) {
this.equCheckItemList = equCheckItemList;
}
public List<EquPlanDetail> getEquPlanDetailList() {
return equPlanDetailList;
}

@ -1,6 +1,7 @@
package com.op.device.domain.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.system.api.domain.SysUser;
import java.util.Date;
import java.util.List;
@ -93,6 +94,28 @@ public class InspectionPlanDTO {
// 创建日期结束
private String createTimeEnd;
// 执行时间arr
private List<Date> planTimeArray;
// 人员list
private List<SysUser> personList;
public List<Date> getPlanTimeArray() {
return planTimeArray;
}
public void setPlanTimeArray(List<Date> planTimeArray) {
this.planTimeArray = planTimeArray;
}
public List<SysUser> getPersonList() {
return personList;
}
public void setPersonList(List<SysUser> personList) {
this.personList = personList;
}
public String getPlanId() {
return planId;
}

@ -84,4 +84,11 @@ public interface EquCheckItemDetailMapper {
* @param itemId
*/
void delEquCheckItemDetailByItemId(String itemId);
/**
* codelist
* @param itemCode
* @return
*/
List<EquCheckItemDetail> selectCheckItemDetailByItemCode(String itemCode);
}

@ -78,4 +78,11 @@ public interface EquCheckItemMapper {
* @return
*/
List<EquCheckItemVO> selectAllEquipmentList();
/**
* list
* @param equipmentCode
* @return
*/
List<EquCheckItem> selectCheckItemByEquipmentCode(String equipmentCode);
}

@ -2,6 +2,8 @@ package com.op.device.mapper;
import java.util.List;
import com.op.device.domain.EquCheckItem;
import com.op.device.domain.EquCheckItemDetail;
import com.op.device.domain.EquPlan;
import com.op.device.domain.dto.InspectionPlanDTO;
import com.op.device.domain.vo.InspectionPlanVO;

@ -0,0 +1,61 @@
package com.op.device.mapper;
import com.op.system.api.domain.SysUser;
import java.util.List;
/**
* Mapper
*
* @author Open Platform
* @date 2023-10-18
*/
public interface SysUserMapper {
/**
*
*
* @param userId
* @return
*/
public SysUser selectSysUserByUserId(Long userId);
/**
*
*
* @param sysUser
* @return
*/
public List<SysUser> selectSysUserList(SysUser sysUser);
/**
*
*
* @param sysUser
* @return
*/
public int insertSysUser(SysUser sysUser);
/**
*
*
* @param sysUser
* @return
*/
public int updateSysUser(SysUser sysUser);
/**
*
*
* @param userId
* @return
*/
public int deleteSysUserByUserId(Long userId);
/**
*
*
* @param userIds
* @return
*/
public int deleteSysUserByUserIds(Long[] userIds);
}

@ -38,7 +38,7 @@ public interface IEquPlanService {
* @param equPlan
* @return
*/
public int insertEquPlan(EquPlan equPlan);
public AjaxResult insertEquPlan(EquPlan equPlan);
/**
*
@ -77,4 +77,10 @@ public interface IEquPlanService {
* @return
*/
AjaxResult formatEquItem(List<EquPlanEqu> equPlanEquList);
/**
* list
* @return
*/
AjaxResult getPersonList();
}

@ -6,139 +6,181 @@ import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.BaseEquipment;
import com.op.device.domain.EquPlanEqu;
import com.op.device.domain.dto.InspectionPlanDTO;
import com.op.device.domain.vo.InspectionPlanVO;
import com.op.device.mapper.BaseEquipmentMapper;
import com.op.device.domain.*;
import com.op.device.mapper.*;
import com.op.system.api.domain.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.device.mapper.EquPlanMapper;
import com.op.device.domain.EquPlan;
import com.op.device.service.IEquPlanService;
import static com.op.common.core.web.domain.AjaxResult.success;
/**
* Service
*
*
* @author Open Platform
* @date 2023-10-16
*/
@Service
public class EquPlanServiceImpl implements IEquPlanService {
@Autowired
private EquPlanMapper equPlanMapper;
@Autowired
private BaseEquipmentMapper baseEquipmentMapper;
@Autowired
private EquPlanMapper equPlanMapper;
@Autowired
private BaseEquipmentMapper baseEquipmentMapper;
@Autowired
private EquCheckItemMapper equCheckItemMapper;
@Autowired
private EquCheckItemDetailMapper equCheckItemDetailMapper;
@Autowired
private SysUserMapper sysUserMapper;
/**
*
*
* @param planId
* @return
*/
@Override
@DS("#header.poolName")
public EquPlan selectEquPlanByPlanId(String planId) {
return equPlanMapper.selectEquPlanByPlanId(planId);
}
/**
*
*
* @param equPlan
* @return
*/
@Override
@DS("#header.poolName")
public List<EquPlan> selectEquPlanList(EquPlan equPlan) {
if (equPlan.getCreateTimeArray() != null) {
// 设置创建日期开始和结束值
if (equPlan.getCreateTimeArray().size() == 2) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
equPlan.setCreateTimeStart(formatter.format(equPlan.getCreateTimeArray().get(0)));
equPlan.setCreateTimeEnd(formatter.format(equPlan.getCreateTimeArray().get(1)));
}
}
if (equPlan.getUpdateTimeArray() != null) {
// 设置更新日期开始和结束
if (equPlan.getUpdateTimeArray().size() == 2) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
equPlan.setUpdateTimeStart(formatter.format(equPlan.getUpdateTimeArray().get(0)));
equPlan.setUpdateTimeEnd(formatter.format(equPlan.getUpdateTimeArray().get(1)));
}
}
return equPlanMapper.selectEquPlanList(equPlan);
}
/**
*
*
* @param planId
* @return
*/
@Override
@DS("#header.poolName")
public EquPlan selectEquPlanByPlanId(String planId) {
return equPlanMapper.selectEquPlanByPlanId(planId);
}
/**
*
*
* @param equPlan
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult insertEquPlan(EquPlan equPlan) {
equPlan.setCreateTime(DateUtils.getNowDate());
return success();
}
/**
*
*
* @param equPlan
* @return
*/
@Override
@DS("#header.poolName")
public List<EquPlan> selectEquPlanList(EquPlan equPlan) {
if (equPlan.getCreateTimeArray() != null) {
// 设置创建日期开始和结束值
if (equPlan.getCreateTimeArray().size() == 2) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
equPlan.setCreateTimeStart(formatter.format(equPlan.getCreateTimeArray().get(0)));
equPlan.setCreateTimeEnd(formatter.format(equPlan.getCreateTimeArray().get(1)));
}
}
if (equPlan.getUpdateTimeArray() != null) {
// 设置更新日期开始和结束
if (equPlan.getUpdateTimeArray().size() == 2) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
equPlan.setUpdateTimeStart(formatter.format(equPlan.getUpdateTimeArray().get(0)));
equPlan.setUpdateTimeEnd(formatter.format(equPlan.getUpdateTimeArray().get(1)));
}
}
return equPlanMapper.selectEquPlanList(equPlan);
}
/**
*
*
* @param equPlan
* @return
*/
@Override
@DS("#header.poolName")
public int updateEquPlan(EquPlan equPlan) {
equPlan.setUpdateTime(DateUtils.getNowDate());
return equPlanMapper.updateEquPlan(equPlan);
}
/**
*
*
* @param equPlan
* @return
*/
@Override
@DS("#header.poolName")
public int insertEquPlan(EquPlan equPlan) {
equPlan.setCreateTime(DateUtils.getNowDate());
return equPlanMapper.insertEquPlan(equPlan);
}
/**
*
*
* @param planIds
* @return
*/
@Override
@DS("#header.poolName")
public int deleteEquPlanByPlanIds(String[] planIds) {
return equPlanMapper.deleteEquPlanByPlanIds(planIds);
}
/**
*
*
* @param equPlan
* @return
*/
@Override
@DS("#header.poolName")
public int updateEquPlan(EquPlan equPlan) {
equPlan.setUpdateTime(DateUtils.getNowDate());
return equPlanMapper.updateEquPlan(equPlan);
}
/**
*
*
* @param planId
* @return
*/
@Override
@DS("#header.poolName")
public int deleteEquPlanByPlanId(String planId) {
return equPlanMapper.deleteEquPlanByPlanId(planId);
}
/**
*
*
* @param planIds
* @return
*/
@Override
@DS("#header.poolName")
public int deleteEquPlanByPlanIds(String[] planIds) {
return equPlanMapper.deleteEquPlanByPlanIds(planIds);
}
/**
* list
*
* @param baseEquipment
* @return
*/
@Override
@DS("#header.poolName")
public List<BaseEquipment> getEquList(BaseEquipment baseEquipment) {
return baseEquipmentMapper.selectBaseEquipmentList(baseEquipment);
}
/**
*
*
* @param planId
* @return
*/
@Override
@DS("#header.poolName")
public int deleteEquPlanByPlanId(String planId) {
return equPlanMapper.deleteEquPlanByPlanId(planId);
}
/**
* -
*
* @param equPlanEquList
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult formatEquItem(List<EquPlanEqu> equPlanEquList) {
for (EquPlanEqu data : equPlanEquList) {
/**
* list
* @param baseEquipment
* @return
*/
@Override
@DS("#header.poolName")
public List<BaseEquipment> getEquList(BaseEquipment baseEquipment) {
return baseEquipmentMapper.selectBaseEquipmentList(baseEquipment);
}
StringBuilder itemTempName = new StringBuilder();
/**
* -
* @param equPlanEquList
* @return
*/
@Override
public AjaxResult formatEquItem(List<EquPlanEqu> equPlanEquList) {
// 获取检查项list
List<EquCheckItem> equCheckItemList = equCheckItemMapper.selectCheckItemByEquipmentCode(data.getEquipmentCode());
if (equCheckItemList.size() > 0) {
for (EquCheckItem checkItem : equCheckItemList) {
if (!checkItem.getItemCode().isEmpty()) {
itemTempName.append(checkItem.getItemName()).append(",");
// 获取检查项详情list
List<EquCheckItemDetail> equCheckItemDetailList = equCheckItemDetailMapper.selectCheckItemDetailByItemCode(checkItem.getItemCode());
if (equCheckItemList.size() > 0) {
for (EquCheckItemDetail detail : equCheckItemDetailList) {
detail.setShowFlag(true);
}
checkItem.setEquCheckItemDetailList(equCheckItemDetailList);
}
}
}
data.setEquCheckItemList(equCheckItemList);
data.setItemTempName(itemTempName.toString());
}
}
return success(equPlanEquList);
}
return null;
}
/**
* list
* @return
*/
@Override
@DS("#master")
public AjaxResult getPersonList() {
SysUser sysUser = new SysUser();
List<SysUser> personList = sysUserMapper.selectSysUserList(sysUser);
return success(personList);
}
}

@ -67,6 +67,11 @@
ORDER BY create_time
</select>
<select id="selectCheckItemDetailByItemCode" parameterType="String" resultMap="EquCheckItemDetailResult">
<include refid="selectEquCheckItemDetailVo"/>
where parent_code = #{itemCode} and del_flag = '0'
</select>
<insert id="insertEquCheckItemDetail" parameterType="EquCheckItemDetail">
insert into equ_check_item_detail
<trim prefix="(" suffix=")" suffixOverrides=",">

@ -72,7 +72,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select equipment_name AS 'equipmentName',equipment_code AS 'equipmentCode' from base_equipment where del_flag = '0'
</select>
<insert id="insertEquCheckItem" parameterType="EquCheckItem">
<select id="selectCheckItemByEquipmentCode" parameterType="String" resultMap="EquCheckItemResult">
<include refid="selectEquCheckItemVo"/>
where item_code in ( select item_code from equ_item_equipment where equipment_code = #{equipmentCode} and del_flag = '0' ) and del_flag = '0'
</select>
<insert id="insertEquCheckItem" parameterType="EquCheckItem">
insert into equ_check_item
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="itemId != null">item_id,</if>

@ -0,0 +1,130 @@
<?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.op.device.mapper.SysUserMapper">
<resultMap type="SysUser" id="SysUserResult">
<result property="userId" column="user_id" />
<result property="deptId" column="dept_id" />
<result property="userName" column="user_name" />
<result property="nickName" column="nick_name" />
<result property="email" column="email" />
<result property="phonenumber" column="phonenumber" />
<result property="sex" column="sex" />
<result property="avatar" column="avatar" />
<result property="password" column="password" />
<result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<result property="loginIp" column="login_ip" />
<result property="loginDate" column="login_date" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectSysUserVo">
select user_id, dept_id, user_name, nick_name, email, phonenumber, sex, avatar, password, status, del_flag, login_ip, login_date, create_by, create_time, update_by, update_time, remark from sys_user
</sql>
<select id="selectSysUserList" parameterType="SysUser" resultMap="SysUserResult">
<include refid="selectSysUserVo"/>
<where>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
<if test="email != null and email != ''"> and email = #{email}</if>
<if test="phonenumber != null and phonenumber != ''"> and phonenumber = #{phonenumber}</if>
<if test="sex != null and sex != ''"> and sex = #{sex}</if>
<if test="avatar != null and avatar != ''"> and avatar = #{avatar}</if>
<if test="password != null and password != ''"> and password = #{password}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="loginIp != null and loginIp != ''"> and login_ip = #{loginIp}</if>
<if test="loginDate != null "> and login_date = #{loginDate}</if>
</where>
</select>
<select id="selectSysUserByUserId" parameterType="Long" resultMap="SysUserResult">
<include refid="selectSysUserVo"/>
where user_id = #{userId}
</select>
<insert id="insertSysUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
insert into sys_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deptId != null">dept_id,</if>
<if test="userName != null and userName != ''">user_name,</if>
<if test="nickName != null and nickName != ''">nick_name,</if>
<if test="email != null">email,</if>
<if test="phonenumber != null">phonenumber,</if>
<if test="sex != null">sex,</if>
<if test="avatar != null">avatar,</if>
<if test="password != null">password,</if>
<if test="status != null">status,</if>
<if test="delFlag != null">del_flag,</if>
<if test="loginIp != null">login_ip,</if>
<if test="loginDate != null">login_date,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deptId != null">#{deptId},</if>
<if test="userName != null and userName != ''">#{userName},</if>
<if test="nickName != null and nickName != ''">#{nickName},</if>
<if test="email != null">#{email},</if>
<if test="phonenumber != null">#{phonenumber},</if>
<if test="sex != null">#{sex},</if>
<if test="avatar != null">#{avatar},</if>
<if test="password != null">#{password},</if>
<if test="status != null">#{status},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="loginIp != null">#{loginIp},</if>
<if test="loginDate != null">#{loginDate},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateSysUser" parameterType="SysUser">
update sys_user
<trim prefix="SET" suffixOverrides=",">
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="userName != null and userName != ''">user_name = #{userName},</if>
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
<if test="email != null">email = #{email},</if>
<if test="phonenumber != null">phonenumber = #{phonenumber},</if>
<if test="sex != null">sex = #{sex},</if>
<if test="avatar != null">avatar = #{avatar},</if>
<if test="password != null">password = #{password},</if>
<if test="status != null">status = #{status},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="loginIp != null">login_ip = #{loginIp},</if>
<if test="loginDate != null">login_date = #{loginDate},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where user_id = #{userId}
</update>
<delete id="deleteSysUserByUserId" parameterType="Long">
delete from sys_user where user_id = #{userId}
</delete>
<delete id="deleteSysUserByUserIds" parameterType="String">
delete from sys_user where user_id in
<foreach item="userId" collection="array" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save