10 changed files with 782 additions and 4 deletions
@ -0,0 +1,195 @@ |
|||||
|
package com.epmet.plugin.power.dto.rent; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* 房屋信息 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-05-11 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RentHouseDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 房屋主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 客户id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 小区id |
||||
|
*/ |
||||
|
private String neighborHoodId; |
||||
|
|
||||
|
/** |
||||
|
* 片区id,neighbor_hood_part.id,可为空。 |
||||
|
*/ |
||||
|
private String partId; |
||||
|
|
||||
|
/** |
||||
|
* 所属楼栋id |
||||
|
*/ |
||||
|
private String buildingId; |
||||
|
|
||||
|
/** |
||||
|
* 所属单元id |
||||
|
*/ |
||||
|
private String buildingUnitId; |
||||
|
|
||||
|
/** |
||||
|
* 房屋名字后台插入时生成 |
||||
|
*/ |
||||
|
private String houseName; |
||||
|
|
||||
|
/** |
||||
|
* 门牌号 |
||||
|
*/ |
||||
|
private String doorName; |
||||
|
|
||||
|
/** |
||||
|
* 房屋类型,1楼房,2平房,3别墅 |
||||
|
*/ |
||||
|
private String houseType; |
||||
|
|
||||
|
/** |
||||
|
* 存储字典value |
||||
|
*/ |
||||
|
private String purpose; |
||||
|
|
||||
|
/** |
||||
|
* 1:出租 0:自住 2:闲置 |
||||
|
*/ |
||||
|
private Integer rentFlag; |
||||
|
|
||||
|
/** |
||||
|
* 房主姓名 |
||||
|
*/ |
||||
|
private String ownerName; |
||||
|
|
||||
|
/** |
||||
|
* 房主电话 |
||||
|
*/ |
||||
|
private String ownerPhone; |
||||
|
|
||||
|
/** |
||||
|
* 房主身份证号 |
||||
|
*/ |
||||
|
private String ownerIdCard; |
||||
|
|
||||
|
/** |
||||
|
* 排序 |
||||
|
*/ |
||||
|
private BigDecimal sort; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识 0未删除、1已删除 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
/** |
||||
|
* 社区ID |
||||
|
*/ |
||||
|
private String communityId; |
||||
|
|
||||
|
/** |
||||
|
* 社区 |
||||
|
*/ |
||||
|
private String communityName; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 网格 |
||||
|
*/ |
||||
|
private String gridName; |
||||
|
|
||||
|
/** |
||||
|
* 房屋小区ID |
||||
|
*/ |
||||
|
private String villageId; |
||||
|
|
||||
|
/** |
||||
|
* 房屋小区 |
||||
|
*/ |
||||
|
private String villageName; |
||||
|
|
||||
|
/** |
||||
|
* 楼号ID |
||||
|
*/ |
||||
|
private String buildId; |
||||
|
|
||||
|
/** |
||||
|
* 楼号 |
||||
|
*/ |
||||
|
private String buildName; |
||||
|
|
||||
|
/** |
||||
|
* 单元ID |
||||
|
*/ |
||||
|
private String unitId; |
||||
|
|
||||
|
/** |
||||
|
* 单元 |
||||
|
*/ |
||||
|
private String unitName; |
||||
|
|
||||
|
/** |
||||
|
* 房屋ID |
||||
|
*/ |
||||
|
private String homeId; |
||||
|
|
||||
|
/** |
||||
|
* 房屋 |
||||
|
*/ |
||||
|
private String homeName; |
||||
|
|
||||
|
/** |
||||
|
* 购房日期 |
||||
|
*/ |
||||
|
private String purchaseDate; |
||||
|
|
||||
|
/** |
||||
|
* 是否更新 |
||||
|
*/ |
||||
|
private Boolean needUpdate; |
||||
|
|
||||
|
} |
@ -0,0 +1,82 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.ExcelUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.AssertUtils; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.commons.tools.validator.group.AddGroup; |
||||
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.epmet.plugin.power.dto.rent.RentHouseDTO; |
||||
|
import com.epmet.plugin.power.modules.rent.excel.RentHouseExcel; |
||||
|
import com.epmet.plugin.power.modules.rent.service.RentHouseService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 房屋信息 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-05-11 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("rentHouse") |
||||
|
public class RentHouseController { |
||||
|
|
||||
|
@Autowired |
||||
|
private RentHouseService rentHouseService; |
||||
|
|
||||
|
@RequestMapping("page") |
||||
|
public Result<PageData<RentHouseDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<RentHouseDTO> page = rentHouseService.page(params); |
||||
|
return new Result<PageData<RentHouseDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) |
||||
|
public Result<RentHouseDTO> get(@PathVariable("id") String id){ |
||||
|
RentHouseDTO data = rentHouseService.get(id); |
||||
|
return new Result<RentHouseDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping("save") |
||||
|
public Result save(@RequestBody RentHouseDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
rentHouseService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping("update") |
||||
|
public Result update(@RequestBody RentHouseDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
rentHouseService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE}) |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
rentHouseService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<RentHouseDTO> list = rentHouseService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, RentHouseExcel.class); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.plugin.power.modules.rent.entity.RentHouseEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* 房屋信息 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-05-11 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface RentHouseDao extends BaseDao<RentHouseEntity> { |
||||
|
|
||||
|
} |
@ -0,0 +1,160 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 房屋信息 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-05-11 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("pli_rent_house") |
||||
|
public class RentHouseEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 小区id |
||||
|
*/ |
||||
|
private String neighborHoodId; |
||||
|
|
||||
|
/** |
||||
|
* 片区id,neighbor_hood_part.id,可为空。 |
||||
|
*/ |
||||
|
private String partId; |
||||
|
|
||||
|
/** |
||||
|
* 所属楼栋id |
||||
|
*/ |
||||
|
private String buildingId; |
||||
|
|
||||
|
/** |
||||
|
* 所属单元id |
||||
|
*/ |
||||
|
private String buildingUnitId; |
||||
|
|
||||
|
/** |
||||
|
* 房屋名字后台插入时生成 |
||||
|
*/ |
||||
|
private String houseName; |
||||
|
|
||||
|
/** |
||||
|
* 门牌号 |
||||
|
*/ |
||||
|
private String doorName; |
||||
|
|
||||
|
/** |
||||
|
* 房屋类型,1楼房,2平房,3别墅 |
||||
|
*/ |
||||
|
private String houseType; |
||||
|
|
||||
|
/** |
||||
|
* 存储字典value |
||||
|
*/ |
||||
|
private String purpose; |
||||
|
|
||||
|
/** |
||||
|
* 1:出租 0:自住 2:闲置 |
||||
|
*/ |
||||
|
private Integer rentFlag; |
||||
|
|
||||
|
/** |
||||
|
* 房主姓名 |
||||
|
*/ |
||||
|
private String ownerName; |
||||
|
|
||||
|
/** |
||||
|
* 房主电话 |
||||
|
*/ |
||||
|
private String ownerPhone; |
||||
|
|
||||
|
/** |
||||
|
* 房主身份证号 |
||||
|
*/ |
||||
|
private String ownerIdCard; |
||||
|
|
||||
|
/** |
||||
|
* 排序 |
||||
|
*/ |
||||
|
private BigDecimal sort; |
||||
|
|
||||
|
/** |
||||
|
* 社区ID |
||||
|
*/ |
||||
|
private String communityId; |
||||
|
|
||||
|
/** |
||||
|
* 社区 |
||||
|
*/ |
||||
|
private String communityName; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 网格 |
||||
|
*/ |
||||
|
private String gridName; |
||||
|
|
||||
|
/** |
||||
|
* 房屋小区ID |
||||
|
*/ |
||||
|
private String villageId; |
||||
|
|
||||
|
/** |
||||
|
* 房屋小区 |
||||
|
*/ |
||||
|
private String villageName; |
||||
|
|
||||
|
/** |
||||
|
* 楼号ID |
||||
|
*/ |
||||
|
private String buildId; |
||||
|
|
||||
|
/** |
||||
|
* 楼号 |
||||
|
*/ |
||||
|
private String buildName; |
||||
|
|
||||
|
/** |
||||
|
* 单元ID |
||||
|
*/ |
||||
|
private String unitId; |
||||
|
|
||||
|
/** |
||||
|
* 单元 |
||||
|
*/ |
||||
|
private String unitName; |
||||
|
|
||||
|
/** |
||||
|
* 房屋ID |
||||
|
*/ |
||||
|
private String homeId; |
||||
|
|
||||
|
/** |
||||
|
* 房屋 |
||||
|
*/ |
||||
|
private String homeName; |
||||
|
|
||||
|
/** |
||||
|
* 购房日期 |
||||
|
*/ |
||||
|
private String purchaseDate; |
||||
|
|
||||
|
} |
@ -0,0 +1,45 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* 房屋信息 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-05-11 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RentHouseExcel { |
||||
|
|
||||
|
@Excel(name = "所属小区") |
||||
|
private String villageName; |
||||
|
|
||||
|
@Excel(name = "所属楼栋") |
||||
|
private String buildName; |
||||
|
|
||||
|
@Excel(name = "单元号") |
||||
|
private String unitName; |
||||
|
|
||||
|
@Excel(name = "门牌号") |
||||
|
private String homeName; |
||||
|
|
||||
|
@Excel(name = "类型", replace = {"楼房_1", "平房_2", "别墅_3"}) |
||||
|
private String houseType; |
||||
|
|
||||
|
@Excel(name = "用途", replace = {"住宅_1", "商业_2", "办公_3", "工业_4", "仓储_5", "商住混用_6", "其他_7"}) |
||||
|
private String purpose; |
||||
|
|
||||
|
@Excel(name = "房屋状态", replace = {"出租_1", "闲置_2", "自住_0"}) |
||||
|
private Integer rentFlag; |
||||
|
|
||||
|
@Excel(name = "房主姓名") |
||||
|
private String ownerName; |
||||
|
|
||||
|
@Excel(name = "房主电话") |
||||
|
private String ownerPhone; |
||||
|
|
||||
|
@Excel(name = "房主身份证") |
||||
|
private String ownerIdCard; |
||||
|
|
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.redis; |
||||
|
|
||||
|
import com.epmet.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 房屋信息 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-05-11 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class RentHouseRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,78 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.service; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.plugin.power.dto.rent.RentHouseDTO; |
||||
|
import com.epmet.plugin.power.modules.rent.entity.RentHouseEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 房屋信息 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-05-11 |
||||
|
*/ |
||||
|
public interface RentHouseService extends BaseService<RentHouseEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<RentHouseDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-05-11 |
||||
|
*/ |
||||
|
PageData<RentHouseDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<RentHouseDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-05-11 |
||||
|
*/ |
||||
|
List<RentHouseDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return RentHouseDTO |
||||
|
* @author generator |
||||
|
* @date 2022-05-11 |
||||
|
*/ |
||||
|
RentHouseDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-05-11 |
||||
|
*/ |
||||
|
void save(RentHouseDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-05-11 |
||||
|
*/ |
||||
|
void update(RentHouseDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-05-11 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
} |
@ -0,0 +1,120 @@ |
|||||
|
package com.epmet.plugin.power.modules.rent.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.constant.FieldConstant; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.dto.form.IcHouseAddFormDTO; |
||||
|
import com.epmet.feign.GovOrgOpenFeignClient; |
||||
|
import com.epmet.plugin.power.dto.rent.RentHouseDTO; |
||||
|
import com.epmet.plugin.power.modules.rent.dao.RentHouseDao; |
||||
|
import com.epmet.plugin.power.modules.rent.entity.RentHouseEntity; |
||||
|
import com.epmet.plugin.power.modules.rent.redis.RentHouseRedis; |
||||
|
import com.epmet.plugin.power.modules.rent.service.RentHouseService; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.Arrays; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 房屋信息 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-05-11 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class RentHouseServiceImpl extends BaseServiceImpl<RentHouseDao, RentHouseEntity> implements RentHouseService { |
||||
|
|
||||
|
@Autowired |
||||
|
private RentHouseRedis rentHouseRedis; |
||||
|
|
||||
|
@Autowired |
||||
|
private GovOrgOpenFeignClient govOrgOpenFeignClient; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<RentHouseDTO> page(Map<String, Object> params) { |
||||
|
IPage<RentHouseEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, RentHouseDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<RentHouseDTO> list(Map<String, Object> params) { |
||||
|
List<RentHouseEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, RentHouseDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<RentHouseEntity> getWrapper(Map<String, Object> params) { |
||||
|
String id = (String) params.get(FieldConstant.ID_HUMP); |
||||
|
String gridId = (String) params.get("gridId"); |
||||
|
String villageId = (String) params.get("villageId"); |
||||
|
String buildId = (String) params.get("buildId"); |
||||
|
String unitId = (String) params.get("unitId"); |
||||
|
String homeId = (String) params.get("homeId"); |
||||
|
String ownerName = (String) params.get("ownerName"); |
||||
|
String ownerPhone = (String) params.get("ownerPhone"); |
||||
|
String ownerIdCard = (String) params.get("ownerIdCard"); |
||||
|
String rentFlag = (String) params.get("rentFlag"); |
||||
|
String startTime = (String) params.get("startTime"); |
||||
|
String endTime = (String) params.get("endTime"); |
||||
|
|
||||
|
QueryWrapper<RentHouseEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
wrapper.eq(StringUtils.isNotBlank(gridId), "GRID_ID", gridId); |
||||
|
wrapper.eq(StringUtils.isNotBlank(villageId), "VILLAGE_ID", villageId); |
||||
|
wrapper.eq(StringUtils.isNotBlank(buildId), "BUILD_ID", buildId); |
||||
|
wrapper.eq(StringUtils.isNotBlank(unitId), "UNIT_ID", unitId); |
||||
|
wrapper.eq(StringUtils.isNotBlank(homeId), "HOME_ID", homeId); |
||||
|
wrapper.eq(StringUtils.isNotBlank(ownerName), "OWNER_NAME", ownerName); |
||||
|
wrapper.eq(StringUtils.isNotBlank(ownerPhone), "OWNER_PHONE", ownerPhone); |
||||
|
wrapper.eq(StringUtils.isNotBlank(ownerIdCard), "OWNER_ID_CARD", ownerIdCard); |
||||
|
wrapper.eq(StringUtils.isNotBlank(rentFlag), "RENT_FLAG", rentFlag); |
||||
|
wrapper.ge(StringUtils.isNotBlank(startTime), "PURCHASE_DATE", startTime); |
||||
|
wrapper.le(StringUtils.isNotBlank(endTime), "PURCHASE_DATE", endTime); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RentHouseDTO get(String id) { |
||||
|
RentHouseEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, RentHouseDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(RentHouseDTO dto) { |
||||
|
RentHouseEntity entity = ConvertUtils.sourceToTarget(dto, RentHouseEntity.class); |
||||
|
insert(entity); |
||||
|
|
||||
|
// 更新房屋的租赁状态
|
||||
|
if (dto.getNeedUpdate()) { |
||||
|
IcHouseAddFormDTO formDTO = ConvertUtils.sourceToTarget(dto, IcHouseAddFormDTO.class); |
||||
|
govOrgOpenFeignClient.houseUpdate(formDTO); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(RentHouseDTO dto) { |
||||
|
RentHouseEntity entity = ConvertUtils.sourceToTarget(dto, RentHouseEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,44 @@ |
|||||
|
<?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.epmet.plugin.power.modules.rent.dao.RentHouseDao"> |
||||
|
|
||||
|
<resultMap type="com.epmet.plugin.power.modules.rent.entity.RentHouseEntity" id="rentHouseMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="customerId" column="CUSTOMER_ID"/> |
||||
|
<result property="neighborHoodId" column="NEIGHBOR_HOOD_ID"/> |
||||
|
<result property="partId" column="PART_ID"/> |
||||
|
<result property="buildingId" column="BUILDING_ID"/> |
||||
|
<result property="buildingUnitId" column="BUILDING_UNIT_ID"/> |
||||
|
<result property="houseName" column="HOUSE_NAME"/> |
||||
|
<result property="doorName" column="DOOR_NAME"/> |
||||
|
<result property="houseType" column="HOUSE_TYPE"/> |
||||
|
<result property="purpose" column="PURPOSE"/> |
||||
|
<result property="rentFlag" column="RENT_FLAG"/> |
||||
|
<result property="ownerName" column="OWNER_NAME"/> |
||||
|
<result property="ownerPhone" column="OWNER_PHONE"/> |
||||
|
<result property="ownerIdCard" column="OWNER_ID_CARD"/> |
||||
|
<result property="sort" column="SORT"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<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="communityId" column="COMMUNITY_ID"/> |
||||
|
<result property="communityName" column="COMMUNITY_NAME"/> |
||||
|
<result property="gridId" column="GRID_ID"/> |
||||
|
<result property="gridName" column="GRID_NAME"/> |
||||
|
<result property="villageId" column="VILLAGE_ID"/> |
||||
|
<result property="villageName" column="VILLAGE_NAME"/> |
||||
|
<result property="buildId" column="BUILD_ID"/> |
||||
|
<result property="buildName" column="BUILD_NAME"/> |
||||
|
<result property="unitId" column="UNIT_ID"/> |
||||
|
<result property="unitName" column="UNIT_NAME"/> |
||||
|
<result property="homeId" column="HOME_ID"/> |
||||
|
<result property="homeName" column="HOME_NAME"/> |
||||
|
<result property="purchaseDate" column="PURCHASE_DATE"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue