zhousq
11 months ago
32 changed files with 1108 additions and 388 deletions
@ -0,0 +1,131 @@ |
|||
package com.lzbi.draft.controller; |
|||
import io.swagger.annotations.ApiImplicitParam; |
|||
import io.swagger.annotations.ApiImplicitParams; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import java.util.List; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
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.draft.domain. DcBusiBillModelMaster; |
|||
import com.lzbi.draft.service.DcBusiBillModelMasterService; |
|||
import com.lzbi.common.utils.poi.ExcelUtil; |
|||
import com.lzbi.common.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 录入配置Controller |
|||
* |
|||
* @author zhousq |
|||
* @date 2023-12-11 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/draft/billModel") |
|||
public class DcBusiBillModelMasterController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private DcBusiBillModelMasterService dcBusiBillModelMasterService; |
|||
|
|||
/** |
|||
* 查询录入配置列表 |
|||
*/ |
|||
@ApiOperation("查询录入配置列表") |
|||
@ApiImplicitParams({ |
|||
@ApiImplicitParam(name = "DcBusiBillModelMaster", value = "", dataType = "DcBusiBillModelMaster", dataTypeClass = DcBusiBillModelMaster.class), |
|||
}) |
|||
//@PreAuthorize("@ss.hasPermi('draft:billModel:list')")
|
|||
@GetMapping("/list") |
|||
public TableDataInfo list(DcBusiBillModelMaster DcBusiBillModelMaster) |
|||
{ |
|||
startPage(); |
|||
List< DcBusiBillModelMaster> list = dcBusiBillModelMasterService.selectDcBusiBillModelMasterList(DcBusiBillModelMaster); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出录入配置列表 |
|||
*/ |
|||
@ApiOperation("导出录入配置列表") |
|||
@ApiImplicitParams({ |
|||
@ApiImplicitParam(name = "DcBusiBillModelMaster", value = "", dataType = "DcBusiBillModelMaster", dataTypeClass = DcBusiBillModelMaster.class), |
|||
}) |
|||
//@PreAuthorize("@ss.hasPermi('draft:billModel:export')")
|
|||
@Log(title = "录入配置", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(HttpServletResponse response,DcBusiBillModelMaster DcBusiBillModelMaster) |
|||
{ |
|||
List<DcBusiBillModelMaster> list = dcBusiBillModelMasterService.selectDcBusiBillModelMasterList(DcBusiBillModelMaster); |
|||
ExcelUtil<DcBusiBillModelMaster> util = new ExcelUtil<DcBusiBillModelMaster>(DcBusiBillModelMaster.class); |
|||
util.exportExcel(response, list, "录入配置数据"); |
|||
} |
|||
|
|||
/** |
|||
* 获取录入配置详细信息 |
|||
*/ |
|||
@ApiOperation("获取录入配置详细信息") |
|||
@ApiImplicitParams({ |
|||
@ApiImplicitParam(name = "id", value = "", dataType = "Long", dataTypeClass = Long.class), |
|||
}) |
|||
// @PreAuthorize("@ss.hasPermi('draft:billModel:query')")
|
|||
@GetMapping(value = "/{id}") |
|||
public AjaxResult getInfo(@PathVariable("id") Long id) |
|||
{ |
|||
return success(dcBusiBillModelMasterService.selectDcBusiBillModelMasterById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增录入配置 |
|||
*/ |
|||
@ApiOperation("新增录入配置") |
|||
@ApiImplicitParams({ |
|||
@ApiImplicitParam(name = "DcBusiBillModelMaster", value = "", dataType = "DcBusiBillModelMaster", dataTypeClass = DcBusiBillModelMaster.class), |
|||
}) |
|||
//@PreAuthorize("@ss.hasPermi('draft:billModel:add')")
|
|||
@Log(title = "录入配置", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public AjaxResult add(@RequestBody DcBusiBillModelMaster DcBusiBillModelMaster) |
|||
{ |
|||
return toAjax(dcBusiBillModelMasterService.insertDcBusiBillModelMaster(DcBusiBillModelMaster)); |
|||
} |
|||
|
|||
/** |
|||
* 修改录入配置 |
|||
*/ |
|||
|
|||
@ApiOperation("修改录入配置") |
|||
@ApiImplicitParams({ |
|||
@ApiImplicitParam(name = "DcBusiBillModelMaster", value = "", dataType = "DcBusiBillModelMaster", dataTypeClass = DcBusiBillModelMaster.class), |
|||
}) |
|||
//@PreAuthorize("@ss.hasPermi('draft:billModel:edit')")
|
|||
@Log(title = "录入配置", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody DcBusiBillModelMaster DcBusiBillModelMaster) |
|||
{ |
|||
return toAjax(dcBusiBillModelMasterService.updateDcBusiBillModelMaster(DcBusiBillModelMaster)); |
|||
} |
|||
|
|||
/** |
|||
* 删除录入配置 |
|||
*/ |
|||
@ApiOperation("删除录入配置") |
|||
@ApiImplicitParams({ |
|||
@ApiImplicitParam(name = "ids", value = "", dataType = "Long", dataTypeClass =Long.class), |
|||
}) |
|||
//@PreAuthorize("@ss.hasPermi('draft:billModel:remove')")
|
|||
@Log(title = "录入配置", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public AjaxResult remove(@PathVariable Long[] ids) |
|||
{ |
|||
return toAjax(dcBusiBillModelMasterService.deleteDcBusiBillModelMasterByIds(ids)); |
|||
} |
|||
} |
@ -0,0 +1,85 @@ |
|||
package com.lzbi.draft.domain; |
|||
|
|||
import java.util.List; |
|||
import java.util.Date; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.IdType; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
import lombok.Data; |
|||
import com.lzbi.common.annotation.Excel; |
|||
import com.lzbi.module.base.BaseModuleEntity; |
|||
|
|||
/** |
|||
* 录入配置对象 dc_busi_bill_model_master |
|||
* |
|||
* @author zhousq |
|||
* @date 2023-12-11 |
|||
*/ |
|||
@Data |
|||
public class DcBusiBillModelMaster extends BaseModuleEntity |
|||
{ |
|||
/** 主键 */ |
|||
@ApiModelProperty(name = "主键",notes = "") |
|||
@TableId(type= IdType.AUTO) |
|||
private Long id ; |
|||
private static final long serialVersionUID = 1L; |
|||
/** 部门Id */ |
|||
@Excel(name = "部门Id") |
|||
private Long deptId; |
|||
|
|||
/** 角色ID */ |
|||
@Excel(name = "角色ID") |
|||
private Long roleId; |
|||
|
|||
/** 任务模版编号 */ |
|||
@Excel(name = "任务模版编号") |
|||
private String billModelNo; |
|||
|
|||
/** 任务模版名称 */ |
|||
@Excel(name = "任务模版名称") |
|||
private String billModelName; |
|||
|
|||
/** 所属专业编码 */ |
|||
@Excel(name = "所属专业编码") |
|||
private String fieldCode; |
|||
|
|||
/** 所属公司名称 */ |
|||
@Excel(name = "所属公司名称") |
|||
private String companyName; |
|||
|
|||
/** 所属公司ID */ |
|||
@Excel(name = "所属公司ID") |
|||
private Long companyId; |
|||
|
|||
/** 任务整点 */ |
|||
@Excel(name = "任务整点") |
|||
private String billModelPoint; |
|||
|
|||
/** 所属组织名称 */ |
|||
@Excel(name = "所属组织名称") |
|||
private String orgName; |
|||
|
|||
/** 所属组织ID */ |
|||
@Excel(name = "所属组织ID") |
|||
private Long orgId; |
|||
|
|||
/** 数据状态 */ |
|||
@Excel(name = "数据状态") |
|||
private String dataState; |
|||
|
|||
/** 使用状态 */ |
|||
@Excel(name = "使用状态") |
|||
private String useState; |
|||
|
|||
/** 所属专业名称 */ |
|||
@Excel(name = "所属专业名称") |
|||
private String fieldName; |
|||
|
|||
/** 数据录入单模版子信息 */ |
|||
private List<DcBusiBillModelSub> dcBusiBillModelSubList; |
|||
|
|||
} |
@ -0,0 +1,135 @@ |
|||
package com.lzbi.draft.domain; |
|||
|
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
import com.lzbi.common.annotation.Excel; |
|||
import com.lzbi.module.base.BaseModuleEntity; |
|||
|
|||
/** |
|||
* 数据录入单模版子对象 dc_busi_bill_model_sub |
|||
* |
|||
* @author zhousq |
|||
* @date 2023-12-11 |
|||
*/ |
|||
public class DcBusiBillModelSub extends BaseModuleEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 模版编码号 */ |
|||
@Excel(name = "模版编码号") |
|||
private String billModelNo; |
|||
|
|||
/** 统计单元编码 */ |
|||
@Excel(name = "统计单元编码") |
|||
private String assetCode; |
|||
|
|||
/** 统计单元名称 */ |
|||
@Excel(name = "统计单元名称") |
|||
private String assetName; |
|||
|
|||
/** 指标【参数】编码 */ |
|||
@Excel(name = "指标【参数】编码") |
|||
private String assetUnitCode; |
|||
|
|||
/** 指标【参数】名称 */ |
|||
@Excel(name = "指标【参数】名称") |
|||
private String assetUnitName; |
|||
|
|||
/** 数据类别;T指标P参数 */ |
|||
@Excel(name = "数据类别;T指标P参数") |
|||
private String assetUnitType; |
|||
|
|||
/** 主键 */ |
|||
private Long id; |
|||
|
|||
/** 统计单元ID */ |
|||
@Excel(name = "统计单元ID") |
|||
private Long assetId; |
|||
|
|||
public void setBillModelNo(String billModelNo) |
|||
{ |
|||
this.billModelNo = billModelNo; |
|||
} |
|||
|
|||
public String getBillModelNo() |
|||
{ |
|||
return billModelNo; |
|||
} |
|||
public void setAssetCode(String assetCode) |
|||
{ |
|||
this.assetCode = assetCode; |
|||
} |
|||
|
|||
public String getAssetCode() |
|||
{ |
|||
return assetCode; |
|||
} |
|||
public void setAssetName(String assetName) |
|||
{ |
|||
this.assetName = assetName; |
|||
} |
|||
|
|||
public String getAssetName() |
|||
{ |
|||
return assetName; |
|||
} |
|||
public void setAssetUnitCode(String assetUnitCode) |
|||
{ |
|||
this.assetUnitCode = assetUnitCode; |
|||
} |
|||
|
|||
public String getAssetUnitCode() |
|||
{ |
|||
return assetUnitCode; |
|||
} |
|||
public void setAssetUnitName(String assetUnitName) |
|||
{ |
|||
this.assetUnitName = assetUnitName; |
|||
} |
|||
|
|||
public String getAssetUnitName() |
|||
{ |
|||
return assetUnitName; |
|||
} |
|||
public void setAssetUnitType(String assetUnitType) |
|||
{ |
|||
this.assetUnitType = assetUnitType; |
|||
} |
|||
|
|||
public String getAssetUnitType() |
|||
{ |
|||
return assetUnitType; |
|||
} |
|||
public void setId(Long id) |
|||
{ |
|||
this.id = id; |
|||
} |
|||
|
|||
public Long getId() |
|||
{ |
|||
return id; |
|||
} |
|||
public void setAssetId(Long assetId) |
|||
{ |
|||
this.assetId = assetId; |
|||
} |
|||
|
|||
public Long getAssetId() |
|||
{ |
|||
return assetId; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("billModelNo", getBillModelNo()) |
|||
.append("assetCode", getAssetCode()) |
|||
.append("assetName", getAssetName()) |
|||
.append("assetUnitCode", getAssetUnitCode()) |
|||
.append("assetUnitName", getAssetUnitName()) |
|||
.append("assetUnitType", getAssetUnitType()) |
|||
.append("id", getId()) |
|||
.append("assetId", getAssetId()) |
|||
.toString(); |
|||
} |
|||
} |
@ -0,0 +1,89 @@ |
|||
package com.lzbi.draft.mapper; |
|||
|
|||
import java.util.List; |
|||
import com.lzbi.draft.domain.DcBusiBillModelMaster; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.lzbi.draft.domain.DcBusiBillModelSub; |
|||
|
|||
/** |
|||
* 录入配置Mapper接口 |
|||
* |
|||
* @author zhousq |
|||
* @date 2023-12-11 |
|||
*/ |
|||
|
|||
public interface DcBusiBillModelMasterMapper extends BaseMapper<DcBusiBillModelMaster> |
|||
{ |
|||
/** |
|||
* 查询录入配置 |
|||
* |
|||
* @param id 录入配置主键 |
|||
* @return 录入配置 |
|||
*/ |
|||
public DcBusiBillModelMaster selectDcBusiBillModelMasterById(Long id); |
|||
|
|||
/** |
|||
* 查询录入配置列表 |
|||
* |
|||
* @param dcBusiBillModelMaster 录入配置 |
|||
* @return 录入配置集合 |
|||
*/ |
|||
public List<DcBusiBillModelMaster> selectDcBusiBillModelMasterList(DcBusiBillModelMaster dcBusiBillModelMaster); |
|||
|
|||
/** |
|||
* 新增录入配置 |
|||
* |
|||
* @param dcBusiBillModelMaster 录入配置 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertDcBusiBillModelMaster(DcBusiBillModelMaster dcBusiBillModelMaster); |
|||
|
|||
/** |
|||
* 修改录入配置 |
|||
* |
|||
* @param dcBusiBillModelMaster 录入配置 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateDcBusiBillModelMaster(DcBusiBillModelMaster dcBusiBillModelMaster); |
|||
|
|||
/** |
|||
* 删除录入配置 |
|||
* |
|||
* @param id 录入配置主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteDcBusiBillModelMasterById(Long id); |
|||
|
|||
/** |
|||
* 批量删除录入配置 |
|||
* |
|||
* @param ids 需要删除的数据主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteDcBusiBillModelMasterByIds(Long[] ids); |
|||
|
|||
/** |
|||
* 批量删除数据录入单模版子 |
|||
* |
|||
* @param ids 需要删除的数据主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteDcBusiBillModelSubByBillModelNos(Long[] ids); |
|||
|
|||
/** |
|||
* 批量新增数据录入单模版子 |
|||
* |
|||
* @param dcBusiBillModelSubList 数据录入单模版子列表 |
|||
* @return 结果 |
|||
*/ |
|||
public int batchDcBusiBillModelSub(List<DcBusiBillModelSub> dcBusiBillModelSubList); |
|||
|
|||
|
|||
/** |
|||
* 通过录入配置主键删除数据录入单模版子信息 |
|||
* |
|||
* @param id 录入配置ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteDcBusiBillModelSubByBillModelNo(Long id); |
|||
} |
@ -0,0 +1,130 @@ |
|||
package com.lzbi.draft.service; |
|||
|
|||
import java.util.List; |
|||
import com.lzbi.common.utils.DateUtils; |
|||
import com.lzbi.common.utils.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import java.util.ArrayList; |
|||
import com.lzbi.common.utils.DateUtils; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
import com.lzbi.draft.domain.DcBusiBillModelSub; |
|||
import com.lzbi.draft.domain.DcBusiBillModelMaster; |
|||
import com.lzbi.draft.mapper.DcBusiBillModelMasterMapper; |
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
/** |
|||
* 录入配置Service业务层处理 |
|||
* |
|||
* @author zhousq |
|||
* @date 2023-12-11 |
|||
*/ |
|||
@Service |
|||
public class DcBusiBillModelMasterService extends ServiceImpl<DcBusiBillModelMasterMapper, DcBusiBillModelMaster> implements IService<DcBusiBillModelMaster> |
|||
{ |
|||
|
|||
/** |
|||
* 查询录入配置 |
|||
* |
|||
* @param id 录入配置主键 |
|||
* @return 录入配置 |
|||
*/ |
|||
public DcBusiBillModelMaster selectDcBusiBillModelMasterById(Long id) |
|||
{ |
|||
return baseMapper.selectDcBusiBillModelMasterById(id); |
|||
} |
|||
|
|||
/** |
|||
* 查询录入配置列表 |
|||
* |
|||
* @param dcBusiBillModelMaster 录入配置 |
|||
* @return 录入配置 |
|||
*/ |
|||
public List<DcBusiBillModelMaster> selectDcBusiBillModelMasterList(DcBusiBillModelMaster dcBusiBillModelMaster) |
|||
{ |
|||
return baseMapper.selectDcBusiBillModelMasterList(dcBusiBillModelMaster); |
|||
} |
|||
|
|||
/** |
|||
* 新增录入配置 |
|||
* |
|||
* @param dcBusiBillModelMaster 录入配置 |
|||
* @return 结果 |
|||
*/ |
|||
@Transactional |
|||
|
|||
public int insertDcBusiBillModelMaster(DcBusiBillModelMaster dcBusiBillModelMaster) |
|||
{ |
|||
dcBusiBillModelMaster.setCreatedTime(DateUtils.getNowDate()); |
|||
int rows = baseMapper.insertDcBusiBillModelMaster(dcBusiBillModelMaster); |
|||
insertDcBusiBillModelSub(dcBusiBillModelMaster); |
|||
return rows; |
|||
} |
|||
|
|||
/** |
|||
* 修改录入配置 |
|||
* |
|||
* @param dcBusiBillModelMaster 录入配置 |
|||
* @return 结果 |
|||
*/ |
|||
@Transactional |
|||
|
|||
public int updateDcBusiBillModelMaster(DcBusiBillModelMaster dcBusiBillModelMaster) |
|||
{ |
|||
dcBusiBillModelMaster.setUpdatedTime(DateUtils.getNowDate()); |
|||
baseMapper.deleteDcBusiBillModelSubByBillModelNo(dcBusiBillModelMaster.getId()); |
|||
insertDcBusiBillModelSub(dcBusiBillModelMaster); |
|||
return baseMapper.updateDcBusiBillModelMaster(dcBusiBillModelMaster); |
|||
} |
|||
|
|||
/** |
|||
* 批量删除录入配置 |
|||
* |
|||
* @param ids 需要删除的录入配置主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Transactional |
|||
|
|||
public int deleteDcBusiBillModelMasterByIds(Long[] ids) |
|||
{ |
|||
baseMapper.deleteDcBusiBillModelSubByBillModelNos(ids); |
|||
return baseMapper.deleteDcBusiBillModelMasterByIds(ids); |
|||
} |
|||
|
|||
/** |
|||
* 删除录入配置信息 |
|||
* |
|||
* @param id 录入配置主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Transactional |
|||
|
|||
public int deleteDcBusiBillModelMasterById(Long id) |
|||
{ |
|||
baseMapper.deleteDcBusiBillModelSubByBillModelNo(id); |
|||
return baseMapper.deleteDcBusiBillModelMasterById(id); |
|||
} |
|||
|
|||
/** |
|||
* 新增数据录入单模版子信息 |
|||
* |
|||
* @param dcBusiBillModelMaster 录入配置对象 |
|||
*/ |
|||
public void insertDcBusiBillModelSub(DcBusiBillModelMaster dcBusiBillModelMaster) |
|||
{ |
|||
List<DcBusiBillModelSub> dcBusiBillModelSubDaoList = dcBusiBillModelMaster.getDcBusiBillModelSubList(); |
|||
String billNo = dcBusiBillModelMaster.getBillModelNo(); |
|||
if (StringUtils.isNotNull(dcBusiBillModelSubDaoList)) |
|||
{ |
|||
List<DcBusiBillModelSub> list = new ArrayList<DcBusiBillModelSub>(); |
|||
for (DcBusiBillModelSub dcBusiBillModelSubDao : dcBusiBillModelSubDaoList) |
|||
{ |
|||
dcBusiBillModelSubDao.setBillModelNo(billNo); |
|||
list.add(dcBusiBillModelSubDao); |
|||
} |
|||
if (list.size() > 0) |
|||
{ |
|||
baseMapper.batchDcBusiBillModelSub(list); |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,184 @@ |
|||
<?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.draft.mapper.DcBusiBillModelMasterMapper"> |
|||
|
|||
<resultMap type="com.lzbi.draft.domain.DcBusiBillModelMaster" id="DcBusiBillModelMasterResult"> |
|||
<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="deptId" column="dept_id" /> |
|||
<result property="roleId" column="role_id" /> |
|||
<result property="billModelNo" column="bill_model_no" /> |
|||
<result property="billModelName" column="bill_model_name" /> |
|||
<result property="fieldCode" column="field_code" /> |
|||
<result property="companyName" column="company_name" /> |
|||
<result property="companyId" column="company_id" /> |
|||
<result property="billModelPoint" column="bill_model_point" /> |
|||
<result property="orgName" column="org_name" /> |
|||
<result property="orgId" column="org_id" /> |
|||
<result property="id" column="id" /> |
|||
<result property="dataState" column="data_state" /> |
|||
<result property="useState" column="use_state" /> |
|||
<result property="fieldName" column="field_name" /> |
|||
</resultMap> |
|||
|
|||
<resultMap id="DcBusiBillModelMasterDcBusiBillModelSubResult" type="DcBusiBillModelMaster" extends="DcBusiBillModelMasterResult"> |
|||
<collection property="dcBusiBillModelSubList" notNullColumn="sub_id" javaType="java.util.List" resultMap="DcBusiBillModelSubResult" /> |
|||
</resultMap> |
|||
|
|||
<resultMap type="DcBusiBillModelSub" id="DcBusiBillModelSubResult"> |
|||
<result property="billModelNo" column="sub_bill_model_no" /> |
|||
<result property="assetCode" column="sub_asset_code" /> |
|||
<result property="assetName" column="sub_asset_name" /> |
|||
<result property="assetUnitCode" column="sub_asset_unit_code" /> |
|||
<result property="assetUnitName" column="sub_asset_unit_name" /> |
|||
<result property="assetUnitType" column="sub_asset_unit_type" /> |
|||
<result property="id" column="sub_id" /> |
|||
<result property="assetId" column="sub_asset_id" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectDcBusiBillModelMasterVo"> |
|||
select tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, dept_id, role_id, bill_model_no, bill_model_name, field_code, company_name, company_id, bill_model_point, org_name, org_id, id, data_state, use_state, field_name from dc_busi_bill_model_master |
|||
</sql> |
|||
|
|||
<select id="selectDcBusiBillModelMasterList" parameterType="DcBusiBillModelMaster" resultMap="DcBusiBillModelMasterResult"> |
|||
<include refid="selectDcBusiBillModelMasterVo"/> |
|||
<where> |
|||
<if test="deptId != null and deptId != ''"> and dept_id = #{deptId}</if> |
|||
<if test="roleId != null "> and role_id = #{roleId}</if> |
|||
<if test="billModelNo != null and billModelNo != ''"> and bill_model_no = #{billModelNo}</if> |
|||
<if test="billModelName != null and billModelName != ''"> and bill_model_name like concat('%', #{billModelName}, '%')</if> |
|||
<if test="fieldCode != null and fieldCode != ''"> and field_code = #{fieldCode}</if> |
|||
<if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if> |
|||
<if test="companyId != null "> and company_id = #{companyId}</if> |
|||
<if test="billModelPoint != null and billModelPoint != ''"> and bill_model_point = #{billModelPoint}</if> |
|||
<if test="orgName != null and orgName != ''"> and org_name like concat('%', #{orgName}, '%')</if> |
|||
<if test="orgId != null "> and org_id = #{orgId}</if> |
|||
<if test="dataState != null and dataState != ''"> and data_state = #{dataState}</if> |
|||
<if test="useState != null and useState != ''"> and use_state = #{useState}</if> |
|||
<if test="fieldName != null and fieldName != ''"> and field_name like concat('%', #{fieldName}, '%')</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectDcBusiBillModelMasterById" parameterType="Long" resultMap="DcBusiBillModelMasterDcBusiBillModelSubResult"> |
|||
select a.tenant_id, a.revision, a.created_by, a.created_time, a.updated_by, a.updated_time, a.delete_by, a.delete_time, a.dept_id, a.role_id, a.bill_model_no, a.bill_model_name, a.field_code, a.company_name, a.company_id, a.bill_model_point, a.org_name, a.org_id, a.id, a.data_state, a.use_state, a.field_name, |
|||
b.bill_model_no as sub_bill_model_no, b.asset_code as sub_asset_code, b.asset_name as sub_asset_name, b.asset_unit_code as sub_asset_unit_code, b.asset_unit_name as sub_asset_unit_name, b.asset_unit_type as sub_asset_unit_type, b.id as sub_id, b.asset_id as sub_asset_id |
|||
from dc_busi_bill_model_master a |
|||
left join dc_busi_bill_model_sub b on b.bill_model_no = a.id |
|||
where a.id = #{id} |
|||
</select> |
|||
|
|||
<insert id="insertDcBusiBillModelMaster" parameterType="DcBusiBillModelMaster" useGeneratedKeys="true" keyProperty="id"> |
|||
insert into dc_busi_bill_model_master |
|||
<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="deptId != null">dept_id,</if> |
|||
<if test="roleId != null">role_id,</if> |
|||
<if test="billModelNo != null">bill_model_no,</if> |
|||
<if test="billModelName != null">bill_model_name,</if> |
|||
<if test="fieldCode != null">field_code,</if> |
|||
<if test="companyName != null">company_name,</if> |
|||
<if test="companyId != null">company_id,</if> |
|||
<if test="billModelPoint != null">bill_model_point,</if> |
|||
<if test="orgName != null">org_name,</if> |
|||
<if test="orgId != null">org_id,</if> |
|||
<if test="dataState != null">data_state,</if> |
|||
<if test="useState != null">use_state,</if> |
|||
<if test="fieldName != null">field_name,</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="deptId != null">#{deptId},</if> |
|||
<if test="roleId != null">#{roleId},</if> |
|||
<if test="billModelNo != null">#{billModelNo},</if> |
|||
<if test="billModelName != null">#{billModelName},</if> |
|||
<if test="fieldCode != null">#{fieldCode},</if> |
|||
<if test="companyName != null">#{companyName},</if> |
|||
<if test="companyId != null">#{companyId},</if> |
|||
<if test="billModelPoint != null">#{billModelPoint},</if> |
|||
<if test="orgName != null">#{orgName},</if> |
|||
<if test="orgId != null">#{orgId},</if> |
|||
<if test="dataState != null">#{dataState},</if> |
|||
<if test="useState != null">#{useState},</if> |
|||
<if test="fieldName != null">#{fieldName},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateDcBusiBillModelMaster" parameterType="DcBusiBillModelMaster"> |
|||
update dc_busi_bill_model_master |
|||
<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="deptId != null">dept_id = #{deptId},</if> |
|||
<if test="roleId != null">role_id = #{roleId},</if> |
|||
<if test="billModelNo != null">bill_model_no = #{billModelNo},</if> |
|||
<if test="billModelName != null">bill_model_name = #{billModelName},</if> |
|||
<if test="fieldCode != null">field_code = #{fieldCode},</if> |
|||
<if test="companyName != null">company_name = #{companyName},</if> |
|||
<if test="companyId != null">company_id = #{companyId},</if> |
|||
<if test="billModelPoint != null">bill_model_point = #{billModelPoint},</if> |
|||
<if test="orgName != null">org_name = #{orgName},</if> |
|||
<if test="orgId != null">org_id = #{orgId},</if> |
|||
<if test="dataState != null">data_state = #{dataState},</if> |
|||
<if test="useState != null">use_state = #{useState},</if> |
|||
<if test="fieldName != null">field_name = #{fieldName},</if> |
|||
</trim> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<delete id="deleteDcBusiBillModelMasterById" parameterType="Long"> |
|||
delete from dc_busi_bill_model_master where id = #{id} |
|||
</delete> |
|||
|
|||
<delete id="deleteDcBusiBillModelMasterByIds" parameterType="String"> |
|||
delete from dc_busi_bill_model_master where id in |
|||
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|||
#{id} |
|||
</foreach> |
|||
</delete> |
|||
|
|||
<delete id="deleteDcBusiBillModelSubByBillModelNos" parameterType="String"> |
|||
delete from dc_busi_bill_model_sub where bill_model_no in |
|||
<foreach item="billModelNo" collection="array" open="(" separator="," close=")"> |
|||
#{billModelNo} |
|||
</foreach> |
|||
</delete> |
|||
|
|||
<delete id="deleteDcBusiBillModelSubByBillModelNo" parameterType="Long"> |
|||
delete from dc_busi_bill_model_sub where bill_model_no = #{billModelNo} |
|||
</delete> |
|||
|
|||
<insert id="batchDcBusiBillModelSub"> |
|||
insert into dc_busi_bill_model_sub( bill_model_no, asset_code, asset_name, asset_unit_code, asset_unit_name, asset_unit_type, id, asset_id) values |
|||
<foreach item="item" index="index" collection="list" separator=","> |
|||
( #{item.billModelNo}, #{item.assetCode}, #{item.assetName}, #{item.assetUnitCode}, #{item.assetUnitName}, #{item.assetUnitType}, #{item.id}, #{item.assetId}) |
|||
</foreach> |
|||
</insert> |
|||
</mapper> |
Loading…
Reference in new issue