bmfile 接口

This commit is contained in:
sxu 2024-12-30 13:59:48 +08:00
parent ebc6bbbd5c
commit f5b7581b24
13 changed files with 557 additions and 499 deletions

View File

@ -1,7 +1,7 @@
package com.bonus.common.biz.constant;
/**
* 仓储通用常量信息
* 智慧工地通用常量信息
*
* @author bonus
*/

View File

@ -1,123 +0,0 @@
package com.bonus.smartsite.basic.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.bonus.common.log.enums.OperaType;
import com.bonus.common.security.utils.SecurityUtils;
import com.bonus.smartsite.common.annotation.PreventRepeatSubmit;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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.bonus.common.log.annotation.SysLog;
import com.bonus.common.security.annotation.RequiresPermissions;
import com.bonus.smartsite.basic.domain.BmCompanyAddress;
import com.bonus.smartsite.basic.service.IBmCompanyAddressService;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.utils.poi.ExcelUtil;
import com.bonus.common.core.web.page.TableDataInfo;
/**
* 企业信息Controller
*
* @author xsheng
* @date 2024-12-16
*/
@Api(tags = "企业信息接口")
@RestController
@RequestMapping("/bm_company_address")
public class BmCompanyAddressController extends BaseController {
@Autowired
private IBmCompanyAddressService bmCompanyAddressService;
/**
* 查询企业信息列表
*/
@ApiOperation(value = "查询企业信息列表")
//@RequiresPermissions("basic:address:list")
@GetMapping("/list")
public TableDataInfo list(BmCompanyAddress bmCompanyAddress) {
startPage();
bmCompanyAddress.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
List<BmCompanyAddress> list = bmCompanyAddressService.selectBmCompanyAddressList(bmCompanyAddress);
return getDataTable(list);
}
/**
* 导出企业信息列表
*/
@ApiOperation(value = "导出企业信息列表")
@PreventRepeatSubmit
//@RequiresPermissions("basic:address:export")
@SysLog(title = "企业信息", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出企业信息")
@PostMapping("/export")
public void export(HttpServletResponse response, BmCompanyAddress bmCompanyAddress) {
List<BmCompanyAddress> list = bmCompanyAddressService.selectBmCompanyAddressList(bmCompanyAddress);
ExcelUtil<BmCompanyAddress> util = new ExcelUtil<BmCompanyAddress>(BmCompanyAddress.class);
util.exportExcel(response, list, "企业信息数据");
}
/**
* 获取企业信息详细信息
*/
@ApiOperation(value = "获取企业信息详细信息")
//@RequiresPermissions("basic:address:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(bmCompanyAddressService.selectBmCompanyAddressById(id));
}
/**
* 新增企业信息
*/
@ApiOperation(value = "新增企业信息")
@PreventRepeatSubmit
//@RequiresPermissions("basic:address:add")
@SysLog(title = "企业信息", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增企业信息")
@PostMapping
public AjaxResult add(@RequestBody BmCompanyAddress bmCompanyAddress) {
try {
bmCompanyAddress.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
return toAjax(bmCompanyAddressService.insertBmCompanyAddress(bmCompanyAddress));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
}
}
/**
* 修改企业信息
*/
@ApiOperation(value = "修改企业信息")
//@PreventRepeatSubmit
//@RequiresPermissions("basic:address:edit")
@SysLog(title = "企业信息", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改企业信息")
@PostMapping("/edit")
public AjaxResult edit(@RequestBody BmCompanyAddress bmCompanyAddress) {
try {
bmCompanyAddress.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
return toAjax(bmCompanyAddressService.updateBmCompanyAddress(bmCompanyAddress));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
}
}
/**
* 删除企业信息
*/
@ApiOperation(value = "删除企业信息")
@PreventRepeatSubmit
//@RequiresPermissions("basic:address:remove")
@SysLog(title = "企业信息", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除企业信息")
@PostMapping("/del/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(bmCompanyAddressService.deleteBmCompanyAddressByIds(ids));
}
}

View File

@ -0,0 +1,118 @@
package com.bonus.smartsite.basic.controller;
import com.bonus.common.core.utils.poi.ExcelUtil;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.common.log.annotation.SysLog;
import com.bonus.common.log.enums.OperaType;
import com.bonus.common.security.annotation.RequiresPermissions;
import com.bonus.smartsite.basic.domain.BmFileInfo;
import com.bonus.smartsite.basic.service.IBmFileInfoService;
import com.bonus.smartsite.common.annotation.PreventRepeatSubmit;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 附件
Controller
*
* @author xsheng
* @date 2024-09-27
*/
@Api(tags = "附件接口")
@RestController
@RequestMapping("/bm_file_info")
public class BmFileInfoController extends BaseController
{
@Autowired
private IBmFileInfoService bmFileInfoService;
/**
* 查询附件
列表
*/
@ApiOperation(value = "查询附件列表")
@RequiresPermissions("basic:file:manage")
@GetMapping("/list")
public TableDataInfo list(BmFileInfo bmFileInfo)
{
startPage();
List<BmFileInfo> list = bmFileInfoService.selectBmFileInfoList(bmFileInfo);
return getDataTable(list);
}
/**
* 导出附件
列表
*/
@ApiOperation(value = "导出附件列表")
@PreventRepeatSubmit
@RequiresPermissions("basic:file:manage")
@SysLog(title = "附件", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出附件")
@PostMapping("/export")
public void export(HttpServletResponse response, BmFileInfo bmFileInfo)
{
List<BmFileInfo> list = bmFileInfoService.selectBmFileInfoList(bmFileInfo);
ExcelUtil<BmFileInfo> util = new ExcelUtil<BmFileInfo>(BmFileInfo.class);
util.exportExcel(response, list, "附件数据");
}
/**
* 获取附件
详细信息
*/
@ApiOperation(value = "获取附件详细信息")
@RequiresPermissions("basic:file:manage")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(bmFileInfoService.selectBmFileInfoById(id));
}
/**
* 新增附件
*/
@ApiOperation(value = "新增附件")
@PreventRepeatSubmit
@RequiresPermissions("basic:file:manage")
@SysLog(title = "附件", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增附件")
@PostMapping
public AjaxResult add(@RequestBody BmFileInfo bmFileInfo)
{
return toAjax(bmFileInfoService.insertBmFileInfo(bmFileInfo));
}
/**
* 修改附件
*/
@ApiOperation(value = "修改附件")
@PreventRepeatSubmit
@RequiresPermissions("basic:file:manage")
@SysLog(title = "附件", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改附件")
@PutMapping
public AjaxResult edit(@RequestBody BmFileInfo bmFileInfo)
{
return toAjax(bmFileInfoService.updateBmFileInfo(bmFileInfo));
}
/**
* 删除附件
*/
@ApiOperation(value = "删除附件")
@PreventRepeatSubmit
@RequiresPermissions("basic:file:manage")
@SysLog(title = "附件", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除附件")
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(bmFileInfoService.deleteBmFileInfoByIds(ids));
}
}

View File

@ -1,66 +0,0 @@
package com.bonus.smartsite.basic.domain;
import com.bonus.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity;
/**
* 企业信息对象 bm_company_address
*
* @author xsheng
* @date 2024-12-16
*/
@Data
@ToString
public class BmCompanyAddress extends BaseEntity {
private static final long serialVersionUID = 1L;
/** id主键 */
private Long id;
/** dept_id */
@Excel(name = "dept_id")
@ApiModelProperty(value = "dept_id")
private Long companyId;
/** 需求所在省code */
@Excel(name = "需求所在省code")
@ApiModelProperty(value = "需求所在省code")
private Long provinceCode;
/** 需求所在省名称 */
@Excel(name = "需求所在省名称")
@ApiModelProperty(value = "需求所在省名称")
private String provinceName;
/** 需求所在市code */
@Excel(name = "需求所在市code")
@ApiModelProperty(value = "需求所在市code")
private Long cityCode;
/** 需求所在市名称 */
@Excel(name = "需求所在市名称")
@ApiModelProperty(value = "需求所在市名称")
private String cityName;
/** 需求所在区code */
@Excel(name = "需求所在区code")
@ApiModelProperty(value = "需求所在区code")
private Long areaCode;
/** 需求所在区名称 */
@Excel(name = "需求所在区名称")
@ApiModelProperty(value = "需求所在区名称")
private String areaName;
/** 企业名称 */
@Excel(name = "企业名称")
@ApiModelProperty(value = "企业名称")
private String address;
}

View File

@ -0,0 +1,57 @@
package com.bonus.smartsite.basic.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;
}

View File

@ -1,60 +0,0 @@
package com.bonus.smartsite.basic.mapper;
import java.util.List;
import com.bonus.smartsite.basic.domain.BmCompanyAddress;
/**
* 企业信息Mapper接口
*
* @author xsheng
* @date 2024-12-16
*/
public interface BmCompanyAddressMapper {
/**
* 查询企业信息
*
* @param id 企业信息主键
* @return 企业信息
*/
public BmCompanyAddress selectBmCompanyAddressById(Long id);
/**
* 查询企业信息列表
*
* @param bmCompanyAddress 企业信息
* @return 企业信息集合
*/
public List<BmCompanyAddress> selectBmCompanyAddressList(BmCompanyAddress bmCompanyAddress);
/**
* 新增企业信息
*
* @param bmCompanyAddress 企业信息
* @return 结果
*/
public int insertBmCompanyAddress(BmCompanyAddress bmCompanyAddress);
/**
* 修改企业信息
*
* @param bmCompanyAddress 企业信息
* @return 结果
*/
public int updateBmCompanyAddress(BmCompanyAddress bmCompanyAddress);
/**
* 删除企业信息
*
* @param id 企业信息主键
* @return 结果
*/
public int deleteBmCompanyAddressById(Long id);
/**
* 批量删除企业信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteBmCompanyAddressByIds(Long[] ids);
}

View File

@ -0,0 +1,72 @@
package com.bonus.smartsite.basic.mapper;
import com.bonus.smartsite.basic.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);
}

View File

@ -1,60 +0,0 @@
package com.bonus.smartsite.basic.service;
import java.util.List;
import com.bonus.smartsite.basic.domain.BmCompanyAddress;
/**
* 企业信息Service接口
*
* @author xsheng
* @date 2024-12-16
*/
public interface IBmCompanyAddressService {
/**
* 查询企业信息
*
* @param id 企业信息主键
* @return 企业信息
*/
public BmCompanyAddress selectBmCompanyAddressById(Long id);
/**
* 查询企业信息列表
*
* @param bmCompanyAddress 企业信息
* @return 企业信息集合
*/
public List<BmCompanyAddress> selectBmCompanyAddressList(BmCompanyAddress bmCompanyAddress);
/**
* 新增企业信息
*
* @param bmCompanyAddress 企业信息
* @return 结果
*/
public int insertBmCompanyAddress(BmCompanyAddress bmCompanyAddress);
/**
* 修改企业信息
*
* @param bmCompanyAddress 企业信息
* @return 结果
*/
public int updateBmCompanyAddress(BmCompanyAddress bmCompanyAddress);
/**
* 批量删除企业信息
*
* @param ids 需要删除的企业信息主键集合
* @return 结果
*/
public int deleteBmCompanyAddressByIds(Long[] ids);
/**
* 删除企业信息信息
*
* @param id 企业信息主键
* @return 结果
*/
public int deleteBmCompanyAddressById(Long id);
}

View File

@ -0,0 +1,78 @@
package com.bonus.smartsite.basic.service;
import com.bonus.smartsite.basic.domain.BmFileInfo;
import java.util.List;
/**
* 附件
Service接口
*
* @author xsheng
* @date 2024-09-26
*/
public interface IBmFileInfoService
{
/**
* 查询附件
*
* @param id 附件
主键
* @return 附件
*/
public BmFileInfo selectBmFileInfoById(Long id);
/**
* 查询附件
列表
*
* @param bmFileInfo 附件
* @return 附件
集合
*/
public List<BmFileInfo> selectBmFileInfoList(BmFileInfo bmFileInfo);
/**
* 新增附件
*
* @param bmFileInfo 附件
* @return 结果
*/
public int insertBmFileInfo(BmFileInfo bmFileInfo);
public int insertBmFileInfos(List<BmFileInfo> bmFileInfos);
/**
* 修改附件
*
* @param bmFileInfo 附件
* @return 结果
*/
public int updateBmFileInfo(BmFileInfo bmFileInfo);
/**
* 批量删除附件
*
* @param ids 需要删除的附件
主键集合
* @return 结果
*/
public int deleteBmFileInfoByIds(Long[] ids);
/**
* 删除附件
信息
*
* @param id 附件
主键
* @return 结果
*/
public int deleteBmFileInfoById(Long id);
}

View File

@ -1,98 +0,0 @@
package com.bonus.smartsite.basic.service.impl;
import java.util.List;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bonus.smartsite.basic.mapper.BmCompanyAddressMapper;
import com.bonus.smartsite.basic.domain.BmCompanyAddress;
import com.bonus.smartsite.basic.service.IBmCompanyAddressService;
/**
* 企业信息Service业务层处理
*
* @author xsheng
* @date 2024-12-16
*/
@Service
public class BmCompanyAddressServiceImpl implements IBmCompanyAddressService {
@Autowired
private BmCompanyAddressMapper bmCompanyAddressMapper;
/**
* 查询企业信息
*
* @param id 企业信息主键
* @return 企业信息
*/
@Override
public BmCompanyAddress selectBmCompanyAddressById(Long id) {
return bmCompanyAddressMapper.selectBmCompanyAddressById(id);
}
/**
* 查询企业信息列表
*
* @param bmCompanyAddress 企业信息
* @return 企业信息
*/
@Override
public List<BmCompanyAddress> selectBmCompanyAddressList(BmCompanyAddress bmCompanyAddress) {
return bmCompanyAddressMapper.selectBmCompanyAddressList(bmCompanyAddress);
}
/**
* 新增企业信息
*
* @param bmCompanyAddress 企业信息
* @return 结果
*/
@Override
public int insertBmCompanyAddress(BmCompanyAddress bmCompanyAddress) {
bmCompanyAddress.setCreateTime(DateUtils.getNowDate());
try {
return bmCompanyAddressMapper.insertBmCompanyAddress(bmCompanyAddress);
} catch (Exception e) {
throw new ServiceException("错误信息描述");
}
}
/**
* 修改企业信息
*
* @param bmCompanyAddress 企业信息
* @return 结果
*/
@Override
public int updateBmCompanyAddress(BmCompanyAddress bmCompanyAddress) {
bmCompanyAddress.setUpdateTime(DateUtils.getNowDate());
try {
return bmCompanyAddressMapper.updateBmCompanyAddress(bmCompanyAddress);
} catch (Exception e) {
throw new ServiceException("错误信息描述");
}
}
/**
* 批量删除企业信息
*
* @param ids 需要删除的企业信息主键
* @return 结果
*/
@Override
public int deleteBmCompanyAddressByIds(Long[] ids) {
return bmCompanyAddressMapper.deleteBmCompanyAddressByIds(ids);
}
/**
* 删除企业信息信息
*
* @param id 企业信息主键
* @return 结果
*/
@Override
public int deleteBmCompanyAddressById(Long id) {
return bmCompanyAddressMapper.deleteBmCompanyAddressById(id);
}
}

View File

@ -0,0 +1,117 @@
package com.bonus.smartsite.basic.service.impl;
import com.bonus.common.core.utils.DateUtils;
import com.bonus.smartsite.basic.domain.BmFileInfo;
import com.bonus.smartsite.basic.mapper.BmFileInfoMapper;
import com.bonus.smartsite.basic.service.IBmFileInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 附件
Service业务层处理
*
* @author xsheng
* @date 2024-09-26
*/
@Service
public class BmFileInfoServiceImpl implements IBmFileInfoService
{
@Autowired
private BmFileInfoMapper bmFileInfoMapper;
/**
* 查询附件
*
* @param id 附件
主键
* @return 附件
*/
@Override
public BmFileInfo selectBmFileInfoById(Long id)
{
return bmFileInfoMapper.selectBmFileInfoById(id);
}
/**
* 查询附件
列表
*
* @param bmFileInfo 附件
* @return 附件
*/
@Override
public List<BmFileInfo> selectBmFileInfoList(BmFileInfo bmFileInfo)
{
return bmFileInfoMapper.selectBmFileInfoList(bmFileInfo);
}
/**
* 新增附件
*
* @param bmFileInfo 附件
* @return 结果
*/
@Override
public int insertBmFileInfo(BmFileInfo bmFileInfo)
{
bmFileInfo.setCreateTime(DateUtils.getNowDate());
return bmFileInfoMapper.insertBmFileInfo(bmFileInfo);
}
@Override
public int insertBmFileInfos(List<BmFileInfo> bmFileInfos)
{
bmFileInfos.stream().forEach(o -> o.setCreateTime(DateUtils.getNowDate()));
return bmFileInfoMapper.insertBmFileInfos(bmFileInfos);
}
/**
* 修改附件
*
* @param bmFileInfo 附件
* @return 结果
*/
@Override
public int updateBmFileInfo(BmFileInfo bmFileInfo)
{
return bmFileInfoMapper.updateBmFileInfo(bmFileInfo);
}
/**
* 批量删除附件
*
* @param ids 需要删除的附件
主键
* @return 结果
*/
@Override
public int deleteBmFileInfoByIds(Long[] ids)
{
return bmFileInfoMapper.deleteBmFileInfoByIds(ids);
}
/**
* 删除附件
信息
*
* @param id 附件
主键
* @return 结果
*/
@Override
public int deleteBmFileInfoById(Long id)
{
return bmFileInfoMapper.deleteBmFileInfoById(id);
}
}

View File

@ -1,91 +0,0 @@
<?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.smartsite.basic.mapper.BmCompanyAddressMapper">
<resultMap type="com.bonus.smartsite.basic.domain.BmCompanyAddress" id="BmCompanyAddressResult">
<result property="id" column="id" />
<result property="companyId" column="company_id" />
<result property="provinceCode" column="province_code" />
<result property="provinceName" column="province_name" />
<result property="cityCode" column="city_code" />
<result property="cityName" column="city_name" />
<result property="areaCode" column="area_code" />
<result property="areaName" column="area_name" />
<result property="address" column="address" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectBmCompanyAddressVo">
select bca.id, bca.company_id, bca.province_code, bca.city_code, bca.area_code, bca.address, bca.create_time, bca.update_time,
b.name as area_name, b1.name as province_name, b2.name as city_name
from bm_company_address bca
LEFT JOIN base_address b ON b.code = bca.area_code
LEFT JOIN base_address b1 on bca.province_code = b1.code
LEFT JOIN base_address b2 on bca.city_code = b2.code
</sql>
<select id="selectBmCompanyAddressList" parameterType="com.bonus.smartsite.basic.domain.BmCompanyAddress" resultMap="BmCompanyAddressResult">
<include refid="selectBmCompanyAddressVo"/>
<where>
<if test="companyId != null "> and bca.company_id = #{companyId}</if>
<if test="provinceCode != null "> and bca.province_code = #{provinceCode}</if>
<if test="cityCode != null "> and bca.city_code = #{cityCode}</if>
<if test="areaCode != null "> and bca.area_code = #{areaCode}</if>
<if test="address != null and address != ''"> and bca.address = #{address}</if>
</where>
</select>
<select id="selectBmCompanyAddressById" parameterType="Long" resultMap="BmCompanyAddressResult">
<include refid="selectBmCompanyAddressVo"/>
where bca.id = #{id}
</select>
<insert id="insertBmCompanyAddress" parameterType="com.bonus.smartsite.basic.domain.BmCompanyAddress" useGeneratedKeys="true" keyProperty="id">
insert into bm_company_address
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="companyId != null">company_id,</if>
<if test="provinceCode != null">province_code,</if>
<if test="cityCode != null">city_code,</if>
<if test="areaCode != null">area_code,</if>
<if test="address != null">address,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="companyId != null">#{companyId},</if>
<if test="provinceCode != null">#{provinceCode},</if>
<if test="cityCode != null">#{cityCode},</if>
<if test="areaCode != null">#{areaCode},</if>
<if test="address != null">#{address},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateBmCompanyAddress" parameterType="com.bonus.smartsite.basic.domain.BmCompanyAddress">
update bm_company_address
<trim prefix="SET" suffixOverrides=",">
<if test="companyId != null">company_id = #{companyId},</if>
<if test="provinceCode != null">province_code = #{provinceCode},</if>
<if test="cityCode != null">city_code = #{cityCode},</if>
<if test="areaCode != null">area_code = #{areaCode},</if>
<if test="address != null">address = #{address},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBmCompanyAddressById" parameterType="Long">
delete from bm_company_address where id = #{id}
</delete>
<delete id="deleteBmCompanyAddressByIds" parameterType="String">
delete from bm_company_address where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -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.smartsite.basic.mapper.BmFileInfoMapper">
<resultMap type="com.bonus.smartsite.basic.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.smartsite.basic.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.smartsite.basic.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.smartsite.basic.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.smartsite.basic.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.smartsite.basic.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>