change - 采购申请单导入、计量单位同步ERP
parent
3aa4b371d9
commit
cb91161d1e
@ -0,0 +1,63 @@
|
||||
package com.hw.jindie.mapper;
|
||||
|
||||
import com.hw.jindie.domain.MesBaseUnitInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 单位信息Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-07-24
|
||||
*/
|
||||
public interface MesBaseUnitInfoMapper {
|
||||
/**
|
||||
* 查询单位信息
|
||||
*
|
||||
* @param unitId 单位信息主键
|
||||
* @return 单位信息
|
||||
*/
|
||||
public MesBaseUnitInfo selectMesBaseUnitInfoByUnitId(Long unitId);
|
||||
|
||||
public MesBaseUnitInfo selectMesBaseUnitInfoByErpId(Long erpId);
|
||||
|
||||
/**
|
||||
* 查询单位信息列表
|
||||
*
|
||||
* @param mesBaseUnitInfo 单位信息
|
||||
* @return 单位信息集合
|
||||
*/
|
||||
public List<MesBaseUnitInfo> selectMesBaseUnitInfoList(MesBaseUnitInfo mesBaseUnitInfo);
|
||||
|
||||
/**
|
||||
* 新增单位信息
|
||||
*
|
||||
* @param mesBaseUnitInfo 单位信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesBaseUnitInfo(MesBaseUnitInfo mesBaseUnitInfo);
|
||||
|
||||
/**
|
||||
* 修改单位信息
|
||||
*
|
||||
* @param mesBaseUnitInfo 单位信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesBaseUnitInfo(MesBaseUnitInfo mesBaseUnitInfo);
|
||||
|
||||
/**
|
||||
* 删除单位信息
|
||||
*
|
||||
* @param unitId 单位信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesBaseUnitInfoByUnitId(Long unitId);
|
||||
|
||||
/**
|
||||
* 批量删除单位信息
|
||||
*
|
||||
* @param unitIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesBaseUnitInfoByUnitIds(Long[] unitIds);
|
||||
}
|
@ -0,0 +1,119 @@
|
||||
<?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.hw.jindie.mapper.MesBaseUnitInfoMapper">
|
||||
|
||||
<resultMap type="MesBaseUnitInfo" id="MesBaseUnitInfoResult">
|
||||
<result property="unitId" column="unit_id"/>
|
||||
<result property="unitCode" column="unit_code"/>
|
||||
<result property="unitName" column="unit_name"/>
|
||||
<result property="erpId" column="erp_id"/>
|
||||
<result property="unitStatus" column="unit_status"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<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="auditDate" column="audit_date"/>
|
||||
<result property="erpModifyDate" column="erp_modify_date"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMesBaseUnitInfoVo">
|
||||
select unit_id,
|
||||
unit_code,
|
||||
unit_name,
|
||||
erp_id,
|
||||
unit_status,
|
||||
remark,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
audit_date,
|
||||
erp_modify_date
|
||||
from mes_base_unit_info
|
||||
</sql>
|
||||
|
||||
<select id="selectMesBaseUnitInfoList" parameterType="MesBaseUnitInfo" resultMap="MesBaseUnitInfoResult">
|
||||
<include refid="selectMesBaseUnitInfoVo"/>
|
||||
<where>
|
||||
<if test="unitCode != null and unitCode != ''">and unit_code = #{unitCode}</if>
|
||||
<if test="unitName != null and unitName != ''">and unit_name like concat('%', #{unitName}, '%')</if>
|
||||
<if test="erpId != null ">and erp_id = #{erpId}</if>
|
||||
<if test="unitStatus != null and unitStatus != ''">and unit_status = #{unitStatus}</if>
|
||||
<if test="auditDate != null ">and audit_date = #{auditDate}</if>
|
||||
<if test="erpModifyDate != null ">and erp_modify_date = #{erpModifyDate}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMesBaseUnitInfoByUnitId" parameterType="Long" resultMap="MesBaseUnitInfoResult">
|
||||
<include refid="selectMesBaseUnitInfoVo"/>
|
||||
where unit_id = #{unitId}
|
||||
</select>
|
||||
<select id="selectMesBaseUnitInfoByErpId" parameterType="Long" resultMap="MesBaseUnitInfoResult">
|
||||
<include refid="selectMesBaseUnitInfoVo"/>
|
||||
where erp_id = #{erpId}
|
||||
</select>
|
||||
|
||||
<insert id="insertMesBaseUnitInfo" parameterType="MesBaseUnitInfo" useGeneratedKeys="true" keyProperty="unitId">
|
||||
insert into mes_base_unit_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="unitCode != null">unit_code,</if>
|
||||
<if test="unitName != null and unitName != ''">unit_name,</if>
|
||||
<if test="erpId != null">erp_id,</if>
|
||||
<if test="unitStatus != null and unitStatus != ''">unit_status,</if>
|
||||
<if test="remark != null">remark,</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="auditDate != null">audit_date,</if>
|
||||
<if test="erpModifyDate != null">erp_modify_date,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="unitCode != null">#{unitCode},</if>
|
||||
<if test="unitName != null and unitName != ''">#{unitName},</if>
|
||||
<if test="erpId != null">#{erpId},</if>
|
||||
<if test="unitStatus != null and unitStatus != ''">#{unitStatus},</if>
|
||||
<if test="remark != null">#{remark},</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="auditDate != null">#{auditDate},</if>
|
||||
<if test="erpModifyDate != null">#{erpModifyDate},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMesBaseUnitInfo" parameterType="MesBaseUnitInfo">
|
||||
update mes_base_unit_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="unitCode != null">unit_code = #{unitCode},</if>
|
||||
<if test="unitName != null and unitName != ''">unit_name = #{unitName},</if>
|
||||
<if test="erpId != null">erp_id = #{erpId},</if>
|
||||
<if test="unitStatus != null and unitStatus != ''">unit_status = #{unitStatus},</if>
|
||||
<if test="remark != null">remark = #{remark},</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="auditDate != null">audit_date = #{auditDate},</if>
|
||||
<if test="erpModifyDate != null">erp_modify_date = #{erpModifyDate},</if>
|
||||
</trim>
|
||||
where unit_id = #{unitId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMesBaseUnitInfoByUnitId" parameterType="Long">
|
||||
delete
|
||||
from mes_base_unit_info
|
||||
where unit_id = #{unitId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMesBaseUnitInfoByUnitIds" parameterType="String">
|
||||
delete from mes_base_unit_info where unit_id in
|
||||
<foreach item="unitId" collection="array" open="(" separator="," close=")">
|
||||
#{unitId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,99 @@
|
||||
package com.hw.mes.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
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.hw.common.log.annotation.Log;
|
||||
import com.hw.common.log.enums.BusinessType;
|
||||
import com.hw.common.security.annotation.RequiresPermissions;
|
||||
import com.hw.mes.domain.MesBaseUnitInfo;
|
||||
import com.hw.mes.service.IMesBaseUnitInfoService;
|
||||
import com.hw.common.core.web.controller.BaseController;
|
||||
import com.hw.common.core.web.domain.AjaxResult;
|
||||
import com.hw.common.core.utils.poi.ExcelUtil;
|
||||
import com.hw.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 单位信息Controller
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-07-24
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mesBaseUnitInfo")
|
||||
public class MesBaseUnitInfoController extends BaseController {
|
||||
@Autowired
|
||||
private IMesBaseUnitInfoService mesBaseUnitInfoService;
|
||||
|
||||
/**
|
||||
* 查询单位信息列表
|
||||
*/
|
||||
@RequiresPermissions("mes:mesBaseUnitInfo:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MesBaseUnitInfo mesBaseUnitInfo) {
|
||||
startPage();
|
||||
List<MesBaseUnitInfo> list = mesBaseUnitInfoService.selectMesBaseUnitInfoList(mesBaseUnitInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出单位信息列表
|
||||
*/
|
||||
@RequiresPermissions("mes:mesBaseUnitInfo:export")
|
||||
@Log(title = "单位信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MesBaseUnitInfo mesBaseUnitInfo) {
|
||||
List<MesBaseUnitInfo> list = mesBaseUnitInfoService.selectMesBaseUnitInfoList(mesBaseUnitInfo);
|
||||
ExcelUtil<MesBaseUnitInfo> util = new ExcelUtil<MesBaseUnitInfo>(MesBaseUnitInfo.class);
|
||||
util.exportExcel(response, list, "单位信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单位信息详细信息
|
||||
*/
|
||||
@RequiresPermissions("mes:mesBaseUnitInfo:query")
|
||||
@GetMapping(value = "/{unitId}")
|
||||
public AjaxResult getInfo(@PathVariable("unitId") Long unitId) {
|
||||
return success(mesBaseUnitInfoService.selectMesBaseUnitInfoByUnitId(unitId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增单位信息
|
||||
*/
|
||||
@RequiresPermissions("mes:mesBaseUnitInfo:add")
|
||||
@Log(title = "单位信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MesBaseUnitInfo mesBaseUnitInfo) {
|
||||
return toAjax(mesBaseUnitInfoService.insertMesBaseUnitInfo(mesBaseUnitInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改单位信息
|
||||
*/
|
||||
@RequiresPermissions("mes:mesBaseUnitInfo:edit")
|
||||
@Log(title = "单位信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MesBaseUnitInfo mesBaseUnitInfo) {
|
||||
return toAjax(mesBaseUnitInfoService.updateMesBaseUnitInfo(mesBaseUnitInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除单位信息
|
||||
*/
|
||||
@RequiresPermissions("mes:mesBaseUnitInfo:remove")
|
||||
@Log(title = "单位信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{unitIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] unitIds) {
|
||||
return toAjax(mesBaseUnitInfoService.deleteMesBaseUnitInfoByUnitIds(unitIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.hw.mes.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hw.mes.domain.MesBaseUnitInfo;
|
||||
|
||||
/**
|
||||
* 单位信息Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-07-24
|
||||
*/
|
||||
public interface MesBaseUnitInfoMapper {
|
||||
/**
|
||||
* 查询单位信息
|
||||
*
|
||||
* @param unitId 单位信息主键
|
||||
* @return 单位信息
|
||||
*/
|
||||
public MesBaseUnitInfo selectMesBaseUnitInfoByUnitId(Long unitId);
|
||||
|
||||
public MesBaseUnitInfo selectMesBaseUnitInfoByErpId(Long erpId);
|
||||
/**
|
||||
* 查询单位信息列表
|
||||
*
|
||||
* @param mesBaseUnitInfo 单位信息
|
||||
* @return 单位信息集合
|
||||
*/
|
||||
public List<MesBaseUnitInfo> selectMesBaseUnitInfoList(MesBaseUnitInfo mesBaseUnitInfo);
|
||||
|
||||
/**
|
||||
* 新增单位信息
|
||||
*
|
||||
* @param mesBaseUnitInfo 单位信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesBaseUnitInfo(MesBaseUnitInfo mesBaseUnitInfo);
|
||||
|
||||
/**
|
||||
* 修改单位信息
|
||||
*
|
||||
* @param mesBaseUnitInfo 单位信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesBaseUnitInfo(MesBaseUnitInfo mesBaseUnitInfo);
|
||||
|
||||
/**
|
||||
* 删除单位信息
|
||||
*
|
||||
* @param unitId 单位信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesBaseUnitInfoByUnitId(Long unitId);
|
||||
|
||||
/**
|
||||
* 批量删除单位信息
|
||||
*
|
||||
* @param unitIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesBaseUnitInfoByUnitIds(Long[] unitIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.hw.mes.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hw.mes.domain.MesBaseUnitInfo;
|
||||
|
||||
/**
|
||||
* 单位信息Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-07-24
|
||||
*/
|
||||
public interface IMesBaseUnitInfoService {
|
||||
/**
|
||||
* 查询单位信息
|
||||
*
|
||||
* @param unitId 单位信息主键
|
||||
* @return 单位信息
|
||||
*/
|
||||
public MesBaseUnitInfo selectMesBaseUnitInfoByUnitId(Long unitId);
|
||||
|
||||
/**
|
||||
* 查询单位信息列表
|
||||
*
|
||||
* @param mesBaseUnitInfo 单位信息
|
||||
* @return 单位信息集合
|
||||
*/
|
||||
public List<MesBaseUnitInfo> selectMesBaseUnitInfoList(MesBaseUnitInfo mesBaseUnitInfo);
|
||||
|
||||
/**
|
||||
* 新增单位信息
|
||||
*
|
||||
* @param mesBaseUnitInfo 单位信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesBaseUnitInfo(MesBaseUnitInfo mesBaseUnitInfo);
|
||||
|
||||
/**
|
||||
* 修改单位信息
|
||||
*
|
||||
* @param mesBaseUnitInfo 单位信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesBaseUnitInfo(MesBaseUnitInfo mesBaseUnitInfo);
|
||||
|
||||
/**
|
||||
* 批量删除单位信息
|
||||
*
|
||||
* @param unitIds 需要删除的单位信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesBaseUnitInfoByUnitIds(Long[] unitIds);
|
||||
|
||||
/**
|
||||
* 删除单位信息信息
|
||||
*
|
||||
* @param unitId 单位信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesBaseUnitInfoByUnitId(Long unitId);
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
package com.hw.mes.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hw.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.hw.mes.mapper.MesBaseUnitInfoMapper;
|
||||
import com.hw.mes.domain.MesBaseUnitInfo;
|
||||
import com.hw.mes.service.IMesBaseUnitInfoService;
|
||||
|
||||
/**
|
||||
* 单位信息Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-07-24
|
||||
*/
|
||||
@Service
|
||||
public class MesBaseUnitInfoServiceImpl implements IMesBaseUnitInfoService {
|
||||
@Autowired
|
||||
private MesBaseUnitInfoMapper mesBaseUnitInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询单位信息
|
||||
*
|
||||
* @param unitId 单位信息主键
|
||||
* @return 单位信息
|
||||
*/
|
||||
@Override
|
||||
public MesBaseUnitInfo selectMesBaseUnitInfoByUnitId(Long unitId) {
|
||||
return mesBaseUnitInfoMapper.selectMesBaseUnitInfoByUnitId(unitId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询单位信息列表
|
||||
*
|
||||
* @param mesBaseUnitInfo 单位信息
|
||||
* @return 单位信息
|
||||
*/
|
||||
@Override
|
||||
public List<MesBaseUnitInfo> selectMesBaseUnitInfoList(MesBaseUnitInfo mesBaseUnitInfo) {
|
||||
return mesBaseUnitInfoMapper.selectMesBaseUnitInfoList(mesBaseUnitInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增单位信息
|
||||
*
|
||||
* @param mesBaseUnitInfo 单位信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMesBaseUnitInfo(MesBaseUnitInfo mesBaseUnitInfo) {
|
||||
mesBaseUnitInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return mesBaseUnitInfoMapper.insertMesBaseUnitInfo(mesBaseUnitInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改单位信息
|
||||
*
|
||||
* @param mesBaseUnitInfo 单位信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMesBaseUnitInfo(MesBaseUnitInfo mesBaseUnitInfo) {
|
||||
mesBaseUnitInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
return mesBaseUnitInfoMapper.updateMesBaseUnitInfo(mesBaseUnitInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除单位信息
|
||||
*
|
||||
* @param unitIds 需要删除的单位信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMesBaseUnitInfoByUnitIds(Long[] unitIds) {
|
||||
return mesBaseUnitInfoMapper.deleteMesBaseUnitInfoByUnitIds(unitIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除单位信息信息
|
||||
*
|
||||
* @param unitId 单位信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMesBaseUnitInfoByUnitId(Long unitId) {
|
||||
return mesBaseUnitInfoMapper.deleteMesBaseUnitInfoByUnitId(unitId);
|
||||
}
|
||||
}
|
@ -0,0 +1,120 @@
|
||||
<?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.hw.mes.mapper.MesBaseUnitInfoMapper">
|
||||
|
||||
<resultMap type="MesBaseUnitInfo" id="MesBaseUnitInfoResult">
|
||||
<result property="unitId" column="unit_id"/>
|
||||
<result property="unitCode" column="unit_code"/>
|
||||
<result property="unitName" column="unit_name"/>
|
||||
<result property="erpId" column="erp_id"/>
|
||||
<result property="unitStatus" column="unit_status"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<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="auditDate" column="audit_date"/>
|
||||
<result property="erpModifyDate" column="erp_modify_date"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMesBaseUnitInfoVo">
|
||||
select unit_id,
|
||||
unit_code,
|
||||
unit_name,
|
||||
erp_id,
|
||||
unit_status,
|
||||
remark,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
audit_date,
|
||||
erp_modify_date
|
||||
from mes_base_unit_info
|
||||
</sql>
|
||||
|
||||
<select id="selectMesBaseUnitInfoList" parameterType="MesBaseUnitInfo" resultMap="MesBaseUnitInfoResult">
|
||||
<include refid="selectMesBaseUnitInfoVo"/>
|
||||
<where>
|
||||
<if test="unitCode != null and unitCode != ''">and unit_code = #{unitCode}</if>
|
||||
<if test="unitName != null and unitName != ''">and unit_name like concat('%', #{unitName}, '%')</if>
|
||||
<if test="erpId != null ">and erp_id = #{erpId}</if>
|
||||
<if test="unitStatus != null and unitStatus != ''">and unit_status = #{unitStatus}</if>
|
||||
<if test="auditDate != null ">and audit_date = #{auditDate}</if>
|
||||
<if test="erpModifyDate != null ">and erp_modify_date = #{erpModifyDate}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMesBaseUnitInfoByUnitId" parameterType="Long" resultMap="MesBaseUnitInfoResult">
|
||||
<include refid="selectMesBaseUnitInfoVo"/>
|
||||
where unit_id = #{unitId}
|
||||
</select>
|
||||
|
||||
<select id="selectMesBaseUnitInfoByErpId" parameterType="Long" resultMap="MesBaseUnitInfoResult">
|
||||
<include refid="selectMesBaseUnitInfoVo"/>
|
||||
where erp_id = #{erpId}
|
||||
</select>
|
||||
|
||||
<insert id="insertMesBaseUnitInfo" parameterType="MesBaseUnitInfo" useGeneratedKeys="true" keyProperty="unitId">
|
||||
insert into mes_base_unit_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="unitCode != null">unit_code,</if>
|
||||
<if test="unitName != null and unitName != ''">unit_name,</if>
|
||||
<if test="erpId != null">erp_id,</if>
|
||||
<if test="unitStatus != null and unitStatus != ''">unit_status,</if>
|
||||
<if test="remark != null">remark,</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="auditDate != null">audit_date,</if>
|
||||
<if test="erpModifyDate != null">erp_modify_date,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="unitCode != null">#{unitCode},</if>
|
||||
<if test="unitName != null and unitName != ''">#{unitName},</if>
|
||||
<if test="erpId != null">#{erpId},</if>
|
||||
<if test="unitStatus != null and unitStatus != ''">#{unitStatus},</if>
|
||||
<if test="remark != null">#{remark},</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="auditDate != null">#{auditDate},</if>
|
||||
<if test="erpModifyDate != null">#{erpModifyDate},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMesBaseUnitInfo" parameterType="MesBaseUnitInfo">
|
||||
update mes_base_unit_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="unitCode != null">unit_code = #{unitCode},</if>
|
||||
<if test="unitName != null and unitName != ''">unit_name = #{unitName},</if>
|
||||
<if test="erpId != null">erp_id = #{erpId},</if>
|
||||
<if test="unitStatus != null and unitStatus != ''">unit_status = #{unitStatus},</if>
|
||||
<if test="remark != null">remark = #{remark},</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="auditDate != null">audit_date = #{auditDate},</if>
|
||||
<if test="erpModifyDate != null">erp_modify_date = #{erpModifyDate},</if>
|
||||
</trim>
|
||||
where unit_id = #{unitId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMesBaseUnitInfoByUnitId" parameterType="Long">
|
||||
delete
|
||||
from mes_base_unit_info
|
||||
where unit_id = #{unitId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMesBaseUnitInfoByUnitIds" parameterType="String">
|
||||
delete from mes_base_unit_info where unit_id in
|
||||
<foreach item="unitId" collection="array" open="(" separator="," close=")">
|
||||
#{unitId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue