Compare commits

..

No commits in common. "81da0279d08b3f4a34de34de01d422e5347e35f1" and "7e3a300a31f6fc50e9a45000e3926277bf6013f2" have entirely different histories.

30 changed files with 299 additions and 1266 deletions

View File

@ -42,21 +42,12 @@ public class MaHouseController extends BaseController {
* @return * @return
*/ */
@ApiOperation(value = "查询仓库组织树列表") @ApiOperation(value = "查询仓库组织树列表")
@GetMapping("/tree") @GetMapping("/houseTree")
public AjaxResult tree(MaHouse house) public AjaxResult tree(MaHouse house)
{ {
return success(houseService.getHouseTree(house)); return success(houseService.getHouseTree(house));
} }
/**
* 获取仓库管理ma_house_info详细信息
*/
@GetMapping(value = "/{houseId}")
public AjaxResult getInfo(@PathVariable("houseId") Long houseId)
{
return success(houseService.selectMaHouseByHouseId(houseId));
}
/** /**
* 新增仓库货架 * 新增仓库货架
*/ */

View File

@ -39,15 +39,6 @@ public class MaHouseSetController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
/**
* 获取仓库货架配置详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(maHouseSetService.selectMaHouseSetByHouseId(id));
}
/** /**
* 新增仓库货架配置 * 新增仓库货架配置
*/ */

View File

@ -0,0 +1,56 @@
package com.bonus.sgzb.base.controller;
import com.bonus.sgzb.base.domain.MaHouseShel;
import com.bonus.sgzb.base.service.MaHouseShelService;
import com.bonus.sgzb.common.core.web.controller.BaseController;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
import com.bonus.sgzb.common.security.utils.SecurityUtils;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* MaHouseShelController
* @Author dingjie
* @Date 2023-12-07
**/
@Api("仓库货架管理Controller")
@RestController
@RequestMapping("/houseShel")
public class MaHouseShelController extends BaseController {
@Autowired
private MaHouseShelService houseShelService;
/**
* 查询仓库货架列表
* @param houseShel 货架信息
* @return
*/
@GetMapping("/list")
public TableDataInfo list(MaHouseShel houseShel)
{
startPage();
List<MaHouseShel> list = houseShelService.selectHouseShelList(houseShel);
return getDataTable(list);
}
/**
* 新增仓库货架
*/
@PostMapping
public AjaxResult add(@Validated @RequestBody MaHouseShel houseShel){
// if (!houseShelService.checkHouseNameUnique(houseShel)) {
// return error("新增仓库货架名称'" + houseShel.getShelveName() + "'失败,仓库货架名称已存在");
// }
houseShel.setCreateBy(SecurityUtils.getUsername());
return toAjax(houseShelService.insertHouseShel(houseShel));
}
}

View File

@ -5,8 +5,6 @@ import com.bonus.sgzb.base.service.MaMachineService;
import com.bonus.sgzb.common.core.web.controller.BaseController; import com.bonus.sgzb.common.core.web.controller.BaseController;
import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.core.web.page.TableDataInfo; import com.bonus.sgzb.common.core.web.page.TableDataInfo;
import com.bonus.sgzb.common.log.annotation.Log;
import com.bonus.sgzb.common.log.enums.BusinessType;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -41,7 +39,6 @@ public class MaMachineController extends BaseController {
/** /**
* 新增机具设备管理 * 新增机具设备管理
*/ */
@Log(title = "新增机具设备管理", businessType = BusinessType.INSERT)
@ApiOperation(value = "新增机具设备管理") @ApiOperation(value = "新增机具设备管理")
@PostMapping @PostMapping
public AjaxResult maMachineAdd(@Validated @RequestBody MaMachine maMachine) public AjaxResult maMachineAdd(@Validated @RequestBody MaMachine maMachine)
@ -52,7 +49,6 @@ public class MaMachineController extends BaseController {
/** /**
* 删除机具设备管理 * 删除机具设备管理
*/ */
@Log(title = "删除机具设备管理", businessType = BusinessType.DELETE)
@ApiOperation(value = "删除机具设备管理") @ApiOperation(value = "删除机具设备管理")
@DeleteMapping("/{maIds}") @DeleteMapping("/{maIds}")
public AjaxResult remove(@PathVariable Long[] maIds) public AjaxResult remove(@PathVariable Long[] maIds)
@ -64,7 +60,6 @@ public class MaMachineController extends BaseController {
/** /**
* 修改机具设备管理 * 修改机具设备管理
*/ */
@Log(title = "修改机具设备管理", businessType = BusinessType.UPDATE)
@ApiOperation(value = "修改机具设备管理") @ApiOperation(value = "修改机具设备管理")
@PutMapping @PutMapping
public AjaxResult edit(@Validated @RequestBody MaMachine maMachine) public AjaxResult edit(@Validated @RequestBody MaMachine maMachine)

View File

@ -1,42 +1,33 @@
package com.bonus.sgzb.base.controller; package com.bonus.sgzb.base.controller;
import com.bonus.sgzb.base.domain.MaType;
import com.bonus.sgzb.base.service.ITypeService; import com.bonus.sgzb.base.service.ITypeService;
import com.bonus.sgzb.common.core.constant.HttpStatus;
import com.bonus.sgzb.common.core.web.controller.BaseController; import com.bonus.sgzb.common.core.web.controller.BaseController;
import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.core.web.page.TableDataInfo; import com.bonus.sgzb.common.core.web.page.TableDataInfo;
import com.bonus.sgzb.common.log.annotation.Log;
import com.bonus.sgzb.common.log.enums.BusinessType;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import java.util.List; import org.springframework.web.bind.annotation.RequestMapping;
import java.util.stream.Collectors; import org.springframework.web.bind.annotation.RestController;
/** /**
* 工机具类型管理控制层 * 工机具类型管理控制层
*/ */
@RestController @RestController
@Api(value = "工机具类型管理控制层")
@RequestMapping("/type") @RequestMapping("/type")
public class MaTypeController extends BaseController { public class MaTypeController extends BaseController {
@Autowired @Autowired
private ITypeService iTypeService; private ITypeService iTypeService;
/** /**
* 根据类型名称查询类型 * 根据类型名称查询类型
* @return 结果 * @return
*/ */
@ApiOperation(value = "根据类型名称查询类型")
@GetMapping("/getMaTypeList") @GetMapping("/getMaTypeList")
public AjaxResult getMaTypeList(String typeName){ public AjaxResult getMaTypeList(String typeName){
return AjaxResult.success(iTypeService.getMaTypeList(typeName)); return AjaxResult.success(iTypeService.getMaTypeList(typeName));
} }
@ -46,67 +37,14 @@ public class MaTypeController extends BaseController {
* @param typeId * @param typeId
* @return * @return
*/ */
@ApiOperation(value = "根据左列表类型id查询右表格") @GetMapping("/getListByMaType/{typeId}/{typeName}")
@GetMapping("/getListByMaType") public TableDataInfo getListByMaType(@PathVariable("typeId") Long typeId,@PathVariable("typeName") String typeName){
public TableDataInfo getListByMaType(@RequestParam(required = false) Long typeId,
@RequestParam(required = false) String typeName,
@RequestParam(required = false) Integer pageSize,
@RequestParam(required = false) Integer pageNum){
if(typeId==null){ if(typeId==null){
return null; return null;
} }
List<MaType> listByMaType = iTypeService.getListByMaType(typeId, typeName); startPage();
TableDataInfo rspData = new TableDataInfo(); return getDataTable(iTypeService.getListByMaType(typeId,typeName));
rspData.setTotal(listByMaType.size());
rspData.setCode(HttpStatus.SUCCESS);
listByMaType = listByMaType.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
rspData.setRows(listByMaType);
rspData.setMsg("查询成功");
return rspData;
}
/**
* 获取机具类型管理ma_type详细信息
*/
@ApiOperation(value = "获取机具类型管理ma_type详细信息")
@GetMapping(value = "/{typeId}")
public AjaxResult getInfo(@PathVariable("typeId") Long typeId)
{
return success(iTypeService.selectMaTypeByTypeId(typeId));
}
/**
* 新增机具类型管理ma_type
*/
@ApiOperation(value = "新增机具类型管理ma_type")
@Log(title = "机具类型管理ma_type", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MaType maType)
{
return toAjax(iTypeService.insertMaType(maType));
}
/**
* 修改机具类型管理ma_type
*/
@ApiOperation(value = "修改机具类型管理ma_type")
@Log(title = "机具类型管理ma_type", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MaType maType)
{
return toAjax(iTypeService.updateMaType(maType));
}
/**
* 删除机具类型管理ma_type
*/
@ApiOperation(value = "删除机具类型管理ma_type")
@Log(title = "机具类型管理ma_type", businessType = BusinessType.DELETE)
@DeleteMapping("/{typeId}")
public AjaxResult remove(@PathVariable Long typeId)
{
return toAjax(iTypeService.deleteMaTypeByTypeId(typeId));
} }

View File

@ -60,14 +60,6 @@ public class MaHouse extends BaseEntity {
@ApiModelProperty(value= "数据所属组织") @ApiModelProperty(value= "数据所属组织")
private String companyId; private String companyId;
/** 联系人 */
@ApiModelProperty(value= "联系人")
private String concat;
/** 联系电话 */
@ApiModelProperty(value= "联系电话")
private String phone;
/** 数据所属组织 */ /** 数据所属组织 */
@ApiModelProperty(value= "排序") @ApiModelProperty(value= "排序")
private int sort; private int sort;
@ -196,20 +188,4 @@ public class MaHouse extends BaseEntity {
public void setChildren(List<MaHouse> children) { public void setChildren(List<MaHouse> children) {
this.children = children; this.children = children;
} }
public String getConcat() {
return concat;
}
public void setConcat(String concat) {
this.concat = concat;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
} }

View File

@ -17,21 +17,6 @@ public class MaMachine extends BaseEntity {
*/ */
@ApiModelProperty(value = "类型ID") @ApiModelProperty(value = "类型ID")
private long typeId; private long typeId;
/**
* 物品种类
*/
@ApiModelProperty(value = "物品种类")
private String itemType;
/**
* 设备类型
*/
@ApiModelProperty(value = "设备类型")
private String deviceType;
/**
* 规格型号
*/
@ApiModelProperty(value = "规格型号")
private String specificationType;
/** /**
* 机具编号 * 机具编号
*/ */
@ -331,27 +316,4 @@ public class MaMachine extends BaseEntity {
this.companyId = companyId; this.companyId = companyId;
} }
public String getItemType() {
return itemType;
}
public void setItemType(String itemType) {
this.itemType = itemType;
}
public String getDeviceType() {
return deviceType;
}
public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
}
public String getSpecificationType() {
return specificationType;
}
public void setSpecificationType(String specificationType) {
this.specificationType = specificationType;
}
} }

View File

@ -2,11 +2,8 @@ package com.bonus.sgzb.base.domain;
import com.bonus.sgzb.common.core.annotation.Excel; import com.bonus.sgzb.common.core.annotation.Excel;
import com.bonus.sgzb.common.core.web.domain.BaseEntity; import com.bonus.sgzb.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 工机具类型管理实体类 * 工机具类型管理实体类
@ -16,144 +13,93 @@ public class MaType extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 类型ID */ /** 类型ID */
@ApiModelProperty(value = "类型ID") @Excel(name = "类型ID")
private Long typeId; private Long typeId;
/** 类型名称 */ /** 类型名称 */
@ApiModelProperty(value = "类型名称") @Excel(name = "类型名称")
private String typeName; private String typeName;
/** 上级ID */ /** 上级ID */
@ApiModelProperty(value = "上级ID") @Excel(name = "上级ID")
private Long parentId; private Long parentId;
/** 帐号状态0正常 1停用 */ /** 帐号状态0正常 1停用 */
@ApiModelProperty(value = "帐号状态0正常 1停用") @Excel(name = "帐号状态0正常 1停用")
private String status; private String status;
/** 实时库存 */ /** 实时库存 */
@ApiModelProperty(value = "实时库存") @Excel(name = "实时库存")
private String num; private String num;
/** 计量单位id */ /** 计量单位id */
@ApiModelProperty(value = "计量单位id") @Excel(name = "计量单位id")
private String unitId; private String unitId;
/** 管理方式 */ /** 管理方式 */
@ApiModelProperty(value = "管理方式") @Excel(name = "管理方式")
private String manageType; private String manageType;
/** 租赁单价 */ /** 租赁单价 */
@ApiModelProperty(value = "租赁单价") @Excel(name = "租赁单价")
private String leasePrice; private String leasePrice;
/** 原价 */ /** 原价 */
@ApiModelProperty(value = "原价") @Excel(name = "原价")
private String buyPrice; private String buyPrice;
/** 丢失赔偿价 */ /** 丢失赔偿价 */
@ApiModelProperty(value = "丢失赔偿价") @Excel(name = "丢失赔偿价")
private String payPrice; private String payPrice;
/** 层级 */ /** 层级 */
@ApiModelProperty(value = "层级") @Excel(name = "层级")
private String level; private String level;
/** 额定载荷 */ /** 额定载荷 */
@ApiModelProperty(value = "额定载荷") @Excel(name = "额定载荷")
private String ratedLoad; private String ratedLoad;
/** 试验载荷 */ /** 试验载荷 */
@ApiModelProperty(value = "试验载荷") @Excel(name = "试验载荷")
private String testLoad; private String testLoad;
/** 持荷时间 */ /** 持荷时间 */
@ApiModelProperty(value = "持荷时间") @Excel(name = "持荷时间")
private String holdingTime; private String holdingTime;
/** 库存预警数量 */ /** 库存预警数量 */
@ApiModelProperty(value = "库存预警数量") @Excel(name = "库存预警数量")
private String warnNum; private String warnNum;
/** 库存预警数量 */
@ApiModelProperty(value = "是否计划管理0代表否 1代表是")
private String isPlan;
/** 库存预警数量 */
@ApiModelProperty(value = "是否安措费机具0代表否1代表是")
private String isAncuo;
/** 删除标志0代表存在 2代表删除 */ /** 删除标志0代表存在 2代表删除 */
@ApiModelProperty(value = "删除标志0代表存在 2代表删除") @Excel(name = "删除标志0代表存在 2代表删除")
private String delFlag; private String delFlag;
/** 创建者 */ /** 创建者 */
@ApiModelProperty(value = "创建者") @Excel(name = "创建者")
private String createBy; private String createBy;
/** 创建时间 */ /** 创建时间 */
@ApiModelProperty(value = "创建时间") @Excel(name = "创建时间")
private Date createTime; private Date createTime;
/** 更新者 */ /** 更新者 */
@ApiModelProperty(value = "更新者") @Excel(name = "更新者")
private String updateBy; private String updateBy;
/** 更新时间 */ /** 更新时间 */
@ApiModelProperty(value = "更新时间") @Excel(name = "更新时间")
private Date updateTime; private Date updateTime;
/** 备注 */ /** 备注 */
@ApiModelProperty(value = "备注") @Excel(name = "备注")
private String remark; private String remark;
/** 数据所属组织 */ /** 数据所属组织 */
@ApiModelProperty(value = "数据所属组织") @Excel(name = "数据所属组织")
private String companyId; private String companyId;
/** 图片名称 */
@ApiModelProperty(value = "图片名称")
private String photoName;
/** 图片路径 */
@ApiModelProperty(value = "图片路径")
private String photoUrl;
/** 文档名称 */
@ApiModelProperty(value = "文档名称")
private String documentName;
/** 文档路径 */
@ApiModelProperty(value = "文档路径")
private String documentUrl;
/** 库管员id */
@ApiModelProperty(value = "库管员id")
private long keeperUserId;
/** 库管员名称 */
@ApiModelProperty(value = "库管员名称")
private String keeperUserName;
/** 库管员id */
@ApiModelProperty(value = "维修员id")
private long repairUserId;
/** 维修员名称 */
@ApiModelProperty(value = "维修员名称")
private String repairUserName;
/** 资产属性id */
@ApiModelProperty(value = "资产属性id")
private long propId;
/** 资产属性名称 */
@ApiModelProperty(value = "资产属性名称")
private String propName;
private List<MaType> children = new ArrayList<>();
public Long getTypeId() { public Long getTypeId() {
return typeId; return typeId;
} }
@ -339,108 +285,4 @@ public class MaType extends BaseEntity {
public void setCompanyId(String companyId) { public void setCompanyId(String companyId) {
this.companyId = companyId; this.companyId = companyId;
} }
public String getPhotoName() {
return photoName;
}
public void setPhotoName(String photoName) {
this.photoName = photoName;
}
public String getPhotoUrl() {
return photoUrl;
}
public void setPhotoUrl(String photoUrl) {
this.photoUrl = photoUrl;
}
public String getDocumentName() {
return documentName;
}
public void setDocumentName(String documentName) {
this.documentName = documentName;
}
public String getDocumentUrl() {
return documentUrl;
}
public void setDocumentUrl(String documentUrl) {
this.documentUrl = documentUrl;
}
public String getIsPlan() {
return isPlan;
}
public void setIsPlan(String isPlan) {
this.isPlan = isPlan;
}
public String getIsAncuo() {
return isAncuo;
}
public void setIsAncuo(String isAncuo) {
this.isAncuo = isAncuo;
}
public long getKeeperUserId() {
return keeperUserId;
}
public void setKeeperUserId(long keeperUserId) {
this.keeperUserId = keeperUserId;
}
public String getKeeperUserName() {
return keeperUserName;
}
public void setKeeperUserName(String keeperUserName) {
this.keeperUserName = keeperUserName;
}
public long getRepairUserId() {
return repairUserId;
}
public void setRepairUserId(long repairUserId) {
this.repairUserId = repairUserId;
}
public String getRepairUserName() {
return repairUserName;
}
public void setRepairUserName(String repairUserName) {
this.repairUserName = repairUserName;
}
public long getPropId() {
return propId;
}
public void setPropId(long propId) {
this.propId = propId;
}
public String getPropName() {
return propName;
}
public void setPropName(String propName) {
this.propName = propName;
}
public List<MaType> getChildren() {
return children;
}
public void setChildren(List<MaType> children) {
this.children = children;
}
} }

View File

@ -30,36 +30,5 @@ public class MaTypeKeeper extends BaseEntity {
@Excel(name = "数据所属组织") @Excel(name = "数据所属组织")
private String companyId; private String companyId;
public Long getTypeId() {
return typeId;
}
public void setTypeId(Long typeId) {
this.typeId = typeId;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
} }

View File

@ -1,79 +0,0 @@
package com.bonus.sgzb.base.domain;
import com.bonus.sgzb.common.core.annotation.Excel;
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 维修班机具配置ma_type_repair对象 ma_type_repair
*
* @author bonus
* @date 2023-12-11
*/
public class MaTypeRepair extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 类型ID */
private Long typeId;
/** 用户 */
@Excel(name = "用户")
private Long userId;
/** 创建时间 */
@Excel(name = "创建时间")
private String time;
/** 数据所属组织 */
@Excel(name = "数据所属组织")
private String companyId;
public void setTypeId(Long typeId)
{
this.typeId = typeId;
}
public Long getTypeId()
{
return typeId;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setTime(String time)
{
this.time = time;
}
public String getTime()
{
return time;
}
public void setCompanyId(String companyId)
{
this.companyId = companyId;
}
public String getCompanyId()
{
return companyId;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("typeId", getTypeId())
.append("userId", getUserId())
.append("time", getTime())
.append("companyId", getCompanyId())
.toString();
}
}

View File

@ -1,7 +1,6 @@
package com.bonus.sgzb.base.domain.vo; package com.bonus.sgzb.base.domain.vo;
import com.bonus.sgzb.base.domain.MaHouse; import com.bonus.sgzb.base.domain.MaHouse;
import com.bonus.sgzb.base.domain.MaType;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import java.io.Serializable; import java.io.Serializable;
@ -39,13 +38,6 @@ public class TreeSelect implements Serializable
this.children = maHouse.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); this.children = maHouse.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
} }
public TreeSelect(MaType maType)
{
this.id = maType.getTypeId();
this.label = maType.getTypeName();
this.children = maType.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
}
public Long getId() public Long getId()
{ {
return id; return id;

View File

@ -70,6 +70,4 @@ public interface MaHouseMapper {
List<MaHouse> selectHouse(); List<MaHouse> selectHouse();
List<MaHouse> selectHouseParent(@Param("parentId") long parentId); List<MaHouse> selectHouseParent(@Param("parentId") long parentId);
MaHouse selectMaHouseByHouseId(Long houseId);
} }

View File

@ -12,6 +12,4 @@ public interface MaHouseSetMapper {
public int deleteHouseSetById(Long id); public int deleteHouseSetById(Long id);
public int updateHouseSet(MaHouseSet maHouseSet); public int updateHouseSet(MaHouseSet maHouseSet);
MaHouseSet selectMaHouseSetByHouseId(Long id);
} }

View File

@ -0,0 +1,18 @@
package com.bonus.sgzb.base.mapper;
import com.bonus.sgzb.base.domain.MaHouseShel;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* MaHouseShelMapper
* @Author dingjie
* @Date 2023-12-07
**/
@Mapper
public interface MaHouseShelMapper{
List<MaHouseShel> selectHouseShelList(MaHouseShel houseShel);
}

View File

@ -1,62 +0,0 @@
package com.bonus.sgzb.base.mapper;
import com.bonus.sgzb.base.domain.MaTypeFile;
import java.util.List;
/**
* 机具类型文件ma_type_fileMapper接口
*
* @author bonus
* @date 2023-12-11
*/
public interface MaTypeFileMapper
{
/**
* 查询机具类型文件ma_type_file
*
* @param typeId 机具类型文件ma_type_file主键
* @return 机具类型文件ma_type_file
*/
public MaTypeFile selectMaTypeFileByTypeId(Long typeId);
/**
* 查询机具类型文件ma_type_file列表
*
* @param maTypeFile 机具类型文件ma_type_file
* @return 机具类型文件ma_type_file集合
*/
public List<MaTypeFile> selectMaTypeFileList(MaTypeFile maTypeFile);
/**
* 新增机具类型文件ma_type_file
*
* @param maTypeFile 机具类型文件ma_type_file
* @return 结果
*/
public int insertMaTypeFile(MaTypeFile maTypeFile);
/**
* 修改机具类型文件ma_type_file
*
* @param maTypeFile 机具类型文件ma_type_file
* @return 结果
*/
public int updateMaTypeFile(MaTypeFile maTypeFile);
/**
* 删除机具类型文件ma_type_file
*
* @param typeId 机具类型文件ma_type_file主键
* @return 结果
*/
public int deleteMaTypeFileByTypeId(Long typeId);
/**
* 批量删除机具类型文件ma_type_file
*
* @param typeIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteMaTypeFileByTypeIds(Long[] typeIds);
}

View File

@ -1,9 +1,6 @@
package com.bonus.sgzb.base.mapper; package com.bonus.sgzb.base.mapper;
import com.bonus.sgzb.base.domain.MaPropSet;
import com.bonus.sgzb.base.domain.MaType; import com.bonus.sgzb.base.domain.MaType;
import com.bonus.sgzb.base.domain.MaTypeKeeper;
import com.bonus.sgzb.base.domain.MaTypeRepair;
import java.util.List; import java.util.List;
@ -16,52 +13,5 @@ public interface MaTypeMapper
{ {
List<MaType> selectMaTypeList(String typeName); List<MaType> selectMaTypeList();
/**
* 查询机具类型管理ma_type
*
* @param typeId 机具类型管理ma_type主键
* @return 机具类型管理ma_type
*/
public MaType selectMaTypeByTypeId(Long typeId);
/**
* 新增机具类型管理ma_type
*
* @param maType 机具类型管理ma_type
* @return 结果
*/
public int insertType(MaType maType);
/**
* 修改机具类型管理ma_type
*
* @param maType 机具类型管理ma_type
* @return 结果
*/
public int updateType(MaType maType);
/**
* 删除机具类型管理ma_type
*
* @param typeId 机具类型管理ma_type主键
* @return 结果
*/
public int deleteTypeById(Long typeId);
int insertKeeper(MaTypeKeeper typeKeeper);
int insertRepair(MaTypeRepair typeRepair);
int insertMaPropSet(MaPropSet propSet);
int updateKeeperByTypeId(MaTypeKeeper typeKeeper);
int updateRepairByTypeId(MaTypeRepair typeRepair);
int updatePropSetByTypeId(MaPropSet propSet);
MaType selectTypeByTypeId(long typeId);
} }

View File

@ -1,8 +1,6 @@
package com.bonus.sgzb.base.service; package com.bonus.sgzb.base.service;
import com.bonus.sgzb.base.domain.MaHouse;
import com.bonus.sgzb.base.domain.MaType; import com.bonus.sgzb.base.domain.MaType;
import com.bonus.sgzb.base.domain.vo.TreeSelect;
import java.util.List; import java.util.List;
@ -11,58 +9,8 @@ import java.util.List;
*/ */
public interface ITypeService { public interface ITypeService {
List<TreeSelect> getMaTypeList(String typeName); List<MaType> getMaTypeList(String typeName);
List<MaType> getListByMaType(Long typeId,String typeName); List<MaType> getListByMaType(Long typeId,String typeName);
/**
* 查询机具类型管理ma_type
*
* @param typeId 机具类型管理ma_type主键
* @return 机具类型管理ma_type
*/
public MaType selectMaTypeByTypeId(Long typeId);
/**
* 新增机具类型管理ma_type
*
* @param maType 机具类型管理ma_type
* @return 结果
*/
public int insertMaType(MaType maType);
/**
* 修改机具类型管理ma_type
*
* @param maType 机具类型管理ma_type
* @return 结果
*/
public int updateMaType(MaType maType);
/**
* 删除机具类型管理ma_type信息
*
* @param typeId 机具类型管理ma_type主键
* @return 结果
*/
public int deleteMaTypeByTypeId(Long typeId);
/**
* 构建前端所需要树结构
*
* @param maTypeList 状态列表
* @return 树结构列表
*/
public List<MaType> buildDeptTree(List<MaType> maTypeList);
/**
* 构建前端所需要下拉树结构
*
* @param maTypeList 工机具列表
* @return 下拉树结构列表
*/
public List<TreeSelect> buildDeptTreeSelect(List<MaType> maTypeList);
} }

View File

@ -74,12 +74,4 @@ public interface IhouseService {
* @return 树结构列表 * @return 树结构列表
*/ */
public List<MaHouse> buildDeptTree(List<MaHouse> maHouseList); public List<MaHouse> buildDeptTree(List<MaHouse> maHouseList);
/**
* 查询仓库管理ma_house_info
*
* @param houseId 仓库管理ma_house_info主键
* @return 仓库管理ma_house_info
*/
public MaHouse selectMaHouseByHouseId(Long houseId);
} }

View File

@ -13,6 +13,4 @@ public interface MaHouseSetService {
public int deleteHouseSetById(Long id); public int deleteHouseSetById(Long id);
public int updateHouseSet(MaHouseSet maHouseSet); public int updateHouseSet(MaHouseSet maHouseSet);
MaHouseSet selectMaHouseSetByHouseId(Long id);
} }

View File

@ -0,0 +1,18 @@
package com.bonus.sgzb.base.service;
import com.bonus.sgzb.base.domain.MaHouseShel;
import java.util.List;
/**
* MaHouseShelService
* @Author dingjie
* @Date 2023-12-07
**/
public interface MaHouseShelService{
List<MaHouseShel> selectHouseShelList(MaHouseShel houseShel);
int insertHouseShel(MaHouseShel houseShel);
}

View File

@ -25,20 +25,6 @@ public class MaHouseServiceImpl implements IhouseService {
@Resource @Resource
private MaHouseMapper houseMapper; private MaHouseMapper houseMapper;
/**
* 查询仓库管理ma_house_info
*
* @param houseId 仓库管理ma_house_info主键
* @return 仓库管理ma_house_info
*/
@Override
public MaHouse selectMaHouseByHouseId(Long houseId)
{
return houseMapper.selectMaHouseByHouseId(houseId);
}
/** /**
* 校验工程项目名称 * 校验工程项目名称
* *

View File

@ -33,16 +33,4 @@ public class MaHouseSetImpl implements MaHouseSetService {
public int updateHouseSet(MaHouseSet maHouseSet) { public int updateHouseSet(MaHouseSet maHouseSet) {
return maHouseSetMapper.updateHouseSet(maHouseSet); return maHouseSetMapper.updateHouseSet(maHouseSet);
} }
/**
* 查询仓库货架配置ma_house_set
*
* @param id 仓库货架配置ma_house_set主键
* @return 仓库货架配置ma_house_set
*/
@Override
public MaHouseSet selectMaHouseSetByHouseId(Long id)
{
return maHouseSetMapper.selectMaHouseSetByHouseId(id);
}
} }

View File

@ -0,0 +1,46 @@
package com.bonus.sgzb.base.service.impl;
import com.bonus.sgzb.base.domain.MaHouseShel;
import com.bonus.sgzb.base.mapper.MaHouseShelMapper;
import com.bonus.sgzb.base.service.MaHouseShelService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
* MaHouseShelServiceImpl
* @Author dingjie
* @Date 2023-12-07
**/
@Service
@Transactional(rollbackFor = Exception.class)
public class MaHouseShelServiceImpl implements MaHouseShelService {
@Resource
private MaHouseShelMapper houseShelMapper;
/**
* 根据查询条件筛选仓库货架
* @param houseShel 仓库货架信息
* @return 结果
*/
@Override
public List<MaHouseShel> selectHouseShelList(MaHouseShel houseShel) {
List<MaHouseShel> houseShelList = houseShelMapper.selectHouseShelList(houseShel);
return null;
}
/**
* 新增仓库货架
* @param houseShel 仓库货架信息
* @return 结果
*/
@Override
public int insertHouseShel(MaHouseShel houseShel) {
return 0;
}
}

View File

@ -1,52 +1,23 @@
package com.bonus.sgzb.base.service.impl; package com.bonus.sgzb.base.service.impl;
import com.bonus.sgzb.base.domain.MaMachine; import com.bonus.sgzb.base.domain.MaMachine;
import com.bonus.sgzb.base.domain.MaType;
import com.bonus.sgzb.base.mapper.MaMachineMapper; import com.bonus.sgzb.base.mapper.MaMachineMapper;
import com.bonus.sgzb.base.mapper.MaTypeMapper;
import com.bonus.sgzb.base.service.MaMachineService; import com.bonus.sgzb.base.service.MaMachineService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List; import java.util.List;
@Service @Service
public class MaMachineServiceImpl implements MaMachineService { public class MaMachineServiceImpl implements MaMachineService {
@Resource @Autowired
private MaMachineMapper maMachineMapper; private MaMachineMapper maMachineMapper;
@Resource
private MaTypeMapper typeMapper;
@Override @Override
public List<MaMachine> getMaMachine(MaMachine maMachine) { public List<MaMachine> getMaMachine(MaMachine maMachine) {
List<MaMachine> maMachineList = maMachineMapper.getMaMachine(maMachine); return maMachineMapper.getMaMachine(maMachine);
for (MaMachine machine : maMachineList) {
// 添加查询物品种类,设备类型,规格型号
getType(machine);
}
return maMachineList;
}
/**
* 添加查询物品种类,设备类型,规格型号
* @param machine
* @return
*/
private void getType(MaMachine machine) {
long typeId = machine.getTypeId();
// 规格型号
MaType maType = typeMapper.selectTypeByTypeId(typeId);
// 设备类型
machine.setSpecificationType(maType.getTypeName());
MaType maType1 = typeMapper.selectTypeByTypeId(maType.getParentId());
// 物品种类
machine.setDeviceType(maType1.getTypeName());
MaType maType2 = typeMapper.selectTypeByTypeId(maType1.getParentId());
machine.setItemType(maType2.getTypeName());
} }
@Override @Override

View File

@ -1,18 +1,15 @@
package com.bonus.sgzb.base.service.impl; package com.bonus.sgzb.base.service.impl;
import com.bonus.sgzb.base.domain.*; import com.bonus.sgzb.base.domain.MaType;
import com.bonus.sgzb.base.domain.vo.TreeSelect;
import com.bonus.sgzb.base.mapper.MaTypeFileMapper;
import com.bonus.sgzb.base.mapper.MaTypeMapper; import com.bonus.sgzb.base.mapper.MaTypeMapper;
import com.bonus.sgzb.base.service.ITypeService; import com.bonus.sgzb.base.service.ITypeService;
import com.bonus.sgzb.common.core.utils.DateUtils;
import com.bonus.sgzb.common.core.utils.StringUtils; import com.bonus.sgzb.common.core.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import java.util.ArrayList;
import java.util.*; import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -21,176 +18,69 @@ import java.util.stream.Collectors;
@Service @Service
public class MaTypeServiceImpl implements ITypeService { public class MaTypeServiceImpl implements ITypeService {
@Resource @Autowired
private MaTypeMapper maTypeMapper; private MaTypeMapper maTypeMapper;
@Resource
private MaTypeFileMapper typeFileMapper;
/**
* 查询机具类型管理ma_type
*
* @param typeId 机具类型管理ma_type主键
* @return 机具类型管理ma_type
*/
@Override @Override
public MaType selectMaTypeByTypeId(Long typeId) { public List<MaType> getMaTypeList(String typeName) {
return maTypeMapper.selectMaTypeByTypeId(typeId);
}
List<MaType> maTypes = maTypeMapper.selectMaTypeList();
/** if(StringUtils.isNotNull(typeName)){
* 新增机具类型管理ma_type //根据类型名称过滤集合
* List<MaType> types = maTypes
* @param maType 机具类型管理ma_type .stream()
* @return 结果 .filter(maType -> maType.getTypeName().contains(typeName))
*/ .collect(Collectors.toList());
@Override //如果没有查询到那么返回空
@Transactional if(types.size()==0){
public int insertMaType(MaType maType) { return null;
maType.setCreateTime(DateUtils.getNowDate()); }
int i = maTypeMapper.insertType(maType); //递归获取树
Long typeId = maType.getTypeId(); return getTypeListByMaType(Collections.singletonList(types.get(0)),maTypes,null);
// 图片路径保存
MaTypeFile typeFile = new MaTypeFile();
typeFile.setTypeId(typeId);
typeFile.setFileName(maType.getPhotoName());
typeFile.setFileUrl(maType.getPhotoUrl());
typeFile.setFileType("");
typeFileMapper.insertMaTypeFile(typeFile);
// 文档路径保存
MaTypeFile typeFile1 = new MaTypeFile();
typeFile1.setTypeId(typeId);
typeFile1.setFileName(maType.getDocumentName());
typeFile1.setFileUrl(maType.getDocumentUrl());
typeFile1.setFileType("");
typeFileMapper.insertMaTypeFile(typeFile1);
// 库管员配置
MaTypeKeeper typeKeeper = new MaTypeKeeper();
typeKeeper.setUserId(maType.getKeeperUserId());
typeKeeper.setTypeId(typeId);
maTypeMapper.insertKeeper(typeKeeper);
// 维修员配置
MaTypeRepair typeRepair = new MaTypeRepair();
typeRepair.setUserId(maType.getRepairUserId());
typeRepair.setTypeId(typeId);
maTypeMapper.insertRepair(typeRepair);
// 资产属性配置
MaPropSet propSet = new MaPropSet();
propSet.setTypeId(typeId);
propSet.setPropId(maType.getPropId());
maTypeMapper.insertMaPropSet(propSet);
return i;
}
/**
* 修改机具类型管理ma_type
*
* @param maType 机具类型管理ma_type
* @return 结果
*/
@Override
public int updateMaType(MaType maType) {
Long typeId = maType.getTypeId();
maType.setUpdateTime(DateUtils.getNowDate());
int i = maTypeMapper.updateType(maType);
// 图片路径保存
if (StringUtils.isNotEmpty(maType.getPhotoName()) && StringUtils.isNotEmpty(maType.getPhotoUrl())) {
MaTypeFile typeFile = new MaTypeFile();
typeFile.setTypeId(typeId);
typeFile.setFileName(maType.getPhotoName());
typeFile.setFileUrl(maType.getPhotoUrl());
typeFile.setFileType("1");
typeFileMapper.updateMaTypeFile(typeFile);
} }
// 文档路径保存 return maTypes;
if (StringUtils.isNotEmpty(maType.getDocumentName()) && StringUtils.isNotEmpty(maType.getDocumentUrl())) {
MaTypeFile typeFile1 = new MaTypeFile();
typeFile1.setTypeId(typeId);
typeFile1.setFileName(maType.getDocumentName());
typeFile1.setFileUrl(maType.getDocumentUrl());
typeFile1.setFileType("2");
typeFileMapper.updateMaTypeFile(typeFile1);
}
// 库管员配置
if (maType.getKeeperUserId() >= 0L) {
MaTypeKeeper typeKeeper = new MaTypeKeeper();
typeKeeper.setUserId(maType.getKeeperUserId());
typeKeeper.setTypeId(typeId);
maTypeMapper.updateKeeperByTypeId(typeKeeper);
}
// 维修员配置
if (maType.getRepairUserId() >= 0L) {
MaTypeRepair typeRepair = new MaTypeRepair();
typeRepair.setUserId(maType.getRepairUserId());
typeRepair.setTypeId(typeId);
maTypeMapper.updateRepairByTypeId(typeRepair);
}
// 资产属性配置
if (maType.getPropId() >= 0L) {
MaPropSet propSet = new MaPropSet();
propSet.setTypeId(typeId);
propSet.setPropId(maType.getPropId());
maTypeMapper.updatePropSetByTypeId(propSet);
}
return i;
}
/**
* 删除机具类型管理ma_type信息
*
* @param typeId 机具类型管理ma_type主键
* @return 结果
*/
@Override
public int deleteMaTypeByTypeId(Long typeId) {
return maTypeMapper.deleteTypeById(typeId);
}
@Override
public List<TreeSelect> getMaTypeList(String typeName) {
List<MaType> maTypes = maTypeMapper.selectMaTypeList(typeName);
//如果没有查询到那么返回空
return buildDeptTreeSelect(maTypes);
} }
/** /**
* 根据左列表类型id查询右表格 * 根据左列表类型id查询右表格
*
* @param typeId * @param typeId
* @return * @return
*/ */
@Override @Override
public List<MaType> getListByMaType(Long typeId, String typeName) { public List<MaType> getListByMaType(Long typeId, String typeName) {
List<MaType> maTypes = maTypeMapper.selectMaTypeList("");
List<MaType> maTypes = maTypeMapper.selectMaTypeList();
MaType maType = new MaType(); MaType maType = new MaType();
maType.setTypeId(typeId); maType.setTypeId(typeId);
List<MaType> typeListByMaType = getTypeListByMaType(Collections.singletonList(maType), maTypes, new ArrayList<>()); List<MaType> typeListByMaType = getTypeListByMaType(Collections.singletonList(maType), maTypes, new ArrayList<>());
if (StringUtils.isNotNull(typeName)) { if(StringUtils.isNotNull(typeName)){
//根据类型名称过滤集合 //根据类型名称过滤集合
List<MaType> types = typeListByMaType List<MaType> types = typeListByMaType
.stream() .stream()
.filter(ma -> ma.getTypeName().contains(typeName)) .filter(ma -> ma.getTypeName().contains(typeName))
.collect(Collectors.toList()); .collect(Collectors.toList());
//如果没有查询到那么返回空 //如果没有查询到那么返回空
return types; if(types.size()==0){
return null;
}
//递归获取树
return getTypeListByMaType(Collections.singletonList(types.get(0)),maTypes,null);
} }
return typeListByMaType; return typeListByMaType;
} }
/** /**
* 根据父级类型递归获取树结构 * 根据父级类型递归获取树结构
*
* @param * @param
* @return * @return
*/ */
private List<MaType> getTypeListByMaType(List<MaType> parentTypes, List<MaType> oldMaTypes, List<MaType> newMaTypes) { private List<MaType> getTypeListByMaType(List<MaType> parentTypes,List<MaType> oldMaTypes,List<MaType> newMaTypes) {
//初始化新容器 //初始化新容器
if (newMaTypes == null) { if(newMaTypes==null){
newMaTypes = new ArrayList<>(); newMaTypes = new ArrayList<>();
//添加父级对象 左边需要添加因为需要显示 右边不需要添加因为不需要显示 //添加父级对象 左边需要添加因为需要显示 右边不需要添加因为不需要显示
newMaTypes.addAll(parentTypes); newMaTypes.addAll(parentTypes);
@ -198,125 +88,21 @@ public class MaTypeServiceImpl implements ITypeService {
//递归父级容器 //递归父级容器
List<MaType> parentList = new ArrayList<>(); List<MaType> parentList = new ArrayList<>();
//过滤相同数据,减少循环,性能优化 //过滤相同数据,减少循环,性能优化
oldMaTypes = oldMaTypes.stream().filter(oldMaType -> !parentTypes.contains(oldMaType)).collect(Collectors.toList()); oldMaTypes = oldMaTypes.stream().filter(oldMaType->!parentTypes.contains(oldMaType)).collect(Collectors.toList());
for (MaType maType : oldMaTypes) { for (MaType maType : oldMaTypes) {
for (MaType parentType : parentTypes) { for (MaType parentType : parentTypes) {
if (maType.getParentId().equals(parentType.getTypeId())) { if(maType.getParentId().equals(parentType.getTypeId())){
newMaTypes.add(maType); newMaTypes.add(maType);
parentList.add(maType); parentList.add(maType);
} }
} }
} }
//如果还有父级递归查询 //如果还有父级递归查询
if (parentList.size() > 0) { if(parentList.size()>0){
return getTypeListByMaType(parentList, oldMaTypes, newMaTypes); return getTypeListByMaType(parentList,oldMaTypes,newMaTypes);
} else { }else{
List<MaType> result = new ArrayList<>();
for (MaType type : newMaTypes) {
boolean a = true;
Long typeId1 = type.getTypeId();
for (MaType type1 : newMaTypes) {
Long pid = type1.getParentId();
if (typeId1.equals(pid)) {
a = false;
}
}
if (a) {
result.add(type);
}
}
//返回 //返回
return result; return newMaTypes;
} }
} }
/**
* 构建前端所需要树结构
*
* @param maTypeList 部门列表
* @return 树结构列表
*/
@Override
public List<MaType> buildDeptTree(List<MaType> maTypeList)
{
List<MaType> returnList = new ArrayList<MaType>();
List<Long> tempList = maTypeList.stream().map(MaType::getTypeId).collect(Collectors.toList());
for (MaType maType : maTypeList)
{
// 如果是顶级节点, 遍历该父节点的所有子节点
if (!tempList.contains(maType.getParentId()))
{
recursionFn(maTypeList, maType);
returnList.add(maType);
}
}
if (returnList.isEmpty())
{
returnList = maTypeList;
}
return returnList;
}
/**
* 构建前端所需要下拉树结构
*
* @param depts 部门列表
* @return 下拉树结构列表
*/
@Override
public List<TreeSelect> buildDeptTreeSelect(List<MaType> depts)
{
List<MaType> deptTrees = buildDeptTree(depts);
return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
}
/**
* 递归列表
*/
private void recursionFn(List<MaType> list, MaType t)
{
// 得到子节点列表
List<MaType> childList = getChildList(list, t);
t.setChildren(childList);
for (MaType tChild : childList)
{
if (hasChild(list, tChild))
{
recursionFn(list, tChild);
}
}
}
/**
* 得到子节点列表
*/
private List<MaType> getChildList(List<MaType> list, MaType t)
{
List<MaType> tlist = new ArrayList<MaType>();
Iterator<MaType> it = list.iterator();
while (it.hasNext())
{
MaType n = (MaType) it.next();
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getTypeId().longValue())
{
tlist.add(n);
}
}
return tlist;
}
/**
* 判断是否有子节点
*/
private boolean hasChild(List<MaType> list, MaType t)
{
return getChildList(list, t).size() > 0 ? true : false;
}
} }

View File

@ -18,12 +18,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="companyId" column="company_id" /> <result property="companyId" column="company_id" />
<result property="sort" column="sort" /> <result property="sort" column="sort" />
<result property="concat" column="concat" />
<result property="phone" column="phone" />
</resultMap> </resultMap>
<sql id="selectHouseVo"> <sql id="selectHouseVo">
select house_id, house_name, parent_id, status, dept_id, del_flag, create_by, create_time, remark, company_id,phone ,concat select house_id, house_name, parent_id, status, dept_id, del_flag, create_by, create_time, remark, company_id, sort
from ma_house_info from ma_house_info
</sql> </sql>
@ -38,8 +36,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null and remark != ''">remark,</if> <if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if> <if test="createBy != null and createBy != ''">create_by,</if>
<if test="companyId != null and companyId != ''">company_id,</if> <if test="companyId != null and companyId != ''">company_id,</if>
<if test="concat != null and concat != ''">concat,</if>
<if test="phone != null and phone != ''">phone,</if>
create_time create_time
)values( )values(
<if test="houseId != null and houseId != 0">#{houseId},</if> <if test="houseId != null and houseId != 0">#{houseId},</if>
@ -51,8 +47,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="companyId != null and companyId != ''">#{companyId},</if> <if test="companyId != null and companyId != ''">#{companyId},</if>
<if test="concat != null and concat != ''">#{concat},</if>
<if test="phone != null and phone != ''">#{phone},</if>
sysdate() sysdate()
) )
</insert> </insert>
@ -68,8 +62,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if> <if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
<if test="concat != null and concat != ''">concat = #{concat},</if>
<if test="phone != null and phone != ''">phone = #{phone},</if>
update_time = sysdate() update_time = sysdate()
</set> </set>
where house_id = #{houseId} where house_id = #{houseId}
@ -81,7 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectHouseList" parameterType="com.bonus.sgzb.base.domain.MaHouse" resultMap="SysHouseResult"> <select id="selectHouseList" parameterType="com.bonus.sgzb.base.domain.MaHouse" resultMap="SysHouseResult">
select house_id, house_name, parent_id, status, dept_id, del_flag, create_by, create_time, remark, company_id, sort,concat,phone select house_id, house_name, parent_id, status, dept_id, del_flag, create_by, create_time, remark, company_id, sort
from ma_house_info from ma_house_info
<where> <where>
<if test="houseName != null and houseName != ''"> <if test="houseName != null and houseName != ''">
@ -114,9 +106,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectHouseVo"/> <include refid="selectHouseVo"/>
where house_name=#{houseName} limit 1 where house_name=#{houseName} limit 1
</select> </select>
<select id="selectMaHouseByHouseId" parameterType="Long" resultMap="SysHouseResult">
<include refid="selectHouseVo"/>
where house_id = #{houseId}
</select>
</mapper> </mapper>

View File

@ -26,11 +26,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from ma_house_set from ma_house_set
</sql> </sql>
<select id="selectMaHouseSetByHouseId" parameterType="Long" resultMap="SysHouseSetResult">
<include refid="selectHouseSetVo"/>
where id = #{id}
</select>
<insert id="maHouseSetAdd" parameterType="com.bonus.sgzb.base.domain.MaHouseSet" > <insert id="maHouseSetAdd" parameterType="com.bonus.sgzb.base.domain.MaHouseSet" >
insert into ma_house_set( insert into ma_house_set(
<if test="houseId != null and houseId != 0">house_id,</if> <if test="houseId != null and houseId != 0">house_id,</if>

View File

@ -0,0 +1,36 @@
<?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.bonus.sgzb.base.mapper.MaHouseShelMapper">
<resultMap id="BaseResultMap" type="com.bonus.sgzb.base.domain.MaHouseShel">
<id column="shelve_id" property="shelveId" jdbcType="BIGINT"/>
<result column="shelve_name" property="shelveName" jdbcType="VARCHAR"/>
<result column="parent_id" property="parentId" jdbcType="BIGINT"/>
<result column="contact" property="contact" jdbcType="VARCHAR"/>
<result column="sort" property="sort" jdbcType="INTEGER"/>
<result column="contact_phone" property="contactPhone" jdbcType="VARCHAR"/>
<result column="remark" property="remark" jdbcType="VARCHAR"/>
<result column="status" property="status" jdbcType="VARCHAR"/>
<result column="del_flag" property="delFlag" jdbcType="VARCHAR"/>
<result column="create_by" property="createBy" jdbcType="VARCHAR"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
<result column="update_by" property="updateBy" jdbcType="VARCHAR"/>
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
<result column="company_id" property="companyId" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
shelve_id, shelve_name, parent_id, contact, sort, contact_phone, remark, status, del_flag, create_by, create_time, update_by, update_time, company_id
</sql>
<select id="selectHouseShelList" resultMap="BaseResultMap">
<include refid="Base_Column_List"/>
from ma_house_shell
<where>
<if test="shelveName != null and shelveName != ''">
and shelve_name like concat('%', #{shelveName}, '%')
</if>
</where>
</select>
</mapper>

View File

@ -3,32 +3,6 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.sgzb.base.mapper.MaTypeMapper"> <mapper namespace="com.bonus.sgzb.base.mapper.MaTypeMapper">
<resultMap type="com.bonus.sgzb.base.domain.MaType" id="MaTypeResult">
<result property="typeId" column="type_id" />
<result property="typeName" column="type_name" />
<result property="parentId" column="parent_id" />
<result property="status" column="status" />
<result property="num" column="num" />
<result property="unitId" column="unit_id" />
<result property="manageType" column="manage_type" />
<result property="leasePrice" column="lease_price" />
<result property="buyPrice" column="buy_price" />
<result property="payPrice" column="pay_price" />
<result property="level" column="level" />
<result property="ratedLoad" column="rated_load" />
<result property="testLoad" column="test_load" />
<result property="holdingTime" column="holding_time" />
<result property="warnNum" column="warn_num" />
<result property="delFlag" column="del_flag" />
<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="isPlan" column="is_plan" />
<result property="isAncuo" column="is_ancuo" />
<result property="remark" column="remark" />
<result property="companyId" column="company_id" />
</resultMap>
<sql id="selectMaTypeVo"> <sql id="selectMaTypeVo">
select type_id, type_name, parent_id, status, num, unit_id, manage_type, lease_price, buy_price, pay_price, level, rated_load, test_load, holding_time, warn_num, del_flag, create_by, create_time, remark, company_id select type_id, type_name, parent_id, status, num, unit_id, manage_type, lease_price, buy_price, pay_price, level, rated_load, test_load, holding_time, warn_num, del_flag, create_by, create_time, remark, company_id
@ -36,57 +10,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<insert id="insertType" parameterType="com.bonus.sgzb.base.domain.MaType" useGeneratedKeys="true" keyProperty="typeId"> <insert id="insertType" parameterType="com.bonus.sgzb.base.domain.MaType" useGeneratedKeys="true" keyProperty="typeId">
insert into ma_type insert into ma_type(
<trim prefix="(" suffix=")" suffixOverrides=","> <if test="typeId != null and typeId != 0">type_id,</if>
<if test="typeName != null and typeName != ''">type_name,</if> <if test="typeName != null and typeName != ''">type_name,</if>
<if test="parentId != null">parent_id,</if> <if test="parentId != null and parentId != 0">parent_id,</if>
<if test="status != null">status,</if> <if test="status != null and status != ''">status,</if>
<if test="num != null">num,</if> <if test="num != null and num != 0">num,</if>
<if test="unitId != null">unit_id,</if> <if test="unitId != null and unitId != 0">unit_id,</if>
<if test="manageType != null">manage_type,</if> <if test="manageType != null and manageType != 0">manage_type,</if>
<if test="leasePrice != null">lease_price,</if> <if test="leasePrice != null and leasePrice != 0">lease_price,</if>
<if test="buyPrice != null">buy_price,</if> <if test="buyPrice != null and buyPrice != 0">buy_price,</if>
<if test="payPrice != null">pay_price,</if> <if test="payPrice != null and payPrice != 0">pay_price,</if>
<if test="level != null">level,</if> <if test="remark != null and remark != ''">remark,</if>
<if test="ratedLoad != null">rated_load,</if> <if test="createBy != null and createBy != ''">create_by,</if>
<if test="testLoad != null">test_load,</if> <if test="companyId != null and companyId != ''">company_id,</if>
<if test="holdingTime != null">holding_time,</if> create_time
<if test="warnNum != null">warn_num,</if> )values(
<if test="delFlag != null">del_flag,</if> <if test="typeId != null and typeId != 0">#{typeId},</if>
<if test="createBy != null">create_by,</if> <if test="typeName != null and typeName != ''">#{typeName},</if>
<if test="createTime != null">create_time,</if> <if test="parentId != null and parentId != 0">#{parentId},</if>
<if test="updateBy != null">update_by,</if> <if test="status != null and status != ''">#{status},</if>
<if test="updateTime != null">update_time,</if> <if test="num != null and num != ''">#{num},</if>
<if test="isPlan != null">is_plan,</if> <if test="unitId != null and unitId != 0">#{unitId},</if>
<if test="isAncuo != null">is_ancuo,</if> <if test="manageType != null and manageType != ''">#{manageType},</if>
<if test="remark != null">remark,</if> <if test="leasePrice != null and leasePrice != ''">#{leasePrice},</if>
<if test="companyId != null">company_id,</if> <if test="buyPrice != null and buyPrice != ''">#{buyPrice},</if>
</trim> <if test="payPrice != null and payPrice != ''">#{payPrice},</if>
<trim prefix="values (" suffix=")" suffixOverrides=","> <if test="remark != null and remark != ''">#{remark},</if>
<if test="typeName != null and typeName != ''">#{typeName},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="parentId != null">#{parentId},</if> <if test="companyId != null and companyId != ''">#{companyId},</if>
<if test="status != null">#{status},</if> sysdate()
<if test="num != null">#{num},</if> )
<if test="unitId != null">#{unitId},</if>
<if test="manageType != null">#{manageType},</if>
<if test="leasePrice != null">#{leasePrice},</if>
<if test="buyPrice != null">#{buyPrice},</if>
<if test="payPrice != null">#{payPrice},</if>
<if test="level != null">#{level},</if>
<if test="ratedLoad != null">#{ratedLoad},</if>
<if test="testLoad != null">#{testLoad},</if>
<if test="holdingTime != null">#{holdingTime},</if>
<if test="warnNum != null">#{warnNum},</if>
<if test="delFlag != null">#{delFlag},</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="isPlan != null">#{isPlan},</if>
<if test="isAncuo != null">#{isAncuo},</if>
<if test="remark != null">#{remark},</if>
<if test="companyId != null">#{companyId},</if>
</trim>
</insert> </insert>
<insert id="insertTypeFile" parameterType="com.bonus.sgzb.base.domain.MaTypeFile" useGeneratedKeys="true" keyProperty="typeId"> <insert id="insertTypeFile" parameterType="com.bonus.sgzb.base.domain.MaTypeFile" useGeneratedKeys="true" keyProperty="typeId">
@ -115,31 +69,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateType"> <update id="updateType">
update ma_type update ma_type
<trim prefix="SET" suffixOverrides=","> <set>
<if test="typeName != null and typeName != ''">type_name = #{typeName},</if> <if test="typeName != null and typeName != ''">type_name = #{typeName},</if>
<if test="parentId != null">parent_id = #{parentId},</if> <if test="parentId != null and parentId != ''">parent_id = #{parentId},</if>
<if test="status != null">status = #{status},</if> <if test="status != null and status != ''">status = #{status},</if>
<if test="num != null">num = #{num},</if> <if test="num != null and num != ''">num = #{num},</if>
<if test="unitId != null">unit_id = #{unitId},</if> <if test="unitId != null and unitId != ''">unit_id = #{unitId},</if>
<if test="manageType != null">manage_type = #{manageType},</if> <if test="manageType != null and manageType != ''">manage_type = #{manageType},</if>
<if test="leasePrice != null">lease_price = #{leasePrice},</if> <if test="leasePrice != null and leasePrice != ''">lease_price = #{leasePrice},</if>
<if test="buyPrice != null">buy_price = #{buyPrice},</if> <if test="buyPrice != null and buyPrice != ''">buy_price = #{buyPrice},</if>
<if test="payPrice != null">pay_price = #{payPrice},</if> <if test="payPrice != null and payPrice != ''">pay_price = #{payPrice},</if>
<if test="level != null">level = #{level},</if>
<if test="ratedLoad != null">rated_load = #{ratedLoad},</if>
<if test="testLoad != null">test_load = #{testLoad},</if>
<if test="holdingTime != null">holding_time = #{holdingTime},</if>
<if test="warnNum != null">warn_num = #{warnNum},</if>
<if test="delFlag != null">del_flag = #{delFlag},</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="isPlan != null">is_plan = #{isPlan},</if>
<if test="isAncuo != null">is_ancuo = #{isAncuo},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="companyId != null">company_id = #{companyId},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
</trim> <if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
update_time = sysdate()
</set>
where type_id = #{typeId} where type_id = #{typeId}
</update> </update>
@ -147,25 +91,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update ma_type set del_flag = '2' where type_id = #{typeId} update ma_type set del_flag = '2' where type_id = #{typeId}
</delete> </delete>
<select id="selectMaTypeList" parameterType="String" resultMap="MaTypeResult"> <select id="selectMaTypeList" resultType="com.bonus.sgzb.base.domain.MaType">
select m.type_id, m.type_name, m.parent_id, m.status, m.num, m.unit_id, m.manage_type, select m.type_id, m.type_name, m.parent_id, m.status, m.num, m.unit_id, m.manage_type, m.lease_price, m.buy_price, m.pay_price, m.level, m.rated_load, m.test_load, m.holding_time, m.warn_num, mtf.file_name, mtf.file_url, su.user_name, mpi.prop_name, m.del_flag, m.create_by, m.create_time, m.remark, m.company_id
m.lease_price, m.buy_price, m.pay_price, m.level, m.rated_load, m.test_load,
m.holding_time, m.warn_num, mtf.file_name photoName, mtf.file_url photoUrl,
mtf2.file_name documentName, mtf2.file_url documentUrl, mtk.user_id keeperUserId,
su.user_name keeperUserName, mpi.prop_name, m.del_flag, m.create_by, m.create_time,
m.remark, m.company_id
from ma_type m from ma_type m
left join ma_prop_set mps on m.type_id = mps.type_id left join ma_prop_set mps on m.type_id = mps.type_id
left join ma_prop_info mpi on mps.prop_id = mpi.prop_id left join ma_prop_info mpi on mps.prop_id = mpi.prop_id
left join (select * from ma_type_file where file_type = '1') mtf on m.type_id = mtf.type_id left join ma_type_file mtf on m.type_id = mtf.type_id
left join (select * from ma_type_file where file_type = '2') mtf2 on m.type_id = mtf2.type_id
left join ma_type_keeper mtk on mtf.type_id = mtk.type_id left join ma_type_keeper mtk on mtf.type_id = mtk.type_id
left join sys_user su on mtk.user_id = su.user_id left join sys_user su on mtk.user_id = su.user_id
<where>
<if test="typeName != null and typeName !=''">
AND type_name like concat('%',#{typeName},'%')
</if>
</where>
</select> </select>
<select id="selectTypeList" resultType="com.bonus.sgzb.base.domain.MaType"> <select id="selectTypeList" resultType="com.bonus.sgzb.base.domain.MaType">
@ -186,98 +119,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectMaTypeVo"/> <include refid="selectMaTypeVo"/>
where type_name = #{typeName} limit 1 where type_name = #{typeName} limit 1
</select> </select>
<insert id="insertKeeper">
insert into ma_type_keeper
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="typeId != null">type_id,</if>
<if test="userId != null">user_id,</if>
<if test="time != null">time,</if>
<if test="companyId != null">company_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="typeId != null">#{typeId},</if>
<if test="userId != null">#{userId},</if>
<if test="time != null">#{time},</if>
<if test="companyId != null">#{companyId},</if>
</trim>
</insert>
<insert id="insertRepair">
insert into ma_type_repair
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="typeId != null">type_id,</if>
<if test="userId != null">user_id,</if>
<if test="time != null">time,</if>
<if test="companyId != null">company_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="typeId != null">#{typeId},</if>
<if test="userId != null">#{userId},</if>
<if test="time != null">#{time},</if>
<if test="companyId != null">#{companyId},</if>
</trim>
</insert>
<insert id="insertMaPropSet">
insert into ma_prop_set
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="propId != null">prop_id,</if>
<if test="typeId != null">type_id,</if>
<if test="status != null">status,</if>
<if test="delFlag != null">del_flag,</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>
<if test="companyId != null">company_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="propId != null">#{propId},</if>
<if test="typeId != null">#{typeId},</if>
<if test="status != null">#{status},</if>
<if test="delFlag != null">#{delFlag},</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>
<if test="companyId != null">#{companyId},</if>
</trim>
</insert>
<select id="selectMaTypeByTypeId" resultMap="MaTypeResult">
select m.type_id, m.type_name, m.parent_id, m.status, m.num, m.unit_id, m.manage_type,
m.lease_price, m.buy_price, m.pay_price, m.level, m.rated_load, m.test_load,
m.holding_time, m.warn_num, mtf.file_name photoName, mtf.file_url photoUrl,
mtf2.file_name documentName, mtf2.file_url documentUrl, mtk.user_id keeperUserId,
su.user_name keeperUserName, mpi.prop_name, m.del_flag, m.create_by, m.create_time,
m.remark, m.company_id
from ma_type m
left join ma_prop_set mps on m.type_id = mps.type_id
left join ma_prop_info mpi on mps.prop_id = mpi.prop_id
left join (select * from ma_type_file where file_type = '1') mtf on m.type_id = mtf.type_id
left join (select * from ma_type_file where file_type = '2') mtf2 on m.type_id = mtf2.type_id
left join ma_type_keeper mtk on mtf.type_id = mtk.type_id
left join sys_user su on mtk.user_id = su.user_id
where m.type_id = #{typeId}
</select>
<update id="updateKeeperByTypeId">
update ma_type_keeper set user_id = #{userId} where type_id = #{typeId}
</update>
<update id="updateRepairByTypeId">
update ma_type_repair set user_id = #{userId} where type_id = #{typeId}
</update>
<update id="updatePropSetByTypeId">
update ma_prop_set set prop_id = #{propId} where type_id = #{typeId}
</update>
<select id="selectTypeByTypeId" parameterType="long" resultMap="MaTypeResult">
<include refid="selectMaTypeVo"/>
where type_id = #{typeId}
</select>
</mapper> </mapper>

View File

@ -1,92 +0,0 @@
<?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.bonus.sgzb.base.mapper.MaTypeFileMapper">
<resultMap type="com.bonus.sgzb.base.domain.MaTypeFile" id="MaTypeFileResult">
<result property="typeId" column="type_id" />
<result property="maId" column="ma_id" />
<result property="fileName" column="file_name" />
<result property="fileUrl" column="file_url" />
<result property="fileType" column="file_type" />
<result property="userId" column="user_id" />
<result property="time" column="time" />
<result property="status" column="status" />
<result property="companyId" column="company_id" />
</resultMap>
<sql id="selectMaTypeFileVo">
select type_id, ma_id, file_name, file_url, file_type, user_id, time, status, company_id from ma_type_file
</sql>
<select id="selectMaTypeFileList" parameterType="com.bonus.sgzb.base.domain.MaTypeFile" resultMap="MaTypeFileResult">
<include refid="selectMaTypeFileVo"/>
<where>
<if test="maId != null and maId != ''"> and ma_id = #{maId}</if>
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
<if test="fileUrl != null and fileUrl != ''"> and file_url = #{fileUrl}</if>
<if test="fileType != null and fileType != ''"> and file_type = #{fileType}</if>
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
<if test="time != null and time != ''"> and time = #{time}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="companyId != null and companyId != ''"> and company_id = #{companyId}</if>
</where>
</select>
<select id="selectMaTypeFileByTypeId" parameterType="Long" resultMap="MaTypeFileResult">
<include refid="selectMaTypeFileVo"/>
where type_id = #{typeId}
</select>
<insert id="insertMaTypeFile" parameterType="com.bonus.sgzb.base.domain.MaTypeFile">
insert into ma_type_file
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="typeId != null">type_id,</if>
<if test="maId != null">ma_id,</if>
<if test="fileName != null and fileName != ''">file_name,</if>
<if test="fileUrl != null">file_url,</if>
<if test="fileType != null">file_type,</if>
<if test="userId != null">user_id,</if>
<if test="time != null">time,</if>
<if test="status != null">status,</if>
<if test="companyId != null">company_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="typeId != null">#{typeId},</if>
<if test="maId != null">#{maId},</if>
<if test="fileName != null and fileName != ''">#{fileName},</if>
<if test="fileUrl != null">#{fileUrl},</if>
<if test="fileType != null">#{fileType},</if>
<if test="userId != null">#{userId},</if>
<if test="time != null">#{time},</if>
<if test="status != null">#{status},</if>
<if test="companyId != null">#{companyId},</if>
</trim>
</insert>
<update id="updateMaTypeFile" parameterType="com.bonus.sgzb.base.domain.MaTypeFile">
update ma_type_file
<trim prefix="SET" suffixOverrides=",">
<if test="maId != null">ma_id = #{maId},</if>
<if test="fileName != null and fileName != ''">file_name = #{fileName},</if>
<if test="fileUrl != null">file_url = #{fileUrl},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="time != null">time = #{time},</if>
<if test="status != null">status = #{status},</if>
<if test="companyId != null">company_id = #{companyId},</if>
</trim>
where type_id = #{typeId} and file_type = #{fileType}
</update>
<delete id="deleteMaTypeFileByTypeId" parameterType="Long">
delete from ma_type_file where type_id = #{typeId}
</delete>
<delete id="deleteMaTypeFileByTypeIds" parameterType="String">
delete from ma_type_file where type_id in
<foreach item="typeId" collection="array" open="(" separator="," close=")">
#{typeId}
</foreach>
</delete>
</mapper>