ljlong_2630
1 year ago
11 changed files with 960 additions and 124 deletions
@ -0,0 +1,99 @@ |
|||||
|
package com.lzbi.asset.controller; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
|
||||
|
import com.lzbi.asset.domain.DcBaseAssetInfo; |
||||
|
import com.lzbi.asset.service.IDcBaseAssetInfoService; |
||||
|
import com.lzbi.common.utils.poi.ExcelUtil; |
||||
|
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.lzbi.common.annotation.Log; |
||||
|
import com.lzbi.common.core.controller.BaseController; |
||||
|
import com.lzbi.common.core.domain.AjaxResult; |
||||
|
import com.lzbi.common.enums.BusinessType; |
||||
|
import com.lzbi.common.core.page.TableDataInfo; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 资产信息Controller |
||||
|
* |
||||
|
* @author Lu.JL |
||||
|
* @date 2023-11-27 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("/lzbi/asset_info") |
||||
|
public class DcBaseAssetInfoController extends BaseController { |
||||
|
@Autowired |
||||
|
private IDcBaseAssetInfoService dcBaseAssetInfoService; |
||||
|
|
||||
|
/** |
||||
|
* 查询资产信息列表 |
||||
|
*/ |
||||
|
@PreAuthorize("@ss.hasPermi('lzbi:asset_info:list')") |
||||
|
@GetMapping("/list") |
||||
|
public TableDataInfo list(DcBaseAssetInfo dcBaseAssetInfo) { |
||||
|
startPage(); |
||||
|
List<DcBaseAssetInfo> list = dcBaseAssetInfoService.selectDcBaseAssetInfoList(dcBaseAssetInfo); |
||||
|
return getDataTable(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 导出资产信息列表 |
||||
|
*/ |
||||
|
@PreAuthorize("@ss.hasPermi('lzbi:asset_info:export')") |
||||
|
@Log(title = "资产信息", businessType = BusinessType.EXPORT) |
||||
|
@PostMapping("/export") |
||||
|
public void export(HttpServletResponse response, DcBaseAssetInfo dcBaseAssetInfo) { |
||||
|
List<DcBaseAssetInfo> list = dcBaseAssetInfoService.selectDcBaseAssetInfoList(dcBaseAssetInfo); |
||||
|
ExcelUtil<DcBaseAssetInfo> util = new ExcelUtil<DcBaseAssetInfo>(DcBaseAssetInfo.class); |
||||
|
util.exportExcel(response, list, "资产信息数据"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取资产信息详细信息 |
||||
|
*/ |
||||
|
@PreAuthorize("@ss.hasPermi('lzbi:asset_info:query')") |
||||
|
@GetMapping(value = "/{id}") |
||||
|
public AjaxResult getInfo(@PathVariable("id") Long id) { |
||||
|
return success(dcBaseAssetInfoService.selectDcBaseAssetInfoById(id)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增资产信息 |
||||
|
*/ |
||||
|
@PreAuthorize("@ss.hasPermi('lzbi:asset_info:add')") |
||||
|
@Log(title = "资产信息", businessType = BusinessType.INSERT) |
||||
|
@PostMapping |
||||
|
public AjaxResult add(@RequestBody DcBaseAssetInfo dcBaseAssetInfo) { |
||||
|
return toAjax(dcBaseAssetInfoService.insertDcBaseAssetInfo(dcBaseAssetInfo)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改资产信息 |
||||
|
*/ |
||||
|
@PreAuthorize("@ss.hasPermi('lzbi:asset_info:edit')") |
||||
|
@Log(title = "资产信息", businessType = BusinessType.UPDATE) |
||||
|
@PutMapping |
||||
|
public AjaxResult edit(@RequestBody DcBaseAssetInfo dcBaseAssetInfo) { |
||||
|
return toAjax(dcBaseAssetInfoService.updateDcBaseAssetInfo(dcBaseAssetInfo)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除资产信息 |
||||
|
*/ |
||||
|
@PreAuthorize("@ss.hasPermi('lzbi:asset_info:remove')") |
||||
|
@Log(title = "资产信息", businessType = BusinessType.DELETE) |
||||
|
@DeleteMapping("/{ids}") |
||||
|
public AjaxResult remove(@PathVariable Long[] ids) { |
||||
|
return toAjax(dcBaseAssetInfoService.deleteDcBaseAssetInfoByIds(ids)); |
||||
|
} |
||||
|
} |
@ -0,0 +1,285 @@ |
|||||
|
package com.lzbi.asset.domain; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
|
import org.apache.commons.lang3.builder.ToStringStyle; |
||||
|
import com.lzbi.common.annotation.Excel; |
||||
|
import com.lzbi.common.core.domain.BaseEntity; |
||||
|
|
||||
|
/** |
||||
|
* 资产信息对象 dc_base_asset_info |
||||
|
* |
||||
|
* @author Lu.JL |
||||
|
* @date 2023-11-27 |
||||
|
*/ |
||||
|
public class DcBaseAssetInfo extends BaseEntity { |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 租户号 |
||||
|
*/ |
||||
|
private String tenantId; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Long REVISION; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
/** |
||||
|
* 删除人 |
||||
|
*/ |
||||
|
private String deleteBy; |
||||
|
|
||||
|
/** |
||||
|
* 删除时间 |
||||
|
*/ |
||||
|
private Date deleteTime; |
||||
|
|
||||
|
/** |
||||
|
* 资产ID |
||||
|
*/ |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 资产名称 |
||||
|
*/ |
||||
|
@Excel(name = "资产名称") |
||||
|
private String assetName; |
||||
|
|
||||
|
/** |
||||
|
* 资产编码 |
||||
|
*/ |
||||
|
@Excel(name = "资产编码") |
||||
|
private String assetCode; |
||||
|
|
||||
|
/** |
||||
|
* 资产类别;设备型资产;管理型资产; |
||||
|
*/ |
||||
|
@Excel(name = "资产类别;设备型资产;管理型资产;") |
||||
|
private String assetClass; |
||||
|
|
||||
|
/** |
||||
|
* 部门共享;0不共享;1限定部门共享;2所有部门可见 |
||||
|
*/ |
||||
|
@Excel(name = "部门共享;0不共享;1限定部门共享;2所有部门可见") |
||||
|
private String flagValidateDept; |
||||
|
|
||||
|
/** |
||||
|
* 角色内共享;0不共享;1限定角色共享;2所有角色可见 |
||||
|
*/ |
||||
|
@Excel(name = "角色内共享;0不共享;1限定角色共享;2所有角色可见") |
||||
|
private String flagValidateRole; |
||||
|
|
||||
|
/** |
||||
|
* 用户共享;0不共享;1限定用户共享;2所有用户可见 |
||||
|
*/ |
||||
|
@Excel(name = "用户共享;0不共享;1限定用户共享;2所有用户可见") |
||||
|
private String flagValidateUser; |
||||
|
|
||||
|
/** |
||||
|
* 资产状态 |
||||
|
*/ |
||||
|
@Excel(name = "资产状态") |
||||
|
private String statusAsset; |
||||
|
|
||||
|
/** |
||||
|
* 所属公司 |
||||
|
*/ |
||||
|
@Excel(name = "所属公司") |
||||
|
private Long comanyId; |
||||
|
|
||||
|
/** |
||||
|
* 所属组织结构 |
||||
|
*/ |
||||
|
@Excel(name = "所属组织结构") |
||||
|
private Long deptId; |
||||
|
|
||||
|
public void setTenantId(String tenantId) { |
||||
|
this.tenantId = tenantId; |
||||
|
} |
||||
|
|
||||
|
public String getTenantId() { |
||||
|
return tenantId; |
||||
|
} |
||||
|
|
||||
|
public void setREVISION(Long REVISION) { |
||||
|
this.REVISION = REVISION; |
||||
|
} |
||||
|
|
||||
|
public Long getREVISION() { |
||||
|
return REVISION; |
||||
|
} |
||||
|
|
||||
|
public void setCreatedBy(String createdBy) { |
||||
|
this.createdBy = createdBy; |
||||
|
} |
||||
|
|
||||
|
public String getCreatedBy() { |
||||
|
return createdBy; |
||||
|
} |
||||
|
|
||||
|
public void setCreatedTime(Date createdTime) { |
||||
|
this.createdTime = createdTime; |
||||
|
} |
||||
|
|
||||
|
public Date getCreatedTime() { |
||||
|
return createdTime; |
||||
|
} |
||||
|
|
||||
|
public void setUpdatedBy(String updatedBy) { |
||||
|
this.updatedBy = updatedBy; |
||||
|
} |
||||
|
|
||||
|
public String getUpdatedBy() { |
||||
|
return updatedBy; |
||||
|
} |
||||
|
|
||||
|
public void setUpdatedTime(Date updatedTime) { |
||||
|
this.updatedTime = updatedTime; |
||||
|
} |
||||
|
|
||||
|
public Date getUpdatedTime() { |
||||
|
return updatedTime; |
||||
|
} |
||||
|
|
||||
|
public void setDeleteBy(String deleteBy) { |
||||
|
this.deleteBy = deleteBy; |
||||
|
} |
||||
|
|
||||
|
public String getDeleteBy() { |
||||
|
return deleteBy; |
||||
|
} |
||||
|
|
||||
|
public void setDeleteTime(Date deleteTime) { |
||||
|
this.deleteTime = deleteTime; |
||||
|
} |
||||
|
|
||||
|
public Date getDeleteTime() { |
||||
|
return deleteTime; |
||||
|
} |
||||
|
|
||||
|
public void setId(Long id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public Long getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setAssetName(String assetName) { |
||||
|
this.assetName = assetName; |
||||
|
} |
||||
|
|
||||
|
public String getAssetName() { |
||||
|
return assetName; |
||||
|
} |
||||
|
|
||||
|
public void setAssetCode(String assetCode) { |
||||
|
this.assetCode = assetCode; |
||||
|
} |
||||
|
|
||||
|
public String getAssetCode() { |
||||
|
return assetCode; |
||||
|
} |
||||
|
|
||||
|
public void setAssetClass(String assetClass) { |
||||
|
this.assetClass = assetClass; |
||||
|
} |
||||
|
|
||||
|
public String getAssetClass() { |
||||
|
return assetClass; |
||||
|
} |
||||
|
|
||||
|
public void setFlagValidateDept(String flagValidateDept) { |
||||
|
this.flagValidateDept = flagValidateDept; |
||||
|
} |
||||
|
|
||||
|
public String getFlagValidateDept() { |
||||
|
return flagValidateDept; |
||||
|
} |
||||
|
|
||||
|
public void setFlagValidateRole(String flagValidateRole) { |
||||
|
this.flagValidateRole = flagValidateRole; |
||||
|
} |
||||
|
|
||||
|
public String getFlagValidateRole() { |
||||
|
return flagValidateRole; |
||||
|
} |
||||
|
|
||||
|
public void setFlagValidateUser(String flagValidateUser) { |
||||
|
this.flagValidateUser = flagValidateUser; |
||||
|
} |
||||
|
|
||||
|
public String getFlagValidateUser() { |
||||
|
return flagValidateUser; |
||||
|
} |
||||
|
|
||||
|
public void setStatusAsset(String statusAsset) { |
||||
|
this.statusAsset = statusAsset; |
||||
|
} |
||||
|
|
||||
|
public String getStatusAsset() { |
||||
|
return statusAsset; |
||||
|
} |
||||
|
|
||||
|
public void setComanyId(Long comanyId) { |
||||
|
this.comanyId = comanyId; |
||||
|
} |
||||
|
|
||||
|
public Long getComanyId() { |
||||
|
return comanyId; |
||||
|
} |
||||
|
|
||||
|
public void setDeptId(Long deptId) { |
||||
|
this.deptId = deptId; |
||||
|
} |
||||
|
|
||||
|
public Long getDeptId() { |
||||
|
return deptId; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) |
||||
|
.append("tenantId", getTenantId()) |
||||
|
.append("REVISION", getREVISION()) |
||||
|
.append("createdBy", getCreatedBy()) |
||||
|
.append("createdTime", getCreatedTime()) |
||||
|
.append("updatedBy", getUpdatedBy()) |
||||
|
.append("updatedTime", getUpdatedTime()) |
||||
|
.append("deleteBy", getDeleteBy()) |
||||
|
.append("deleteTime", getDeleteTime()) |
||||
|
.append("id", getId()) |
||||
|
.append("assetName", getAssetName()) |
||||
|
.append("assetCode", getAssetCode()) |
||||
|
.append("assetClass", getAssetClass()) |
||||
|
.append("flagValidateDept", getFlagValidateDept()) |
||||
|
.append("flagValidateRole", getFlagValidateRole()) |
||||
|
.append("flagValidateUser", getFlagValidateUser()) |
||||
|
.append("statusAsset", getStatusAsset()) |
||||
|
.append("comanyId", getComanyId()) |
||||
|
.append("deptId", getDeptId()) |
||||
|
.toString(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,62 @@ |
|||||
|
package com.lzbi.asset.mapper; |
||||
|
|
||||
|
|
||||
|
import com.lzbi.asset.domain.DcBaseAssetInfo; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 资产信息Mapper接口 |
||||
|
* |
||||
|
* @author Lu.JL |
||||
|
* @date 2023-11-27 |
||||
|
*/ |
||||
|
public interface DcBaseAssetInfoMapper { |
||||
|
/** |
||||
|
* 查询资产信息 |
||||
|
* |
||||
|
* @param id 资产信息主键 |
||||
|
* @return 资产信息 |
||||
|
*/ |
||||
|
public DcBaseAssetInfo selectDcBaseAssetInfoById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 查询资产信息列表 |
||||
|
* |
||||
|
* @param dcBaseAssetInfo 资产信息 |
||||
|
* @return 资产信息集合 |
||||
|
*/ |
||||
|
public List<DcBaseAssetInfo> selectDcBaseAssetInfoList(DcBaseAssetInfo dcBaseAssetInfo); |
||||
|
|
||||
|
/** |
||||
|
* 新增资产信息 |
||||
|
* |
||||
|
* @param dcBaseAssetInfo 资产信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int insertDcBaseAssetInfo(DcBaseAssetInfo dcBaseAssetInfo); |
||||
|
|
||||
|
/** |
||||
|
* 修改资产信息 |
||||
|
* |
||||
|
* @param dcBaseAssetInfo 资产信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int updateDcBaseAssetInfo(DcBaseAssetInfo dcBaseAssetInfo); |
||||
|
|
||||
|
/** |
||||
|
* 删除资产信息 |
||||
|
* |
||||
|
* @param id 资产信息主键 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteDcBaseAssetInfoById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除资产信息 |
||||
|
* |
||||
|
* @param ids 需要删除的数据主键集合 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteDcBaseAssetInfoByIds(Long[] ids); |
||||
|
} |
@ -0,0 +1,62 @@ |
|||||
|
package com.lzbi.asset.service; |
||||
|
|
||||
|
|
||||
|
import com.lzbi.asset.domain.DcBaseAssetInfo; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 资产信息Service接口 |
||||
|
* |
||||
|
* @author Lu.JL |
||||
|
* @date 2023-11-27 |
||||
|
*/ |
||||
|
public interface IDcBaseAssetInfoService { |
||||
|
/** |
||||
|
* 查询资产信息 |
||||
|
* |
||||
|
* @param id 资产信息主键 |
||||
|
* @return 资产信息 |
||||
|
*/ |
||||
|
public DcBaseAssetInfo selectDcBaseAssetInfoById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 查询资产信息列表 |
||||
|
* |
||||
|
* @param dcBaseAssetInfo 资产信息 |
||||
|
* @return 资产信息集合 |
||||
|
*/ |
||||
|
public List<DcBaseAssetInfo> selectDcBaseAssetInfoList(DcBaseAssetInfo dcBaseAssetInfo); |
||||
|
|
||||
|
/** |
||||
|
* 新增资产信息 |
||||
|
* |
||||
|
* @param dcBaseAssetInfo 资产信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int insertDcBaseAssetInfo(DcBaseAssetInfo dcBaseAssetInfo); |
||||
|
|
||||
|
/** |
||||
|
* 修改资产信息 |
||||
|
* |
||||
|
* @param dcBaseAssetInfo 资产信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int updateDcBaseAssetInfo(DcBaseAssetInfo dcBaseAssetInfo); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除资产信息 |
||||
|
* |
||||
|
* @param ids 需要删除的资产信息主键集合 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteDcBaseAssetInfoByIds(Long[] ids); |
||||
|
|
||||
|
/** |
||||
|
* 删除资产信息信息 |
||||
|
* |
||||
|
* @param id 资产信息主键 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteDcBaseAssetInfoById(Long id); |
||||
|
} |
@ -0,0 +1,87 @@ |
|||||
|
package com.lzbi.asset.service.impl; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
import com.lzbi.asset.domain.DcBaseAssetInfo; |
||||
|
import com.lzbi.asset.mapper.DcBaseAssetInfoMapper; |
||||
|
import com.lzbi.asset.service.IDcBaseAssetInfoService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* 资产信息Service业务层处理 |
||||
|
* |
||||
|
* @author Lu.JL |
||||
|
* @date 2023-11-27 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class DcBaseAssetInfoServiceImpl implements IDcBaseAssetInfoService { |
||||
|
@Autowired |
||||
|
private DcBaseAssetInfoMapper dcBaseAssetInfoMapper; |
||||
|
|
||||
|
/** |
||||
|
* 查询资产信息 |
||||
|
* |
||||
|
* @param id 资产信息主键 |
||||
|
* @return 资产信息 |
||||
|
*/ |
||||
|
@Override |
||||
|
public DcBaseAssetInfo selectDcBaseAssetInfoById(Long id) { |
||||
|
return dcBaseAssetInfoMapper.selectDcBaseAssetInfoById(id); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询资产信息列表 |
||||
|
* |
||||
|
* @param dcBaseAssetInfo 资产信息 |
||||
|
* @return 资产信息 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<DcBaseAssetInfo> selectDcBaseAssetInfoList(DcBaseAssetInfo dcBaseAssetInfo) { |
||||
|
return dcBaseAssetInfoMapper.selectDcBaseAssetInfoList(dcBaseAssetInfo); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增资产信息 |
||||
|
* |
||||
|
* @param dcBaseAssetInfo 资产信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int insertDcBaseAssetInfo(DcBaseAssetInfo dcBaseAssetInfo) { |
||||
|
return dcBaseAssetInfoMapper.insertDcBaseAssetInfo(dcBaseAssetInfo); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改资产信息 |
||||
|
* |
||||
|
* @param dcBaseAssetInfo 资产信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int updateDcBaseAssetInfo(DcBaseAssetInfo dcBaseAssetInfo) { |
||||
|
return dcBaseAssetInfoMapper.updateDcBaseAssetInfo(dcBaseAssetInfo); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 批量删除资产信息 |
||||
|
* |
||||
|
* @param ids 需要删除的资产信息主键 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int deleteDcBaseAssetInfoByIds(Long[] ids) { |
||||
|
return dcBaseAssetInfoMapper.deleteDcBaseAssetInfoByIds(ids); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除资产信息信息 |
||||
|
* |
||||
|
* @param id 资产信息主键 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int deleteDcBaseAssetInfoById(Long id) { |
||||
|
return dcBaseAssetInfoMapper.deleteDcBaseAssetInfoById(id); |
||||
|
} |
||||
|
} |
@ -0,0 +1,154 @@ |
|||||
|
<?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.lzbi.asset.mapper.DcBaseAssetInfoMapper"> |
||||
|
|
||||
|
<resultMap type="DcBaseAssetInfo" id="DcBaseAssetInfoResult"> |
||||
|
<result property="tenantId" column="TENANT_ID"/> |
||||
|
<result property="REVISION" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
<result property="deleteBy" column="DELETE_BY"/> |
||||
|
<result property="deleteTime" column="DELETE_TIME"/> |
||||
|
<result property="id" column="id"/> |
||||
|
<result property="assetName" column="asset_name"/> |
||||
|
<result property="assetCode" column="asset_code"/> |
||||
|
<result property="assetClass" column="asset_class"/> |
||||
|
<result property="flagValidateDept" column="flag_validate_dept"/> |
||||
|
<result property="flagValidateRole" column="flag_validate_role"/> |
||||
|
<result property="flagValidateUser" column="flag_validate_user"/> |
||||
|
<result property="statusAsset" column="status_asset"/> |
||||
|
<result property="comanyId" column="comany_id"/> |
||||
|
<result property="deptId" column="dept_id"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<sql id="selectDcBaseAssetInfoVo"> |
||||
|
select TENANT_ID, |
||||
|
REVISION, |
||||
|
CREATED_BY, |
||||
|
CREATED_TIME, |
||||
|
UPDATED_BY, |
||||
|
UPDATED_TIME, |
||||
|
DELETE_BY, |
||||
|
DELETE_TIME, |
||||
|
id, |
||||
|
asset_name, |
||||
|
asset_code, |
||||
|
asset_class, |
||||
|
flag_validate_dept, |
||||
|
flag_validate_role, |
||||
|
flag_validate_user, |
||||
|
status_asset, |
||||
|
comany_id, |
||||
|
dept_id |
||||
|
from dc_base_asset_info |
||||
|
</sql> |
||||
|
|
||||
|
<select id="selectDcBaseAssetInfoList" parameterType="DcBaseAssetInfo" resultMap="DcBaseAssetInfoResult"> |
||||
|
<include refid="selectDcBaseAssetInfoVo"/> |
||||
|
<where> |
||||
|
<if test="assetName != null and assetName != ''">and asset_name like concat('%', #{assetName}, '%')</if> |
||||
|
<if test="assetCode != null and assetCode != ''">and asset_code = #{assetCode}</if> |
||||
|
<if test="assetClass != null and assetClass != ''">and asset_class = #{assetClass}</if> |
||||
|
<if test="flagValidateDept != null and flagValidateDept != ''">and flag_validate_dept = |
||||
|
#{flagValidateDept} |
||||
|
</if> |
||||
|
<if test="flagValidateRole != null and flagValidateRole != ''">and flag_validate_role = |
||||
|
#{flagValidateRole} |
||||
|
</if> |
||||
|
<if test="flagValidateUser != null and flagValidateUser != ''">and flag_validate_user = |
||||
|
#{flagValidateUser} |
||||
|
</if> |
||||
|
<if test="statusAsset != null and statusAsset != ''">and status_asset = #{statusAsset}</if> |
||||
|
<if test="comanyId != null ">and comany_id = #{comanyId}</if> |
||||
|
<if test="deptId != null ">and dept_id = #{deptId}</if> |
||||
|
</where> |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectDcBaseAssetInfoById" parameterType="Long" resultMap="DcBaseAssetInfoResult"> |
||||
|
<include refid="selectDcBaseAssetInfoVo"/> |
||||
|
where id = #{id} |
||||
|
</select> |
||||
|
|
||||
|
<insert id="insertDcBaseAssetInfo" parameterType="DcBaseAssetInfo" useGeneratedKeys="true" keyProperty="id"> |
||||
|
insert into dc_base_asset_info |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="tenantId != null">TENANT_ID,</if> |
||||
|
<if test="REVISION != null">REVISION,</if> |
||||
|
<if test="createdBy != null">CREATED_BY,</if> |
||||
|
<if test="createdTime != null">CREATED_TIME,</if> |
||||
|
<if test="updatedBy != null">UPDATED_BY,</if> |
||||
|
<if test="updatedTime != null">UPDATED_TIME,</if> |
||||
|
<if test="deleteBy != null">DELETE_BY,</if> |
||||
|
<if test="deleteTime != null">DELETE_TIME,</if> |
||||
|
<if test="assetName != null and assetName != ''">asset_name,</if> |
||||
|
<if test="assetCode != null and assetCode != ''">asset_code,</if> |
||||
|
<if test="assetClass != null and assetClass != ''">asset_class,</if> |
||||
|
<if test="flagValidateDept != null">flag_validate_dept,</if> |
||||
|
<if test="flagValidateRole != null">flag_validate_role,</if> |
||||
|
<if test="flagValidateUser != null">flag_validate_user,</if> |
||||
|
<if test="statusAsset != null">status_asset,</if> |
||||
|
<if test="comanyId != null">comany_id,</if> |
||||
|
<if test="deptId != null">dept_id,</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="tenantId != null">#{tenantId},</if> |
||||
|
<if test="REVISION != null">#{REVISION},</if> |
||||
|
<if test="createdBy != null">#{createdBy},</if> |
||||
|
<if test="createdTime != null">#{createdTime},</if> |
||||
|
<if test="updatedBy != null">#{updatedBy},</if> |
||||
|
<if test="updatedTime != null">#{updatedTime},</if> |
||||
|
<if test="deleteBy != null">#{deleteBy},</if> |
||||
|
<if test="deleteTime != null">#{deleteTime},</if> |
||||
|
<if test="assetName != null and assetName != ''">#{assetName},</if> |
||||
|
<if test="assetCode != null and assetCode != ''">#{assetCode},</if> |
||||
|
<if test="assetClass != null and assetClass != ''">#{assetClass},</if> |
||||
|
<if test="flagValidateDept != null">#{flagValidateDept},</if> |
||||
|
<if test="flagValidateRole != null">#{flagValidateRole},</if> |
||||
|
<if test="flagValidateUser != null">#{flagValidateUser},</if> |
||||
|
<if test="statusAsset != null">#{statusAsset},</if> |
||||
|
<if test="comanyId != null">#{comanyId},</if> |
||||
|
<if test="deptId != null">#{deptId},</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
|
||||
|
<update id="updateDcBaseAssetInfo" parameterType="DcBaseAssetInfo"> |
||||
|
update dc_base_asset_info |
||||
|
<trim prefix="SET" suffixOverrides=","> |
||||
|
<if test="tenantId != null">TENANT_ID = #{tenantId},</if> |
||||
|
<if test="REVISION != null">REVISION = #{REVISION},</if> |
||||
|
<if test="createdBy != null">CREATED_BY = #{createdBy},</if> |
||||
|
<if test="createdTime != null">CREATED_TIME = #{createdTime},</if> |
||||
|
<if test="updatedBy != null">UPDATED_BY = #{updatedBy},</if> |
||||
|
<if test="updatedTime != null">UPDATED_TIME = #{updatedTime},</if> |
||||
|
<if test="deleteBy != null">DELETE_BY = #{deleteBy},</if> |
||||
|
<if test="deleteTime != null">DELETE_TIME = #{deleteTime},</if> |
||||
|
<if test="assetName != null and assetName != ''">asset_name = #{assetName},</if> |
||||
|
<if test="assetCode != null and assetCode != ''">asset_code = #{assetCode},</if> |
||||
|
<if test="assetClass != null and assetClass != ''">asset_class = #{assetClass},</if> |
||||
|
<if test="flagValidateDept != null">flag_validate_dept = #{flagValidateDept},</if> |
||||
|
<if test="flagValidateRole != null">flag_validate_role = #{flagValidateRole},</if> |
||||
|
<if test="flagValidateUser != null">flag_validate_user = #{flagValidateUser},</if> |
||||
|
<if test="statusAsset != null">status_asset = #{statusAsset},</if> |
||||
|
<if test="comanyId != null">comany_id = #{comanyId},</if> |
||||
|
<if test="deptId != null">dept_id = #{deptId},</if> |
||||
|
</trim> |
||||
|
where id = #{id} |
||||
|
</update> |
||||
|
|
||||
|
<delete id="deleteDcBaseAssetInfoById" parameterType="Long"> |
||||
|
delete |
||||
|
from dc_base_asset_info |
||||
|
where id = #{id} |
||||
|
</delete> |
||||
|
|
||||
|
<delete id="deleteDcBaseAssetInfoByIds" parameterType="String"> |
||||
|
delete from dc_base_asset_info where id in |
||||
|
<foreach item="id" collection="array" open="(" separator="," close=")"> |
||||
|
#{id} |
||||
|
</foreach> |
||||
|
</delete> |
||||
|
</mapper> |
Loading…
Reference in new issue