Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
bca4e13ada
|
|
@ -0,0 +1,57 @@
|
|||
package com.bonus.common.biz.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 附件
|
||||
对象 bm_file_info
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2024-09-26
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class BmFileInfo extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 任务类型, 参考数据字典 tm_task_type */
|
||||
@Excel(name = "任务类型")
|
||||
@ApiModelProperty(value = "任务类型")
|
||||
private Integer taskType;
|
||||
|
||||
/** 任务id */
|
||||
@Excel(name = "任务id")
|
||||
@ApiModelProperty(value = "任务id")
|
||||
private Long taskId;
|
||||
|
||||
/** 模块id */
|
||||
@Excel(name = "模块id")
|
||||
@ApiModelProperty(value = "模块id")
|
||||
private Long modelId;
|
||||
|
||||
/** 文件名称 */
|
||||
@Excel(name = "文件名称")
|
||||
@ApiModelProperty(value = "文件名称")
|
||||
private String name;
|
||||
|
||||
/** 文件路径 */
|
||||
@Excel(name = "文件路径")
|
||||
@ApiModelProperty(value = "文件路径")
|
||||
private String url;
|
||||
|
||||
/** 文件类型, 参考数据字典 bm_file_type */
|
||||
@Excel(name = "文件类型")
|
||||
@ApiModelProperty(value = "文件类型")
|
||||
private Long fileType;
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.material.device.domain;
|
||||
|
||||
import com.bonus.common.biz.domain.BmFileInfo;
|
||||
import com.bonus.common.biz.domain.SysFileInfo;
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
|
|
@ -33,6 +34,18 @@ public class DevInfo extends BaseEntity {
|
|||
@ApiModelProperty(value = "系统编码")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "装备名称")
|
||||
private String deviceName;
|
||||
|
||||
@ApiModelProperty(value = "整机装备重量")
|
||||
private String deviceWeight;
|
||||
|
||||
@ApiModelProperty(value = "联系人")
|
||||
private String person;
|
||||
|
||||
@ApiModelProperty(value = "联系电话")
|
||||
private String personPhone;
|
||||
|
||||
/** 类型id */
|
||||
@Excel(name = "类型id")
|
||||
@ApiModelProperty(value = "类型id")
|
||||
|
|
@ -155,10 +168,14 @@ public class DevInfo extends BaseEntity {
|
|||
@ApiModelProperty(value = "是否删除")
|
||||
private String isActive;
|
||||
|
||||
/**文件附件*/
|
||||
/**文件附件 后续废弃 用下面的*/
|
||||
@ApiModelProperty(value = "文件附件")
|
||||
private List<SysFileInfo> fileList;
|
||||
|
||||
/**文件附件*/
|
||||
@ApiModelProperty(value = "文件附件")
|
||||
private List<BmFileInfo> bmFileInfoList;
|
||||
|
||||
@ApiModelProperty(value = "城市")
|
||||
private String city;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,72 @@
|
|||
package com.bonus.material.device.mapper;
|
||||
|
||||
import com.bonus.common.biz.domain.BmFileInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 附件Mapper接口
|
||||
* @author xsheng
|
||||
*/
|
||||
public interface BmFileInfoMapper {
|
||||
/**
|
||||
* 查询附件
|
||||
*
|
||||
* @param id 附件主键
|
||||
* @return 附件
|
||||
*/
|
||||
BmFileInfo selectBmFileInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询附件列表
|
||||
*
|
||||
* @param bmFileInfo 附件
|
||||
* @return 附件集合
|
||||
*/
|
||||
List<BmFileInfo> selectBmFileInfoList(BmFileInfo bmFileInfo);
|
||||
|
||||
/**
|
||||
* 新增附件
|
||||
*
|
||||
* @param bmFileInfo 附件
|
||||
* @return 结果
|
||||
*/
|
||||
int insertBmFileInfo(BmFileInfo bmFileInfo);
|
||||
|
||||
int insertBmFileInfos(@Param("list") List<BmFileInfo> bmFileInfos);
|
||||
|
||||
/**
|
||||
* 修改附件
|
||||
*
|
||||
* @param bmFileInfo 附件
|
||||
* @return 结果
|
||||
*/
|
||||
int updateBmFileInfo(BmFileInfo bmFileInfo);
|
||||
|
||||
/**
|
||||
* 删除附件
|
||||
*
|
||||
* @param id 附件主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteBmFileInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除附件
|
||||
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteBmFileInfoByIds(Long[] ids);
|
||||
|
||||
|
||||
/**
|
||||
* 删除附件
|
||||
*
|
||||
* @param bmFileInfo 附件信息
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteBmFileInfoByBizInfo(BmFileInfo bmFileInfo);
|
||||
}
|
||||
|
|
@ -9,6 +9,7 @@ import com.bonus.common.security.utils.SecurityUtils;
|
|||
import com.bonus.material.device.domain.DevInfo;
|
||||
import com.bonus.material.device.domain.dto.InfoMotionDto;
|
||||
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||
import com.bonus.material.device.mapper.BmFileInfoMapper;
|
||||
import com.bonus.material.device.mapper.DevInfoMapper;
|
||||
import com.bonus.material.device.mapper.SysFileInfoMapper;
|
||||
import com.bonus.material.device.service.DevInfoService;
|
||||
|
|
@ -41,6 +42,9 @@ public class DevInfoServiceImpl implements DevInfoService {
|
|||
@Resource
|
||||
private SysFileInfoMapper sysFileInfoMapper;
|
||||
|
||||
@Resource
|
||||
private BmFileInfoMapper bmFileInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询设备信息
|
||||
*
|
||||
|
|
@ -155,8 +159,15 @@ public class DevInfoServiceImpl implements DevInfoService {
|
|||
@Override
|
||||
public List<DevInfoVo> selectDevInfoHotList(DevInfoVo devInfo) {
|
||||
List<DevInfoVo> hotList = devInfoMapper.selectDevInfoHotList(devInfo);
|
||||
fillInMaStatusStr(hotList);
|
||||
fillInCityStr(hotList);
|
||||
if (CollectionUtil.isNotEmpty(hotList)) {
|
||||
for (DevInfoVo devInfoVo : hotList) {
|
||||
BmFileInfo bmFileInfo = new BmFileInfo();
|
||||
bmFileInfo.setModelId(devInfoVo.getMaId());
|
||||
bmFileInfo.setTaskType(17);
|
||||
List<BmFileInfo> fileList = bmFileInfoMapper.selectBmFileInfoList(bmFileInfo);
|
||||
devInfoVo.setBmFileInfoList(fileList);
|
||||
}
|
||||
}
|
||||
return hotList;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,114 @@
|
|||
<?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.material.device.mapper.BmFileInfoMapper">
|
||||
<resultMap type="com.bonus.common.biz.domain.BmFileInfo" id="BmFileInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="taskType" column="task_type" />
|
||||
<result property="taskId" column="task_id" />
|
||||
<result property="modelId" column="model_id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="url" column="url" />
|
||||
<result property="fileType" column="file_type" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBmFileInfoVo">
|
||||
select id, task_type, task_id, model_id, name, url, file_type, create_by, create_time from bm_file_info
|
||||
</sql>
|
||||
|
||||
<select id="selectBmFileInfoList" parameterType="com.bonus.common.biz.domain.BmFileInfo" resultMap="BmFileInfoResult">
|
||||
<include refid="selectBmFileInfoVo"/>
|
||||
<where>
|
||||
<if test="taskType != null "> and task_type = #{taskType}</if>
|
||||
<if test="taskId != null "> and task_id = #{taskId}</if>
|
||||
<if test="modelId != null "> and model_id = #{modelId}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="url != null and url != ''"> and url = #{url}</if>
|
||||
<if test="fileType != null "> and file_type = #{fileType}</if>
|
||||
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBmFileInfoById" parameterType="Long" resultMap="BmFileInfoResult">
|
||||
<include refid="selectBmFileInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBmFileInfo" parameterType="com.bonus.common.biz.domain.BmFileInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into bm_file_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="taskType != null">task_type,</if>
|
||||
<if test="taskId != null">task_id,</if>
|
||||
<if test="modelId != null">model_id,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="url != null">url,</if>
|
||||
<if test="fileType != null">file_type,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="taskType != null">#{taskType},</if>
|
||||
<if test="taskId != null">#{taskId},</if>
|
||||
<if test="modelId != null">#{modelId},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="url != null">#{url},</if>
|
||||
<if test="fileType != null">#{fileType},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertBmFileInfos" parameterType="com.bonus.common.biz.domain.BmFileInfo">
|
||||
INSERT INTO bm_file_info(task_type,task_id,model_id,name,url,file_type,create_by,create_time)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(#{item.taskType},
|
||||
#{item.taskId},
|
||||
#{item.modelId},
|
||||
#{item.name},
|
||||
#{item.url},
|
||||
#{item.fileType},
|
||||
#{item.createBy},
|
||||
#{item.createTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateBmFileInfo" parameterType="com.bonus.common.biz.domain.BmFileInfo">
|
||||
update bm_file_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="taskType != null">task_type = #{taskType},</if>
|
||||
<if test="taskId != null">task_id = #{taskId},</if>
|
||||
<if test="modelId != null">model_id = #{modelId},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="url != null">url = #{url},</if>
|
||||
<if test="fileType != null">file_type = #{fileType},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBmFileInfoById" parameterType="Long">
|
||||
delete from bm_file_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBmFileInfoByIds" parameterType="String">
|
||||
delete from bm_file_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBmFileInfoByBizInfo" parameterType="com.bonus.common.biz.domain.BmFileInfo">
|
||||
delete from bm_file_info
|
||||
<where>
|
||||
<if test="taskType != null "> and task_type = #{taskType}</if>
|
||||
<if test="taskId != null "> and task_id = #{taskId}</if>
|
||||
<if test="modelId != null "> and model_id = #{modelId}</if>
|
||||
<if test="fileType != null "> and file_type = #{fileType}</if>
|
||||
</where>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -128,19 +128,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="selectDevInfoHotList" parameterType="com.bonus.material.device.domain.vo.DevInfoVo" resultType="com.bonus.material.device.domain.vo.DevInfoVo">
|
||||
select d.*,t.type_name as device_name,t.parent_name as group_name,c.company_name,search_num
|
||||
from ma_dev_info d
|
||||
left join (select t.*, p.type_name as parent_name
|
||||
from ma_type_info t
|
||||
left join ma_type_info p on t.parent_id=p.type_id) t on d.type_id = t.type_id
|
||||
left join bm_company_info c on d.own_co = c.company_id
|
||||
left join ma_hot_search h on d.ma_id = h.ma_id
|
||||
left join ma_type_info ti on d.type_id = ti.type_id
|
||||
<where>
|
||||
SELECT
|
||||
d.ma_id as maId,
|
||||
d.code as code,
|
||||
d.device_name as deviceName,
|
||||
d.device_weight as deviceWeight,
|
||||
d.type_id as typeId,
|
||||
d.ma_status as maStatus,
|
||||
d.brand as brand,
|
||||
d.model_name as modelName,
|
||||
d.production_date as productionDate,
|
||||
d.working_hours as workingHours,
|
||||
d.serial_number as serialNumber,
|
||||
d.month_lease_price as monthLeasePrice,
|
||||
d.day_lease_price as dayLeasePrice,
|
||||
d.person as person,
|
||||
d.person_phone as personPhone,
|
||||
c.company_name as companyName,
|
||||
h.search_num as searchNum
|
||||
FROM
|
||||
ma_hot_search h
|
||||
LEFT JOIN ma_dev_info d ON d.ma_id = h.ma_id
|
||||
LEFT JOIN bm_company_info c ON d.own_co = c.company_id
|
||||
where
|
||||
d.is_active='1'
|
||||
<if test="maStatus != null and maStatus != ''"> and d.ma_status = #{maStatus}</if>
|
||||
</where>
|
||||
order by h.search_num
|
||||
and d.ma_status = '2'
|
||||
<if test="maId != null">
|
||||
and d.ma_id = #{maId}
|
||||
</if>
|
||||
order by h.search_num desc
|
||||
</select>
|
||||
|
||||
<select id="selectDevInfoByMaId" parameterType="Long" resultType="com.bonus.material.device.domain.vo.DevInfoVo">
|
||||
|
|
|
|||
Loading…
Reference in New Issue