Commit ca9e48cd authored by 耿迪迪's avatar 耿迪迪

从业人员

parent 88ed3bf9
......@@ -103,7 +103,7 @@ public class TGasBottleInfoController extends BaseController
* @return
* @throws Exception
*/
@PreAuthorize("@ss.hasPermi('gasBottleTrack:storageStationManage:import')")
@PreAuthorize("@ss.hasPermi('gasBottle:info:import')")
@Log(title = "储配站维护", businessType = BusinessType.IMPORT)
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
......
package com.zehong.web.controller.gasBottleTrack;
import java.util.List;
import com.zehong.system.domain.TGasBottleInfo;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TPractitionerInfo;
import com.zehong.system.service.ITPractitionerInfoService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/**
* 从业人员信息Controller
*
* @author zehong
* @date 2023-08-16
*/
@RestController
@RequestMapping("/practitioner/info")
public class TPractitionerInfoController extends BaseController
{
@Autowired
private ITPractitionerInfoService tPractitionerInfoService;
/**
* 查询从业人员信息列表
*/
@PreAuthorize("@ss.hasPermi('practitioner:info:list')")
@GetMapping("/list")
public TableDataInfo list(TPractitionerInfo tPractitionerInfo)
{
startPage();
List<TPractitionerInfo> list = tPractitionerInfoService.selectTPractitionerInfoList(tPractitionerInfo);
return getDataTable(list);
}
/**
* 导出从业人员信息列表
*/
@PreAuthorize("@ss.hasPermi('practitioner:info:export')")
@Log(title = "从业人员信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TPractitionerInfo tPractitionerInfo)
{
List<TPractitionerInfo> list = tPractitionerInfoService.selectTPractitionerInfoList(tPractitionerInfo);
ExcelUtil<TPractitionerInfo> util = new ExcelUtil<TPractitionerInfo>(TPractitionerInfo.class);
return util.exportExcel(list, "从业人员信息数据");
}
/**
* 获取从业人员信息详细信息
*/
@PreAuthorize("@ss.hasPermi('practitioner:info:query')")
@GetMapping(value = "/{practitionerId}")
public AjaxResult getInfo(@PathVariable("practitionerId") Long practitionerId)
{
return AjaxResult.success(tPractitionerInfoService.selectTPractitionerInfoById(practitionerId));
}
/**
* 新增从业人员信息
*/
@PreAuthorize("@ss.hasPermi('practitioner:info:add')")
@Log(title = "从业人员信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TPractitionerInfo tPractitionerInfo)
{
return toAjax(tPractitionerInfoService.insertTPractitionerInfo(tPractitionerInfo));
}
/**
* 修改从业人员信息
*/
@PreAuthorize("@ss.hasPermi('practitioner:info:edit')")
@Log(title = "从业人员信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TPractitionerInfo tPractitionerInfo)
{
return toAjax(tPractitionerInfoService.updateTPractitionerInfo(tPractitionerInfo));
}
/**
* 删除从业人员信息
*/
@PreAuthorize("@ss.hasPermi('practitioner:info:remove')")
@Log(title = "从业人员信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{practitionerIds}")
public AjaxResult remove(@PathVariable Long[] practitionerIds)
{
return toAjax(tPractitionerInfoService.deleteTPractitionerInfoByIds(practitionerIds));
}
/**
* 储配站导入
* @param file
* @param updateSupport
* @return
* @throws Exception
*/
@PreAuthorize("@ss.hasPermi('practitioner:info:import')")
@Log(title = "储配站维护", businessType = BusinessType.IMPORT)
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
{
ExcelUtil<TPractitionerInfo> util = new ExcelUtil<>(TPractitionerInfo.class);
List<TPractitionerInfo> tPractitionerInfo = util.importExcel(file.getInputStream());
String message = tPractitionerInfoService.importTPractitionerInfo(tPractitionerInfo, updateSupport);
return AjaxResult.success(message);
}
@GetMapping("/importTemplate")
public AjaxResult importTemplate(){
ExcelUtil<TPractitionerInfo> util = new ExcelUtil<>(TPractitionerInfo.class);
return util.importTemplateExcel("从业人员数据");
}
}
package com.zehong.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 从业人员信息对象 t_practitioner_info
*
* @author zehong
* @date 2023-08-16
*/
public class TPractitionerInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 从业人员主键 */
private Long practitionerId;
/** 储配站 */
private Long stationId;
@Excel(name = "储配站")
private String stationName;
/** 工号 */
@Excel(name = "工号")
private String practitionerNum;
/** 姓名 */
@Excel(name = "姓名")
private String name;
/** 性别 */
@Excel(name = "性别: 0.男 1女")
private String sex;
/** 出生日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "出生日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date birthDate;
/** 岗位 */
private Long postId;
@Excel(name = "岗位")
private String postName;
/** 联系电话 */
@Excel(name = "联系电话")
private String telNum;
/** 配送区域 */
@Excel(name = "配送区域")
private String deliveryArea;
/** 人员照片 */
@Excel(name = "人员照片")
private String personPhoto;
/** 证书文件 */
@Excel(name = "证书文件")
private String licenseFile;
/** 从业资格编号 */
@Excel(name = "从业资格编号")
private String certificateNum;
/** 从业资格证有效时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "从业资格证有效时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date certificateEffectiveDate;
/** 密码 */
@Excel(name = "密码")
private String password;
/** 删除状态:0.否 1.是 */
private String isDel;
public void setPractitionerId(Long practitionerId)
{
this.practitionerId = practitionerId;
}
public Long getPractitionerId()
{
return practitionerId;
}
public void setStationId(Long stationId)
{
this.stationId = stationId;
}
public Long getStationId()
{
return stationId;
}
public void setPractitionerNum(String practitionerNum)
{
this.practitionerNum = practitionerNum;
}
public String getPractitionerNum()
{
return practitionerNum;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setSex(String sex)
{
this.sex = sex;
}
public String getSex()
{
return sex;
}
public void setBirthDate(Date birthDate)
{
this.birthDate = birthDate;
}
public Date getBirthDate()
{
return birthDate;
}
public void setPostId(Long postId)
{
this.postId = postId;
}
public Long getPostId()
{
return postId;
}
public void setTelNum(String telNum)
{
this.telNum = telNum;
}
public String getTelNum()
{
return telNum;
}
public void setDeliveryArea(String deliveryArea)
{
this.deliveryArea = deliveryArea;
}
public String getDeliveryArea()
{
return deliveryArea;
}
public void setPersonPhoto(String personPhoto)
{
this.personPhoto = personPhoto;
}
public String getPersonPhoto()
{
return personPhoto;
}
public void setLicenseFile(String licenseFile)
{
this.licenseFile = licenseFile;
}
public String getLicenseFile()
{
return licenseFile;
}
public void setCertificateNum(String certificateNum)
{
this.certificateNum = certificateNum;
}
public String getCertificateNum()
{
return certificateNum;
}
public void setCertificateEffectiveDate(Date certificateEffectiveDate)
{
this.certificateEffectiveDate = certificateEffectiveDate;
}
public Date getCertificateEffectiveDate()
{
return certificateEffectiveDate;
}
public void setPassword(String password)
{
this.password = password;
}
public String getPassword()
{
return password;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
public String getStationName() {
return stationName;
}
public void setStationName(String stationName) {
this.stationName = stationName;
}
public String getPostName() {
return postName;
}
public void setPostName(String postName) {
this.postName = postName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("practitionerId", getPractitionerId())
.append("stationId", getStationId())
.append("practitionerNum", getPractitionerNum())
.append("name", getName())
.append("sex", getSex())
.append("birthDate", getBirthDate())
.append("postId", getPostId())
.append("telNum", getTelNum())
.append("deliveryArea", getDeliveryArea())
.append("personPhoto", getPersonPhoto())
.append("licenseFile", getLicenseFile())
.append("certificateNum", getCertificateNum())
.append("certificateEffectiveDate", getCertificateEffectiveDate())
.append("password", getPassword())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("isDel", getIsDel())
.append("remark", getRemark())
.toString();
}
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TPractitionerInfo;
/**
* 从业人员信息Mapper接口
*
* @author zehong
* @date 2023-08-16
*/
public interface TPractitionerInfoMapper
{
/**
* 查询从业人员信息
*
* @param practitionerId 从业人员信息ID
* @return 从业人员信息
*/
public TPractitionerInfo selectTPractitionerInfoById(Long practitionerId);
/**
* 查询从业人员信息列表
*
* @param tPractitionerInfo 从业人员信息
* @return 从业人员信息集合
*/
public List<TPractitionerInfo> selectTPractitionerInfoList(TPractitionerInfo tPractitionerInfo);
/**
* 新增从业人员信息
*
* @param tPractitionerInfo 从业人员信息
* @return 结果
*/
public int insertTPractitionerInfo(TPractitionerInfo tPractitionerInfo);
/**
* 修改从业人员信息
*
* @param tPractitionerInfo 从业人员信息
* @return 结果
*/
public int updateTPractitionerInfo(TPractitionerInfo tPractitionerInfo);
/**
* 删除从业人员信息
*
* @param practitionerId 从业人员信息ID
* @return 结果
*/
public int deleteTPractitionerInfoById(Long practitionerId);
/**
* 批量删除从业人员信息
*
* @param practitionerIds 需要删除的数据ID
* @return 结果
*/
public int deleteTPractitionerInfoByIds(Long[] practitionerIds);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TGasBottleInfo;
import com.zehong.system.domain.TPractitionerInfo;
/**
* 从业人员信息Service接口
*
* @author zehong
* @date 2023-08-16
*/
public interface ITPractitionerInfoService
{
/**
* 查询从业人员信息
*
* @param practitionerId 从业人员信息ID
* @return 从业人员信息
*/
public TPractitionerInfo selectTPractitionerInfoById(Long practitionerId);
/**
* 查询从业人员信息列表
*
* @param tPractitionerInfo 从业人员信息
* @return 从业人员信息集合
*/
public List<TPractitionerInfo> selectTPractitionerInfoList(TPractitionerInfo tPractitionerInfo);
/**
* 新增从业人员信息
*
* @param tPractitionerInfo 从业人员信息
* @return 结果
*/
public int insertTPractitionerInfo(TPractitionerInfo tPractitionerInfo);
/**
* 修改从业人员信息
*
* @param tPractitionerInfo 从业人员信息
* @return 结果
*/
public int updateTPractitionerInfo(TPractitionerInfo tPractitionerInfo);
/**
* 批量删除从业人员信息
*
* @param practitionerIds 需要删除的从业人员信息ID
* @return 结果
*/
public int deleteTPractitionerInfoByIds(Long[] practitionerIds);
/**
* 删除从业人员信息信息
*
* @param practitionerId 从业人员信息ID
* @return 结果
*/
public int deleteTPractitionerInfoById(Long practitionerId);
/**
* 从业人员数据导入
* @param tPractitionerInfoList 从业人员实体
* @param isUpdateSupport 是否更新
* @return
*/
String importTPractitionerInfo(List<TPractitionerInfo> tPractitionerInfoList, Boolean isUpdateSupport);
}
package com.zehong.system.service.impl;
import com.zehong.common.exception.CustomException;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.SysPost;
import com.zehong.system.domain.TGasStorageStationInfo;
import com.zehong.system.domain.TPractitionerInfo;
import com.zehong.system.mapper.SysPostMapper;
import com.zehong.system.mapper.TGasStorageStationInfoMapper;
import com.zehong.system.mapper.TPractitionerInfoMapper;
import com.zehong.system.service.ITPractitionerInfoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.List;
/**
* 从业人员信息Service业务层处理
*
* @author zehong
* @date 2023-08-16
*/
@Service
public class TPractitionerInfoServiceImpl implements ITPractitionerInfoService
{
private static final Logger log = LoggerFactory.getLogger(TPractitionerInfoServiceImpl.class);
@Autowired
private TPractitionerInfoMapper tPractitionerInfoMapper;
@Resource
private TGasStorageStationInfoMapper tGasStorageStationInfoMapper;
@Resource
private SysPostMapper sysPostMapper;
/**
* 查询从业人员信息
*
* @param practitionerId 从业人员信息ID
* @return 从业人员信息
*/
@Override
public TPractitionerInfo selectTPractitionerInfoById(Long practitionerId)
{
return tPractitionerInfoMapper.selectTPractitionerInfoById(practitionerId);
}
/**
* 查询从业人员信息列表
*
* @param tPractitionerInfo 从业人员信息
* @return 从业人员信息
*/
@Override
public List<TPractitionerInfo> selectTPractitionerInfoList(TPractitionerInfo tPractitionerInfo)
{
return tPractitionerInfoMapper.selectTPractitionerInfoList(tPractitionerInfo);
}
/**
* 新增从业人员信息
*
* @param tPractitionerInfo 从业人员信息
* @return 结果
*/
@Override
public int insertTPractitionerInfo(TPractitionerInfo tPractitionerInfo)
{
tPractitionerInfo.setCreateTime(DateUtils.getNowDate());
return tPractitionerInfoMapper.insertTPractitionerInfo(tPractitionerInfo);
}
/**
* 修改从业人员信息
*
* @param tPractitionerInfo 从业人员信息
* @return 结果
*/
@Override
public int updateTPractitionerInfo(TPractitionerInfo tPractitionerInfo)
{
tPractitionerInfo.setUpdateTime(DateUtils.getNowDate());
return tPractitionerInfoMapper.updateTPractitionerInfo(tPractitionerInfo);
}
/**
* 批量删除从业人员信息
*
* @param practitionerIds 需要删除的从业人员信息ID
* @return 结果
*/
@Override
public int deleteTPractitionerInfoByIds(Long[] practitionerIds)
{
return tPractitionerInfoMapper.deleteTPractitionerInfoByIds(practitionerIds);
}
/**
* 删除从业人员信息信息
*
* @param practitionerId 从业人员信息ID
* @return 结果
*/
@Override
public int deleteTPractitionerInfoById(Long practitionerId)
{
return tPractitionerInfoMapper.deleteTPractitionerInfoById(practitionerId);
}
/**
* 从业人员数据导入
* @param tPractitionerInfoList 从业人员实体
* @param isUpdateSupport 是否更新
* @return
*/
@Override
public String importTPractitionerInfo(List<TPractitionerInfo> tPractitionerInfoList, Boolean isUpdateSupport){
if (StringUtils.isNull(tPractitionerInfoList) || tPractitionerInfoList.size() == 0){
throw new CustomException("导入数据不能为空!");
}
int successNum = 0;
int failureNum = 0;
StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder();
for (TPractitionerInfo tPractitionerInfo : tPractitionerInfoList){
try {
//查询储配站信息
TGasStorageStationInfo queryGasStorageStationInfo = new TGasStorageStationInfo();
queryGasStorageStationInfo.setStationName(tPractitionerInfo.getStationName());
//储配站
List<TGasStorageStationInfo> gasStorageStationInfo = tGasStorageStationInfoMapper.selectTGasStorageStationInfoList(queryGasStorageStationInfo);
if(CollectionUtils.isEmpty(gasStorageStationInfo)){
failureNum++;
failureMsg.append("<br/>" + failureNum + "、从业人员 " + tPractitionerInfo.getName() +"、储配站" + tPractitionerInfo.getStationName() + " 不存在请创建或导入");
continue;
}
//岗位
SysPost post = new SysPost();
post.setPostName(tPractitionerInfo.getPostName());
List<SysPost> postInfo = sysPostMapper.selectPostList(post);
if(CollectionUtils.isEmpty(postInfo)){
failureNum++;
failureMsg.append("<br/>" + failureNum + "、从业人员 " + tPractitionerInfo.getName() +"、岗位" + tPractitionerInfo.getPostName() + " 不存在请创建");
continue;
}
TPractitionerInfo query = new TPractitionerInfo();
query.setPractitionerNum(tPractitionerInfo.getPractitionerNum());
List<TPractitionerInfo> queryPractitionerInfo = tPractitionerInfoMapper.selectTPractitionerInfoList(query);
if (StringUtils.isNull(queryPractitionerInfo) || queryPractitionerInfo.size() == 0){
tPractitionerInfo.setStationId(gasStorageStationInfo.get(0).getStationId());
tPractitionerInfo.setPostId(postInfo.get(0).getPostId());
this.insertTPractitionerInfo(tPractitionerInfo);
successNum++;
successMsg.append("<br/>" + successNum + "、工号 " + tPractitionerInfo.getPractitionerNum() + " 导入成功");
}else if (isUpdateSupport){
queryPractitionerInfo.stream().forEach(practitionerInfo ->{
tPractitionerInfo.setPractitionerId(practitionerInfo.getPractitionerId());
tPractitionerInfo.setStationId(gasStorageStationInfo.get(0).getStationId());
tPractitionerInfo.setPostId(postInfo.get(0).getPostId());
this.updateTPractitionerInfo(tPractitionerInfo);
});
successNum++;
successMsg.append("<br/>" + successNum + "、工号 " + tPractitionerInfo.getPractitionerNum() + " 更新成功");
}else{
failureNum++;
failureMsg.append("<br/>" + failureNum + "、工号 " + tPractitionerInfo.getPractitionerNum() + " 已存在");
}
}
catch (Exception e)
{
failureNum++;
String msg = "<br/>" + failureNum + "、工号 " + tPractitionerInfo.getPractitionerNum() + " 导入失败:";
failureMsg.append(msg + e.getMessage());
log.error(msg, e);
}
}
if (failureNum > 0)
{
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
throw new CustomException(failureMsg.toString());
}
else
{
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
}
return successMsg.toString();
}
}
<?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.zehong.system.mapper.TPractitionerInfoMapper">
<resultMap type="TPractitionerInfo" id="TPractitionerInfoResult">
<result property="practitionerId" column="practitioner_id" />
<result property="stationId" column="station_id" />
<result property="practitionerNum" column="practitioner_num" />
<result property="name" column="name" />
<result property="sex" column="sex" />
<result property="birthDate" column="birth_date" />
<result property="postId" column="post_id" />
<result property="telNum" column="tel_num" />
<result property="deliveryArea" column="delivery_area" />
<result property="personPhoto" column="person_photo" />
<result property="licenseFile" column="license_file" />
<result property="certificateNum" column="certificate_num" />
<result property="certificateEffectiveDate" column="certificate_effective_date" />
<result property="password" column="password" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="isDel" column="is_del" />
<result property="remark" column="remark" />
<result property="stationName" column="station_name"/>
<result property="postName" column="post_name"/>
</resultMap>
<sql id="selectTPractitionerInfoVo">
SELECT
info.practitioner_id,
info.station_id,
info.practitioner_num,
info.NAME,
info.sex,
info.birth_date,
info.post_id,
info.tel_num,
info.delivery_area,
info.person_photo,
info.license_file,
info.certificate_num,
info.certificate_effective_date,
info.PASSWORD,
info.create_time,
info.update_time,
info.is_del,
info.remark,
(SELECT station_name FROM t_gas_storage_station_info station WHERE station.station_id = info.station_id) AS station_name,
(SELECT post_name FROM sys_post p WHERE p.post_id = info.post_id) AS post_name
FROM
t_practitioner_info info
</sql>
<select id="selectTPractitionerInfoList" parameterType="TPractitionerInfo" resultMap="TPractitionerInfoResult">
<include refid="selectTPractitionerInfoVo"/>
<where>
<if test="stationId != null "> and info.station_id = #{stationId}</if>
<if test="practitionerNum != null and practitionerNum != ''"> and info.practitioner_num = #{practitionerNum}</if>
<if test="name != null and name != ''"> and info.name like concat('%', #{name}, '%')</if>
<if test="sex != null and sex != ''"> and info.sex = #{sex}</if>
<if test="birthDate != null "> and info.birth_date = #{birthDate}</if>
<if test="postId != null "> and info.post_id = #{postId}</if>
<if test="telNum != null and telNum != ''"> and info.tel_num = #{telNum}</if>
<if test="deliveryArea != null and deliveryArea != ''"> and info.delivery_area = #{deliveryArea}</if>
<if test="personPhoto != null and personPhoto != ''"> and info.info.person_photo = #{personPhoto}</if>
<if test="licenseFile != null and licenseFile != ''"> and info.license_file = #{licenseFile}</if>
<if test="certificateNum != null and certificateNum != ''"> and info.certificate_num = #{certificateNum}</if>
<if test="certificateEffectiveDate != null "> and info.certificate_effective_date = #{certificateEffectiveDate}</if>
<if test="password != null and password != ''"> and info.password = #{password}</if>
<if test="isDel != null and isDel != ''"> and info.is_del = #{isDel}</if>
</where>
</select>
<select id="selectTPractitionerInfoById" parameterType="Long" resultMap="TPractitionerInfoResult">
<include refid="selectTPractitionerInfoVo"/>
where info.practitioner_id = #{practitionerId}
</select>
<insert id="insertTPractitionerInfo" parameterType="TPractitionerInfo" useGeneratedKeys="true" keyProperty="practitionerId">
insert into t_practitioner_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="stationId != null">station_id,</if>
<if test="practitionerNum != null">practitioner_num,</if>
<if test="name != null">name,</if>
<if test="sex != null">sex,</if>
<if test="birthDate != null">birth_date,</if>
<if test="postId != null">post_id,</if>
<if test="telNum != null">tel_num,</if>
<if test="deliveryArea != null">delivery_area,</if>
<if test="personPhoto != null">person_photo,</if>
<if test="licenseFile != null">license_file,</if>
<if test="certificateNum != null">certificate_num,</if>
<if test="certificateEffectiveDate != null">certificate_effective_date,</if>
<if test="password != null">password,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="stationId != null">#{stationId},</if>
<if test="practitionerNum != null">#{practitionerNum},</if>
<if test="name != null">#{name},</if>
<if test="sex != null">#{sex},</if>
<if test="birthDate != null">#{birthDate},</if>
<if test="postId != null">#{postId},</if>
<if test="telNum != null">#{telNum},</if>
<if test="deliveryArea != null">#{deliveryArea},</if>
<if test="personPhoto != null">#{personPhoto},</if>
<if test="licenseFile != null">#{licenseFile},</if>
<if test="certificateNum != null">#{certificateNum},</if>
<if test="certificateEffectiveDate != null">#{certificateEffectiveDate},</if>
<if test="password != null">#{password},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateTPractitionerInfo" parameterType="TPractitionerInfo">
update t_practitioner_info
<trim prefix="SET" suffixOverrides=",">
<if test="stationId != null">station_id = #{stationId},</if>
<if test="practitionerNum != null">practitioner_num = #{practitionerNum},</if>
<if test="name != null">name = #{name},</if>
<if test="sex != null">sex = #{sex},</if>
<if test="birthDate != null">birth_date = #{birthDate},</if>
<if test="postId != null">post_id = #{postId},</if>
<if test="telNum != null">tel_num = #{telNum},</if>
<if test="deliveryArea != null">delivery_area = #{deliveryArea},</if>
<if test="personPhoto != null">person_photo = #{personPhoto},</if>
<if test="licenseFile != null">license_file = #{licenseFile},</if>
<if test="certificateNum != null">certificate_num = #{certificateNum},</if>
<if test="certificateEffectiveDate != null">certificate_effective_date = #{certificateEffectiveDate},</if>
<if test="password != null">password = #{password},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where practitioner_id = #{practitionerId}
</update>
<delete id="deleteTPractitionerInfoById" parameterType="Long">
delete from t_practitioner_info where practitioner_id = #{practitionerId}
</delete>
<delete id="deleteTPractitionerInfoByIds" parameterType="String">
delete from t_practitioner_info where practitioner_id in
<foreach item="practitionerId" collection="array" open="(" separator="," close=")">
#{practitionerId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment