物资装备代码合并

This commit is contained in:
syruan 2024-11-23 15:36:02 +08:00
parent 2be1e0098d
commit 8555949ed7
7 changed files with 153 additions and 52 deletions

View File

@ -58,7 +58,7 @@ public class DevInfoController extends BaseController {
* 查询商品列表--包含附件查询 * 查询商品列表--包含附件查询
*/ */
//@RequiresPermissions("equip:info:list") //@RequiresPermissions("equip:info:list")
@ApiOperation(value = "查询商品列表") @ApiOperation(value = "查询商品列表--附件列表")
@PostMapping("/devList") @PostMapping("/devList")
public TableDataInfo devList(@RequestBody DevInfoVo devInfo) { public TableDataInfo devList(@RequestBody DevInfoVo devInfo) {
startPage(); startPage();
@ -83,18 +83,6 @@ public class DevInfoController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
/**
* 导出设备信息列表
*/
// @RequiresPermissions("equip:info:export")
@ApiOperation(value = "导出装备信息")
@PostMapping("/export")
public void export(HttpServletResponse response, DevInfoVo devInfo) {
List<DevInfoVo> list = devInfoService.selectDevInfoList(devInfo);
ExcelUtil<DevInfoVo> util = new ExcelUtil<>(DevInfoVo.class);
util.exportExcel(response, list, "设备信息数据");
}
/** /**
* 获取设备信息详细信息 * 获取设备信息详细信息
*/ */
@ -165,6 +153,16 @@ public class DevInfoController extends BaseController {
return success(devInfoService.sumType()); return success(devInfoService.sumType());
} }
/**
* 导出设备信息列表
*/
// @RequiresPermissions("equip:info:export")
@ApiOperation(value = "导出装备信息")
@PostMapping("/export")
public void export(HttpServletResponse response, DevInfoVo devInfo) {
List<DevInfoVo> list = devInfoService.selectDevInfoList(devInfo);
ExcelUtil<DevInfoVo> util = new ExcelUtil<>(DevInfoVo.class);
util.exportExcel(response, list, "设备信息数据");
}
} }

View File

@ -10,6 +10,7 @@ import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -40,22 +41,27 @@ public class DevInfo extends BaseEntity {
@ApiModelProperty(value = "整机装备重量") @ApiModelProperty(value = "整机装备重量")
private String deviceWeight; private String deviceWeight;
@ApiModelProperty(value = "联系人") @ApiModelProperty(value = "单位")
private String person; private String unitName;
@ApiModelProperty(value = "联系电话")
private String personPhone;
/** 类型id */ /** 类型id */
@Excel(name = "类型id") @Excel(name = "类型id")
@ApiModelProperty(value = "类型id") @ApiModelProperty(value = "类型id")
private Long typeId; private Long typeId;
@ApiModelProperty(value = "装备类别")
private String typeName;
/** 设备状态(自有,待上架,上架,在租,下架)考虑数据字典 */ /** 设备状态(自有,待上架,上架,在租,下架)考虑数据字典 */
@Excel(name = "设备状态(自有,待上架,上架,在租,下架)考虑数据字典") @Excel(name = "设备状态(自有,待上架,上架,在租,下架)考虑数据字典")
@ApiModelProperty(value = "设备状态(自有,待上架,上架,在租,下架)考虑数据字典") @ApiModelProperty(value = "设备状态(自有,待上架,上架,在租,下架)考虑数据字典")
private String maStatus; private String maStatus;
/** 设备状态(自有,待上架,上架,在租,下架)考虑数据字典 */
@Excel(name = "设备状态(自有,待上架,上架,在租,下架)考虑数据字典")
@ApiModelProperty(value = "设备状态(自有,待上架,上架,在租,下架)考虑数据字典")
private String maStatusName;
/** 租赁范围 */ /** 租赁范围 */
@Excel(name = "租赁范围") @Excel(name = "租赁范围")
@ApiModelProperty(value = "租赁范围") @ApiModelProperty(value = "租赁范围")
@ -148,6 +154,12 @@ public class DevInfo extends BaseEntity {
@ApiModelProperty(value = "创建人") @ApiModelProperty(value = "创建人")
private Long creator; private Long creator;
@ApiModelProperty(value = "联系人")
private String person;
@ApiModelProperty(value = "联系人电话")
private String personPhone;
/** 设备规格 */ /** 设备规格 */
@Excel(name = "设备规格") @Excel(name = "设备规格")
@ApiModelProperty(value = "设备规格") @ApiModelProperty(value = "设备规格")
@ -168,6 +180,18 @@ public class DevInfo extends BaseEntity {
@ApiModelProperty(value = "是否删除") @ApiModelProperty(value = "是否删除")
private String isActive; private String isActive;
@ApiModelProperty(value = "主展示图")
private List<SysFileInfo> mainFileList = new ArrayList<>();
@ApiModelProperty(value = "详情页展示图")
private List<SysFileInfo> detailsFileList = new ArrayList<>();
@ApiModelProperty(value = "检测证明、检验pdf")
private List<SysFileInfo> examinationPdf = new ArrayList<>();
@ApiModelProperty(value = "合格证、保险pdf")
private List<SysFileInfo> insurancePdf = new ArrayList<>();
/**文件附件 后续废弃 用下面的*/ /**文件附件 后续废弃 用下面的*/
@ApiModelProperty(value = "文件附件") @ApiModelProperty(value = "文件附件")
private List<SysFileInfo> fileList; private List<SysFileInfo> fileList;
@ -178,4 +202,7 @@ public class DevInfo extends BaseEntity {
@ApiModelProperty(value = "城市") @ApiModelProperty(value = "城市")
private String city; private String city;
@ApiModelProperty(value = "公司Id")
private String companyId;
} }

View File

@ -1,11 +1,14 @@
package com.bonus.material.device.domain.vo; package com.bonus.material.device.domain.vo;
import com.bonus.common.biz.domain.SysFileInfo;
import com.bonus.material.device.domain.DevInfo; import com.bonus.material.device.domain.DevInfo;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import java.util.List;
/** /**
* @author syruan * @author syruan
*/ */
@ -15,21 +18,15 @@ import lombok.ToString;
public class DevInfoVo extends DevInfo { public class DevInfoVo extends DevInfo {
private Integer pageNum; private Integer pageNum;
private Integer pageSize; private Integer pageSize;
private long parentId; private long parentId;
private Long maId; private Long maId;
@ApiModelProperty(value = "装备类别")
private String typeName;
/* 装备组别 parent */
@ApiModelProperty(value = "装备组别") @ApiModelProperty(value = "装备组别")
private String groupName; private String groupName;
@ApiModelProperty(value = "装备名称")
private String deviceName;
@ApiModelProperty(value = "收藏id") @ApiModelProperty(value = "收藏id")
private int collectId; private int collectId;
@ -60,12 +57,10 @@ public class DevInfoVo extends DevInfo {
@ApiModelProperty(value = "搜索数量") @ApiModelProperty(value = "搜索数量")
private Long searchNum; private Long searchNum;
@ApiModelProperty(value = "检验pdf") @ApiModelProperty(value = "附件集合--只做返回用")
private String examinationPdf; private List<SysFileInfo> fileList;
@ApiModelProperty(value = "保险pdf")
private String insurancePdf;
/**上下架id*/
@ApiModelProperty(value = "上下架id") @ApiModelProperty(value = "上下架id")
private int upId; private int upId;
@ -117,6 +112,8 @@ public class DevInfoVo extends DevInfo {
@ApiModelProperty(value = "所属公司id") @ApiModelProperty(value = "所属公司id")
private String companyId; private String companyId;
/* 装备组别 parent */
@ApiModelProperty(value = "装备组别Id") @ApiModelProperty(value = "装备组别Id")
private String groupId; private String groupId;

View File

@ -34,7 +34,7 @@ public interface DevInfoMapper {
* @param maId 设备信息主键 * @param maId 设备信息主键
* @return 设备图片集 * @return 设备图片集
*/ */
List<SysFile> getFilesByMaId(Long maId); List<SysFileInfo> getFilesByMaId(Long maId);
Long getCompanyUpNum(Long ownCo); Long getCompanyUpNum(Long ownCo);
@ -87,8 +87,10 @@ public interface DevInfoMapper {
*/ */
int insertLon(InfoMotionDto infoMotionDto); int insertLon(InfoMotionDto infoMotionDto);
// TODO
List<SysDic> getSysDic(); List<SysDic> getSysDic();
// todo
SysDic getSysDicById(Integer id); SysDic getSysDicById(Integer id);
List<BaseAddress> getBaseAddress(); List<BaseAddress> getBaseAddress();

View File

@ -32,6 +32,17 @@ import java.util.stream.Collectors;
*/ */
@Service @Service
public class DevInfoServiceImpl implements DevInfoService { public class DevInfoServiceImpl implements DevInfoService {
// 装备主展示图片字典
private final Integer MAIN_IMAGES_DICT_VALUE = 0;
// 装备详情展示图片字典
private final Integer DETAILS_IMAGES_DICT_VALUE = 1;
// 检测证明PDF附件字典
private final Integer EXAMINATION_PDF = 2;
// 合格证PDF附件字典
private final Integer INSURANCE_PDF = 3;
@Resource @Resource
private DevInfoMapper devInfoMapper; private DevInfoMapper devInfoMapper;
@ -145,6 +156,7 @@ public class DevInfoServiceImpl implements DevInfoService {
List<BaseAddress> addressList = devInfoMapper.getBaseAddress(); List<BaseAddress> addressList = devInfoMapper.getBaseAddress();
for (DevInfoVo devInfoVo : list) { for (DevInfoVo devInfoVo : list) {
for (BaseAddress address : addressList) { for (BaseAddress address : addressList) {
if (devInfoVo.getCityId() == null || address.getCode() == null) { continue; }
if (devInfoVo.getCityId().equals(Integer.valueOf(address.getCode()))) { if (devInfoVo.getCityId().equals(Integer.valueOf(address.getCode()))) {
devInfoVo.setCityStr(address.getName()); devInfoVo.setCityStr(address.getName());
break; break;
@ -168,6 +180,7 @@ public class DevInfoServiceImpl implements DevInfoService {
//保存用户信息 //保存用户信息
devInfo.setCreator(userId); devInfo.setCreator(userId);
devInfo.setCode(String.valueOf(UUID.randomUUID())); devInfo.setCode(String.valueOf(UUID.randomUUID()));
devInfo.setMaStatus("3");
devInfoMapper.insertDevInfo(devInfo); devInfoMapper.insertDevInfo(devInfo);
//把文件保存到附件中 //把文件保存到附件中

View File

@ -2,7 +2,9 @@
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.material.device.mapper.DevInfoMapper"> <mapper namespace="com.bonus.material.device.mapper.DevInfoMapper">
<resultMap type="com.bonus.material.device.domain.vo.DevInfoVo" id="DevInfoResult"> <resultMap type="com.bonus.material.device.domain.vo.DevInfoVo" id="DevInfoResult">
<result property="maId" column="ma_id" /> <result property="maId" column="ma_id" />
<result property="code" column="code" /> <result property="code" column="code" />
@ -28,6 +30,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="ownCo" column="own_co" /> <result property="ownCo" column="own_co" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="creator" column="creator" /> <result property="creator" column="creator" />
<result property="person" column="person" />
<result property="personPhone" column="person_phone" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="specification" column="specification" /> <result property="specification" column="specification" />
@ -42,7 +46,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectDevInfoVo"> <sql id="selectDevInfoVo">
select ma_id, code, type_id, ma_status, lease_scope, location, province_id, city_id, area_id, brand, model_name, production_date, working_hours, serial_number, select ma_id, code, type_id, ma_status, lease_scope, location, province_id, city_id, area_id, brand, model_name, production_date, working_hours, serial_number,
month_lease_price, day_lease_price, pic_url, js_month_price, js_day_price, description, gps_code, own_co, create_time, month_lease_price, day_lease_price, pic_url, js_month_price, js_day_price, description, gps_code, own_co, create_time,
creator, update_time, update_by, specification, deposit, is_operator, is_active, update_time, update_by from ma_dev_info creator, update_time, person, person_phone, update_by, specification, deposit, is_operator, is_active, update_time, update_by
from ma_dev_info
</sql> </sql>
@ -227,16 +232,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
d.is_active='1' and d.ma_id = #{maId} d.is_active='1' and d.ma_id = #{maId}
</select> </select>
<select id="getFilesByMaId" parameterType="Long" resultType="com.bonus.common.biz.domain.SysFile"> <select id="getFilesByMaId" parameterType="Long" resultType="com.bonus.common.biz.domain.SysFileInfo">
SELECT s.dic_id, s.file_name as name,s.file_url as url SELECT s.dic_id, s.file_name,s.file_url
from ma_dev_info d from ma_dev_info d
left join sys_file_info s on d.ma_id = s.model_id left join sys_file_info s on d.ma_id = s.model_id
WHERE d.ma_id = #{maId} and d.is_active='1' and s.dic_id in (20,28,29) WHERE d.ma_id = #{maId} and d.is_active='1' and s.dic_id in (0,1,2,3)
</select> </select>
<select id="getCompanyUpNum" parameterType="Long" resultType="Long"> <select id="getCompanyUpNum" parameterType="Long" resultType="Long">
select count(d.ma_id) from ma_dev_info d select count(d.ma_id) from ma_dev_info d
where d.own_co= #{ownCo} and d.ma_status in(16,17) and d.is_active='1' where d.own_co= #{ownCo} and d.ma_status in(16,17) and d.is_active='1'
GROUP BY d.own_co GROUP BY d.own_co
</select> </select>
@ -245,6 +249,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into ma_dev_info insert into ma_dev_info
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="maId != null and maId != '' ">ma_id,</if> <if test="maId != null and maId != '' ">ma_id,</if>
<if test="deviceName != null and deviceName != '' ">device_name,</if>
<if test="deviceWeight != null and deviceWeight != '' ">device_weight,</if>
<if test="unitName != null and unitName != '' ">unit_name,</if>
<if test="code != null and code != '' ">code,</if> <if test="code != null and code != '' ">code,</if>
<if test="typeId != null and typeId != ''">type_id,</if> <if test="typeId != null and typeId != ''">type_id,</if>
<if test="maStatus != null and maStatus != ''">ma_status,</if> <if test="maStatus != null and maStatus != ''">ma_status,</if>
@ -263,12 +270,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="picUrl != null and picUrl != ''">pic_url,</if> <if test="picUrl != null and picUrl != ''">pic_url,</if>
<if test="jsMonthPrice != null and jsMonthPrice != ''">js_month_price,</if> <if test="jsMonthPrice != null and jsMonthPrice != ''">js_month_price,</if>
<if test="jsDayPrice != null and jsDayPrice != ''">js_day_price,</if> <if test="jsDayPrice != null and jsDayPrice != ''">js_day_price,</if>
<if test="description != null and description != ''">description,</if> <if test="description != null and description != ''">`description`,</if>
<if test="gpsCode != null and gpsCode != ''">gps_code,</if> <if test="gpsCode != null and gpsCode != ''">gps_code,</if>
<if test="ownCo != null and ownCo != ''">own_co,</if> <if test="ownCo != null and ownCo != ''">own_co,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="person != null and person != ''">person,</if>
<if test="personPhone != null and personPhone != ''">person_phone,</if>
create_time,
<if test="creator != null and creator != ''">creator,</if> <if test="creator != null and creator != ''">creator,</if>
<if test="updateTime != null">update_time,</if> update_time,
<if test="updateBy != null and updateBy != ''">update_by,</if> <if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="specification != null and specification != ''">specification,</if> <if test="specification != null and specification != ''">specification,</if>
<if test="deposit != null and deposit != ''">deposit,</if> <if test="deposit != null and deposit != ''">deposit,</if>
@ -279,6 +289,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="maId != null and maId != ''">#{maId},</if> <if test="maId != null and maId != ''">#{maId},</if>
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
<if test="deviceWeight != null and deviceWeight != ''">#{deviceWeight},</if>
<if test="unitName != null and unitName != ''">#{unitName},</if>
<if test="code != null and code != ''">#{code},</if> <if test="code != null and code != ''">#{code},</if>
<if test="typeId != null and typeId != ''">#{typeId},</if> <if test="typeId != null and typeId != ''">#{typeId},</if>
<if test="maStatus != null and maStatus != ''">#{maStatus},</if> <if test="maStatus != null and maStatus != ''">#{maStatus},</if>
@ -300,9 +313,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="description != null and description != ''">#{description},</if> <if test="description != null and description != ''">#{description},</if>
<if test="gpsCode != null and gpsCode != ''">#{gpsCode},</if> <if test="gpsCode != null and gpsCode != ''">#{gpsCode},</if>
<if test="ownCo != null and ownCo != ''">#{ownCo},</if> <if test="ownCo != null and ownCo != ''">#{ownCo},</if>
<if test="person != null and person != ''">#{person},</if>
<if test="personPhone != null and personPhone != ''">#{personPhone},</if>
now(), now(),
<if test="creator != null and creator != ''">#{creator},</if> <if test="creator != null and creator != ''">#{creator},</if>
<if test="updateTime != null and updateTime != ''">#{update_time},</if> now(),
<if test="updateBy != null and updateBy != ''">#{update_by},</if> <if test="updateBy != null and updateBy != ''">#{update_by},</if>
<if test="specification != null and specification != ''">#{specification},</if> <if test="specification != null and specification != ''">#{specification},</if>
<if test="deposit != null and deposit != ''">#{deposit},</if> <if test="deposit != null and deposit != ''">#{deposit},</if>
@ -331,6 +346,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update ma_dev_info update ma_dev_info
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="code != null">code = #{code},</if> <if test="code != null">code = #{code},</if>
<if test="deviceName != null">device_name = #{deviceName},</if>
<if test="deviceWeight != null">device_weight = #{deviceWeight},</if>
<if test="unitName != null">unit_name = #{unitName},</if>
<if test="typeId != null">type_id = #{typeId},</if> <if test="typeId != null">type_id = #{typeId},</if>
<if test="maStatus != null">ma_status = #{maStatus},</if> <if test="maStatus != null">ma_status = #{maStatus},</if>
<if test="leaseScope != null">lease_scope = #{leaseScope},</if> <if test="leaseScope != null">lease_scope = #{leaseScope},</if>
@ -348,9 +366,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="picUrl != null">pic_url = #{picUrl},</if> <if test="picUrl != null">pic_url = #{picUrl},</if>
<if test="jsMonthPrice != null">js_month_price = #{jsMonthPrice},</if> <if test="jsMonthPrice != null">js_month_price = #{jsMonthPrice},</if>
<if test="jsDayPrice != null">js_day_price = #{jsDayPrice},</if> <if test="jsDayPrice != null">js_day_price = #{jsDayPrice},</if>
<if test="description != null">description = #{description},</if> <if test="description != null">`description` = #{description},</if>
<if test="gpsCode != null">gps_code = #{gpsCode},</if> <if test="gpsCode != null">gps_code = #{gpsCode},</if>
<if test="ownCo != null">own_co = #{ownCo},</if> <if test="ownCo != null">own_co = #{ownCo},</if>
<if test="person != null">person = #{person},</if>
<if test="personPhone != null">person_phone = #{personPhone},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="creator != null">creator = #{creator},</if> <if test="creator != null">creator = #{creator},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
@ -377,7 +397,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<select id="selectUserCollectByUserId" parameterType="Long" resultType="com.bonus.common.biz.domain.UserCollect"> <select id="selectUserCollectByUserId" parameterType="Long" resultType="com.bonus.common.biz.domain.UserCollect">
select id, user_id, ma_id, time from ma_user_collect select id, user_id, ma_id, create_time from ma_user_collect
where user_id = #{userId} where user_id = #{userId}
</select> </select>
@ -399,33 +419,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getSysDic" resultType="com.bonus.common.biz.domain.SysDic"> <select id="getSysDic" resultType="com.bonus.common.biz.domain.SysDic">
select select
id,p_id,code,`name`,description,`value`,sort,`level`,status,create_time,creator dict_code AS id,p_id,code,`name`,description,`value`,sort,`level`,status,create_time,creator
from sys_dic from sys_dict_data
</select> </select>
<select id="getSysDicById" resultType="com.bonus.common.biz.domain.SysDic"> <select id="getSysDicById" resultType="com.bonus.common.biz.domain.SysDic">
select select
id,p_id,code,`name`,description,`value`,sort,`level`,status,create_time,creator id,p_id,code,`name`,description,`value`,sort,`level`,status,create_time,creator
from sys_dic from sys_dict_data
where id = #{id} where id = #{id}
</select> </select>
<select id="getBaseAddress" resultType="com.bonus.common.biz.domain.BaseAddress"> <select id="getBaseAddress" resultType="com.bonus.common.biz.domain.BaseAddress">
select id,name,code from base_address where status = 1 select id,name,code from base_address
</select> </select>
<select id="getBaseAddressById" resultType="String"> <select id="getBaseAddressById" resultType="String">
select name from base_address where status = 1 and id = #{id} select name from base_address where id = #{id}
</select> </select>
<select id="selectDevInfoLists" resultType="com.bonus.material.device.domain.vo.DevInfoVo"> <select id="selectDevInfoLists" 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,t.group_name as type_name,t.p_id as group_id,t.group_id as company_id select
d.*,t.type_name as device_name,t.parent_name as group_name,c.company_name,t.group_name as type_name,t.p_id as group_id,t.group_id as company_id
from ma_dev_info d from ma_dev_info d
left join (select t.*, p.type_name as parent_name, p.type_id as p_id,mt.type_name as group_name, mt.type_id as group_id left join (select
from ma_type t t.*, p.type_name as parent_name, p.type_id as p_id,mt.type_name as group_name, mt.type_id as group_id
left join ma_type p on t.parent_id=p.type_id from
left join ma_type mt on p.parent_id = mt.type_id ma_type t
left join
ma_type p on t.parent_id=p.type_id
left join
ma_type mt on p.parent_id = mt.type_id
) t on d.type_id = t.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 bm_company_info c on d.own_co = c.company_id
left join ma_up_off u on d.ma_id = u.ma_id ORDER BY d.create_time desc
</select> </select>

View File

@ -0,0 +1,38 @@
<?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.SysFileInfoMapper">
<select id="selectByMaId" resultType="com.bonus.common.biz.domain.SysFileInfo">
select * from sys_file_info where model_id = #{maId}
</select>
<!-- <select id="getBmCompanyInfo" resultType="com.bonus.zlpt.company.api.domain.BmCompanyInfo">-->
<!-- select * from bm_company_info where company_name = #{companyName}-->
<!-- </select>-->
<select id="getTypeInfo" resultType="com.bonus.common.biz.domain.TypeInfo">
select * from ma_type_info where type_name = #{deviceName}
</select>
<insert id="insertFileInfo" parameterType="com.bonus.common.biz.domain.SysFileInfo">
insert into sys_file_info (
<if test="modelId != null">model_id,</if>
<if test="fileName != null">file_name,</if>
<if test="fileUrl != null">file_url,</if>
<if test="dicId != null">dic_id,</if>
<if test="creator != null">creator,</if>
create_time
)values(
<if test="modelId != null">#{modelId},</if>
<if test="fileName != null">#{fileName},</if>
<if test="fileUrl != null">#{fileUrl},</if>
<if test="dicId != null">#{dicId},</if>
<if test="creator != null">#{creator},</if>
sysdate()
)
</insert>
</mapper>