feat: 修改
parent
9c7219c728
commit
87bf601366
@ -0,0 +1,25 @@
|
|||||||
|
package com.glxp.api.dao.dev;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.glxp.api.entity.dev.DeviceAssetContractEntity;
|
||||||
|
import com.glxp.api.req.inv.FilterInvContractRequest;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface DeviceAssetContractMapper extends BaseMapper<DeviceAssetContractEntity> {
|
||||||
|
|
||||||
|
List<DeviceAssetContractEntity> filterCompanyContract(FilterInvContractRequest filterInvContractRequest);
|
||||||
|
|
||||||
|
boolean deleteById(String id);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
boolean updateDeviceContract(DeviceAssetContractEntity deviceAssetContractEntity);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
package com.glxp.api.req.dev;
|
||||||
|
|
||||||
|
import com.glxp.api.entity.dev.DeviceAssetCertEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PostDeviceContractRequest extends DeviceAssetCertEntity {
|
||||||
|
|
||||||
|
|
||||||
|
private int repeatUpload;
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.glxp.api.service.dev;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.glxp.api.entity.dev.DeviceAssetContractEntity;
|
||||||
|
import com.glxp.api.req.inv.FilterInvContractRequest;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public interface DeviceAssetContractService extends IService<DeviceAssetContractEntity> {
|
||||||
|
List<DeviceAssetContractEntity> filterDeviceContract(FilterInvContractRequest filterInvContractRequest);
|
||||||
|
|
||||||
|
boolean insertDeviceContract(DeviceAssetContractEntity deviceAssetCertEntity);
|
||||||
|
|
||||||
|
boolean deleteById(String id);
|
||||||
|
|
||||||
|
boolean updateDeviceContract(DeviceAssetContractEntity deviceAssetContractEntity);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,54 @@
|
|||||||
|
package com.glxp.api.service.dev.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.glxp.api.dao.dev.DeviceAssetContractMapper;
|
||||||
|
import com.glxp.api.entity.dev.DeviceAssetContractEntity;
|
||||||
|
import com.glxp.api.req.inv.FilterInvContractRequest;
|
||||||
|
import com.glxp.api.service.dev.DeviceAssetContractService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public class DeviceAssetContractServiceImpl extends ServiceImpl<DeviceAssetContractMapper, DeviceAssetContractEntity> implements DeviceAssetContractService {
|
||||||
|
@Resource
|
||||||
|
DeviceAssetContractMapper deviceAssetContractMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeviceAssetContractEntity> filterDeviceContract(FilterInvContractRequest filterInvContractRequest) {
|
||||||
|
if (filterInvContractRequest == null) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
if (filterInvContractRequest.getPage() != null) {
|
||||||
|
int offset = (filterInvContractRequest.getPage() - 1) * filterInvContractRequest.getLimit();
|
||||||
|
PageHelper.offsetPage(offset, filterInvContractRequest.getLimit());
|
||||||
|
}
|
||||||
|
return deviceAssetContractMapper.filterCompanyContract(filterInvContractRequest);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public boolean insertDeviceContract(DeviceAssetContractEntity deviceAssetContractEntity) {
|
||||||
|
return deviceAssetContractMapper.insert(deviceAssetContractEntity) > 0 ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean deleteById(String id) {
|
||||||
|
return deviceAssetContractMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean updateDeviceContract(DeviceAssetContractEntity deviceAssetContractEntity) {
|
||||||
|
return deviceAssetContractMapper.updateDeviceContract(deviceAssetContractEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,81 @@
|
|||||||
|
<?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.glxp.api.dao.dev.DeviceAssetContractMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.glxp.api.entity.dev.DeviceAssetContractEntity">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
<!--@Table device_asset_contract-->
|
||||||
|
<id column="id" jdbcType="BIGINT" property="id" />
|
||||||
|
<result column="devCodeFk" jdbcType="VARCHAR" property="devCodeFk" />
|
||||||
|
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||||
|
<result column="code" jdbcType="VARCHAR" property="code" />
|
||||||
|
<result column="filePath" jdbcType="LONGVARCHAR" property="filePath" />
|
||||||
|
<result column="vailDate" jdbcType="TIMESTAMP" property="vailDate" />
|
||||||
|
<result column="expireDate" jdbcType="TIMESTAMP" property="expireDate" />
|
||||||
|
<result column="status" jdbcType="TINYINT" property="status" />
|
||||||
|
<result column="type" jdbcType="TINYINT" property="type" />
|
||||||
|
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||||
|
<result column="createUser" jdbcType="VARCHAR" property="createUser" />
|
||||||
|
<result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
|
<result column="updateUser" jdbcType="VARCHAR" property="updateUser" />
|
||||||
|
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
id, devCodeFk, `name`, code, filePath, vailDate, expireDate, `status`, `type`, remark,
|
||||||
|
`createUser`, createTime, updateUser, updateTime
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="filterCompanyContract" parameterType="com.glxp.api.req.inv.FilterInvContractRequest"
|
||||||
|
resultType="com.glxp.api.entity.dev.DeviceAssetContractEntity">
|
||||||
|
select * from device_asset_contract
|
||||||
|
<where>
|
||||||
|
devCodeFk = #{devCodeFk}
|
||||||
|
<!-- <if test="devCodeFk != '' and devCodeFk!=null">-->
|
||||||
|
<!-- and devCodeFk = #{devCodeFk}-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<if test="name != '' and name!=null">
|
||||||
|
and name = #{name}
|
||||||
|
</if>
|
||||||
|
<if test="code != '' and code!=null">
|
||||||
|
and code = #{code}
|
||||||
|
</if>
|
||||||
|
<if test="status != '' and status!=null">
|
||||||
|
and status = #{status}
|
||||||
|
</if>
|
||||||
|
<if test="type != '' and type!=null">
|
||||||
|
and `type` = #{type}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
|
||||||
|
</where>
|
||||||
|
ORDER BY id DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<delete id="deleteById" parameterType="Map">
|
||||||
|
DELETE
|
||||||
|
FROM device_asset_contract
|
||||||
|
WHERE id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<update id="updateDeviceContract" parameterType="com.glxp.api.entity.dev.DeviceAssetContractEntity">
|
||||||
|
UPDATE device_asset_contract
|
||||||
|
<trim prefix="set" suffixOverrides=",">
|
||||||
|
<if test="name != null">name=#{name},</if>
|
||||||
|
<if test="devCodeFk != null">devCodeFk=#{devCodeFk},</if>
|
||||||
|
<if test="filePath != null">filePath=#{filePath},</if>
|
||||||
|
<if test="remark != null">remark=#{remark},</if>
|
||||||
|
vailDate=#{vailDate},
|
||||||
|
expireDate=#{expireDate},
|
||||||
|
<if test="type != null">`type`=#{type},</if>
|
||||||
|
<if test="code != null">`code`=#{code},</if>
|
||||||
|
<if test="status != null">`status`=#{status},</if>
|
||||||
|
<if test="updateUser != null">`updateUser`=#{updateUser},</if>
|
||||||
|
<if test="updateTime != null">`updateTime`=#{updateTime},</if>
|
||||||
|
|
||||||
|
</trim>
|
||||||
|
WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue