bobol
11 months ago
34 changed files with 850 additions and 288 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. DcBusiTargetBillSub; |
|||
import com.lzbi.draft.service.DcBusiTargetBillSubService; |
|||
import com.lzbi.common.utils.poi.ExcelUtil; |
|||
import com.lzbi.common.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 指标数据采集(录入)明细Controller |
|||
* |
|||
* @author zhousq |
|||
* @date 2023-12-19 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/draft/targetBIllSub") |
|||
public class DcBusiTargetBillSubController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private DcBusiTargetBillSubService dcBusiTargetBillSubService; |
|||
|
|||
/** |
|||
* 查询指标数据采集(录入)明细列表 |
|||
*/ |
|||
@ApiOperation("查询指标数据采集(录入)明细列表") |
|||
@ApiImplicitParams({ |
|||
@ApiImplicitParam(name = "DcBusiTargetBillSub", value = "", dataType = "DcBusiTargetBillSub", dataTypeClass = DcBusiTargetBillSub.class), |
|||
}) |
|||
@PreAuthorize("@ss.hasPermi('draft:targetBIllSub:list')") |
|||
@GetMapping("/list") |
|||
public TableDataInfo list(DcBusiTargetBillSub DcBusiTargetBillSub) |
|||
{ |
|||
startPage(); |
|||
List< DcBusiTargetBillSub> list = dcBusiTargetBillSubService.selectDcBusiTargetBillSubList(DcBusiTargetBillSub); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出指标数据采集(录入)明细列表 |
|||
*/ |
|||
@ApiOperation("导出指标数据采集(录入)明细列表") |
|||
@ApiImplicitParams({ |
|||
@ApiImplicitParam(name = "DcBusiTargetBillSub", value = "", dataType = "DcBusiTargetBillSub", dataTypeClass = DcBusiTargetBillSub.class), |
|||
}) |
|||
@PreAuthorize("@ss.hasPermi('draft:targetBIllSub:export')") |
|||
@Log(title = "指标数据采集(录入)明细", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(HttpServletResponse response,DcBusiTargetBillSub DcBusiTargetBillSub) |
|||
{ |
|||
List<DcBusiTargetBillSub> list = dcBusiTargetBillSubService.selectDcBusiTargetBillSubList(DcBusiTargetBillSub); |
|||
ExcelUtil<DcBusiTargetBillSub> util = new ExcelUtil<DcBusiTargetBillSub>(DcBusiTargetBillSub.class); |
|||
util.exportExcel(response, list, "指标数据采集(录入)明细数据"); |
|||
} |
|||
|
|||
/** |
|||
* 获取指标数据采集(录入)明细详细信息 |
|||
*/ |
|||
@ApiOperation("获取指标数据采集(录入)明细详细信息") |
|||
@ApiImplicitParams({ |
|||
@ApiImplicitParam(name = "id", value = "", dataType = "Long", dataTypeClass = Long.class), |
|||
}) |
|||
@PreAuthorize("@ss.hasPermi('draft:targetBIllSub:query')") |
|||
@GetMapping(value = "/{id}") |
|||
public AjaxResult getInfo(@PathVariable("id") Long id) |
|||
{ |
|||
return success(dcBusiTargetBillSubService.selectDcBusiTargetBillSubById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增指标数据采集(录入)明细 |
|||
*/ |
|||
@ApiOperation("新增指标数据采集(录入)明细") |
|||
@ApiImplicitParams({ |
|||
@ApiImplicitParam(name = "DcBusiTargetBillSub", value = "", dataType = "DcBusiTargetBillSub", dataTypeClass = DcBusiTargetBillSub.class), |
|||
}) |
|||
@PreAuthorize("@ss.hasPermi('draft:targetBIllSub:add')") |
|||
@Log(title = "指标数据采集(录入)明细", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public AjaxResult add(@RequestBody DcBusiTargetBillSub DcBusiTargetBillSub) |
|||
{ |
|||
return toAjax(dcBusiTargetBillSubService.insertDcBusiTargetBillSub(DcBusiTargetBillSub)); |
|||
} |
|||
|
|||
/** |
|||
* 修改指标数据采集(录入)明细 |
|||
*/ |
|||
|
|||
@ApiOperation("修改指标数据采集(录入)明细") |
|||
@ApiImplicitParams({ |
|||
@ApiImplicitParam(name = "DcBusiTargetBillSub", value = "", dataType = "DcBusiTargetBillSub", dataTypeClass = DcBusiTargetBillSub.class), |
|||
}) |
|||
@PreAuthorize("@ss.hasPermi('draft:targetBIllSub:edit')") |
|||
@Log(title = "指标数据采集(录入)明细", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody DcBusiTargetBillSub DcBusiTargetBillSub) |
|||
{ |
|||
return toAjax(dcBusiTargetBillSubService.updateDcBusiTargetBillSub(DcBusiTargetBillSub)); |
|||
} |
|||
|
|||
/** |
|||
* 删除指标数据采集(录入)明细 |
|||
*/ |
|||
@ApiOperation("删除指标数据采集(录入)明细") |
|||
@ApiImplicitParams({ |
|||
@ApiImplicitParam(name = "ids", value = "", dataType = "Long", dataTypeClass =Long.class), |
|||
}) |
|||
@PreAuthorize("@ss.hasPermi('draft:targetBIllSub:remove')") |
|||
@Log(title = "指标数据采集(录入)明细", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public AjaxResult remove(@PathVariable Long[] ids) |
|||
{ |
|||
return toAjax(dcBusiTargetBillSubService.deleteDcBusiTargetBillSubByIds(ids)); |
|||
} |
|||
} |
@ -0,0 +1,63 @@ |
|||
package com.lzbi.draft.mapper; |
|||
|
|||
import java.util.List; |
|||
import com.lzbi.draft.domain.DcBusiTargetBillSub; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
|
|||
/** |
|||
* 指标数据采集(录入)明细Mapper接口 |
|||
* |
|||
* @author zhousq |
|||
* @date 2023-12-19 |
|||
*/ |
|||
|
|||
public interface DcBusiTargetBillSubMapper extends BaseMapper<DcBusiTargetBillSub> |
|||
{ |
|||
/** |
|||
* 查询指标数据采集(录入)明细 |
|||
* |
|||
* @param id 指标数据采集(录入)明细主键 |
|||
* @return 指标数据采集(录入)明细 |
|||
*/ |
|||
public DcBusiTargetBillSub selectDcBusiTargetBillSubById(Long id); |
|||
|
|||
/** |
|||
* 查询指标数据采集(录入)明细列表 |
|||
* |
|||
* @param dcBusiTargetBillSub 指标数据采集(录入)明细 |
|||
* @return 指标数据采集(录入)明细集合 |
|||
*/ |
|||
public List<DcBusiTargetBillSub> selectDcBusiTargetBillSubList(DcBusiTargetBillSub dcBusiTargetBillSub); |
|||
|
|||
/** |
|||
* 新增指标数据采集(录入)明细 |
|||
* |
|||
* @param dcBusiTargetBillSub 指标数据采集(录入)明细 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertDcBusiTargetBillSub(DcBusiTargetBillSub dcBusiTargetBillSub); |
|||
|
|||
/** |
|||
* 修改指标数据采集(录入)明细 |
|||
* |
|||
* @param dcBusiTargetBillSub 指标数据采集(录入)明细 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateDcBusiTargetBillSub(DcBusiTargetBillSub dcBusiTargetBillSub); |
|||
|
|||
/** |
|||
* 删除指标数据采集(录入)明细 |
|||
* |
|||
* @param id 指标数据采集(录入)明细主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteDcBusiTargetBillSubById(Long id); |
|||
|
|||
/** |
|||
* 批量删除指标数据采集(录入)明细 |
|||
* |
|||
* @param ids 需要删除的数据主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteDcBusiTargetBillSubByIds(Long[] ids); |
|||
} |
@ -0,0 +1,91 @@ |
|||
package com.lzbi.draft.service; |
|||
|
|||
import java.util.List; |
|||
import com.lzbi.common.utils.DateUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import com.lzbi.draft.domain.DcBusiTargetBillSub; |
|||
import com.lzbi.draft.mapper.DcBusiTargetBillSubMapper; |
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
/** |
|||
* 指标数据采集(录入)明细Service业务层处理 |
|||
* |
|||
* @author zhousq |
|||
* @date 2023-12-19 |
|||
*/ |
|||
@Service |
|||
public class DcBusiTargetBillSubService extends ServiceImpl<DcBusiTargetBillSubMapper, DcBusiTargetBillSub> implements IService<DcBusiTargetBillSub> |
|||
{ |
|||
|
|||
/** |
|||
* 查询指标数据采集(录入)明细 |
|||
* |
|||
* @param id 指标数据采集(录入)明细主键 |
|||
* @return 指标数据采集(录入)明细 |
|||
*/ |
|||
public DcBusiTargetBillSub selectDcBusiTargetBillSubById(Long id) |
|||
{ |
|||
return baseMapper.selectDcBusiTargetBillSubById(id); |
|||
} |
|||
|
|||
/** |
|||
* 查询指标数据采集(录入)明细列表 |
|||
* |
|||
* @param dcBusiTargetBillSub 指标数据采集(录入)明细 |
|||
* @return 指标数据采集(录入)明细 |
|||
*/ |
|||
public List<DcBusiTargetBillSub> selectDcBusiTargetBillSubList(DcBusiTargetBillSub dcBusiTargetBillSub) |
|||
{ |
|||
return baseMapper.selectDcBusiTargetBillSubList(dcBusiTargetBillSub); |
|||
} |
|||
|
|||
/** |
|||
* 新增指标数据采集(录入)明细 |
|||
* |
|||
* @param dcBusiTargetBillSub 指标数据采集(录入)明细 |
|||
* @return 结果 |
|||
*/ |
|||
|
|||
public int insertDcBusiTargetBillSub(DcBusiTargetBillSub dcBusiTargetBillSub) |
|||
{ |
|||
dcBusiTargetBillSub.setCreatedTime(DateUtils.getNowDate()); |
|||
return baseMapper.insertDcBusiTargetBillSub(dcBusiTargetBillSub); |
|||
} |
|||
|
|||
/** |
|||
* 修改指标数据采集(录入)明细 |
|||
* |
|||
* @param dcBusiTargetBillSub 指标数据采集(录入)明细 |
|||
* @return 结果 |
|||
*/ |
|||
|
|||
public int updateDcBusiTargetBillSub(DcBusiTargetBillSub dcBusiTargetBillSub) |
|||
{ |
|||
dcBusiTargetBillSub.setUpdatedTime(DateUtils.getNowDate()); |
|||
return baseMapper.updateDcBusiTargetBillSub(dcBusiTargetBillSub); |
|||
} |
|||
|
|||
/** |
|||
* 批量删除指标数据采集(录入)明细 |
|||
* |
|||
* @param ids 需要删除的指标数据采集(录入)明细主键 |
|||
* @return 结果 |
|||
*/ |
|||
|
|||
public int deleteDcBusiTargetBillSubByIds(Long[] ids) |
|||
{ |
|||
return baseMapper.deleteDcBusiTargetBillSubByIds(ids); |
|||
} |
|||
|
|||
/** |
|||
* 删除指标数据采集(录入)明细信息 |
|||
* |
|||
* @param id 指标数据采集(录入)明细主键 |
|||
* @return 结果 |
|||
*/ |
|||
|
|||
public int deleteDcBusiTargetBillSubById(Long id) |
|||
{ |
|||
return baseMapper.deleteDcBusiTargetBillSubById(id); |
|||
} |
|||
} |
@ -0,0 +1,138 @@ |
|||
<?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.DcBusiTargetBillSubMapper"> |
|||
|
|||
<resultMap type="com.lzbi.draft.domain.DcBusiTargetBillSub" id="DcBusiTargetBillSubResult"> |
|||
<result property="id" column="id" /> |
|||
<result property="billNo" column="bill_no" /> |
|||
<result property="targetName" column="target_name" /> |
|||
<result property="targetCode" column="target_code" /> |
|||
<result property="targetUint" column="target_uint" /> |
|||
<result property="targetValue" column="target_value" /> |
|||
<result property="countDate" column="count_date" /> |
|||
<result property="countDay" column="count_day" /> |
|||
<result property="fieldCode" column="field_code" /> |
|||
<result property="fieldName" column="field_name" /> |
|||
<result property="assetCode" column="asset_code" /> |
|||
<result property="assetName" column="asset_name" /> |
|||
<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" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectDcBusiTargetBillSubVo"> |
|||
select id, bill_no, target_name, target_code, target_uint, target_value, count_date, count_day, field_code, field_name, asset_code, asset_name, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time from dc_busi_target_bill_sub |
|||
</sql> |
|||
|
|||
<select id="selectDcBusiTargetBillSubList" parameterType="DcBusiTargetBillSub" resultMap="DcBusiTargetBillSubResult"> |
|||
<include refid="selectDcBusiTargetBillSubVo"/> |
|||
<where> |
|||
<if test="billNo != null and billNo != ''"> and bill_no = #{billNo}</if> |
|||
<if test="targetName != null and targetName != ''"> and target_name like concat('%', #{targetName}, '%')</if> |
|||
<if test="targetCode != null and targetCode != ''"> and target_code = #{targetCode}</if> |
|||
<if test="targetUint != null and targetUint != ''"> and target_uint = #{targetUint}</if> |
|||
<if test="targetValue != null "> and target_value = #{targetValue}</if> |
|||
<if test="countDate != null and countDate != ''"> and count_date = #{countDate}</if> |
|||
<if test="countDay != null "> and count_day = #{countDay}</if> |
|||
<if test="fieldCode != null and fieldCode != ''"> and field_code = #{fieldCode}</if> |
|||
<if test="fieldName != null and fieldName != ''"> and field_name like concat('%', #{fieldName}, '%')</if> |
|||
<if test="assetCode != null and assetCode != ''"> and asset_code = #{assetCode}</if> |
|||
<if test="assetName != null and assetName != ''"> and asset_name like concat('%', #{assetName}, '%')</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectDcBusiTargetBillSubById" parameterType="Long" resultMap="DcBusiTargetBillSubResult"> |
|||
<include refid="selectDcBusiTargetBillSubVo"/> |
|||
where id = #{id} |
|||
</select> |
|||
|
|||
<insert id="insertDcBusiTargetBillSub" parameterType="DcBusiTargetBillSub" useGeneratedKeys="true" keyProperty="id"> |
|||
insert into dc_busi_target_bill_sub |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="billNo != null">bill_no,</if> |
|||
<if test="targetName != null">target_name,</if> |
|||
<if test="targetCode != null">target_code,</if> |
|||
<if test="targetUint != null">target_uint,</if> |
|||
<if test="targetValue != null">target_value,</if> |
|||
<if test="countDate != null">count_date,</if> |
|||
<if test="countDay != null">count_day,</if> |
|||
<if test="fieldCode != null">field_code,</if> |
|||
<if test="fieldName != null">field_name,</if> |
|||
<if test="assetCode != null">asset_code,</if> |
|||
<if test="assetName != null">asset_name,</if> |
|||
<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> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="billNo != null">#{billNo},</if> |
|||
<if test="targetName != null">#{targetName},</if> |
|||
<if test="targetCode != null">#{targetCode},</if> |
|||
<if test="targetUint != null">#{targetUint},</if> |
|||
<if test="targetValue != null">#{targetValue},</if> |
|||
<if test="countDate != null">#{countDate},</if> |
|||
<if test="countDay != null">#{countDay},</if> |
|||
<if test="fieldCode != null">#{fieldCode},</if> |
|||
<if test="fieldName != null">#{fieldName},</if> |
|||
<if test="assetCode != null">#{assetCode},</if> |
|||
<if test="assetName != null">#{assetName},</if> |
|||
<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> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateDcBusiTargetBillSub" parameterType="DcBusiTargetBillSub"> |
|||
update dc_busi_target_bill_sub |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="billNo != null">bill_no = #{billNo},</if> |
|||
<if test="targetName != null">target_name = #{targetName},</if> |
|||
<if test="targetCode != null">target_code = #{targetCode},</if> |
|||
<if test="targetUint != null">target_uint = #{targetUint},</if> |
|||
<if test="targetValue != null">target_value = #{targetValue},</if> |
|||
<if test="countDate != null">count_date = #{countDate},</if> |
|||
<if test="countDay != null">count_day = #{countDay},</if> |
|||
<if test="fieldCode != null">field_code = #{fieldCode},</if> |
|||
<if test="fieldName != null">field_name = #{fieldName},</if> |
|||
<if test="assetCode != null">asset_code = #{assetCode},</if> |
|||
<if test="assetName != null">asset_name = #{assetName},</if> |
|||
<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> |
|||
</trim> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<delete id="deleteDcBusiTargetBillSubById" parameterType="Long"> |
|||
delete from dc_busi_target_bill_sub where id = #{id} |
|||
</delete> |
|||
|
|||
<delete id="deleteDcBusiTargetBillSubByIds" parameterType="String"> |
|||
delete from dc_busi_target_bill_sub where id in |
|||
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|||
#{id} |
|||
</foreach> |
|||
</delete> |
|||
</mapper> |
Loading…
Reference in new issue