| | |
| | | */ |
| | | List<Map> queryFloors(Map floorMap) throws DAOException; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | import com.java110.common.exception.DAOException; |
| | | import com.java110.entity.merchant.BoMerchant; |
| | | import com.java110.entity.merchant.BoMerchantAttr; |
| | | import com.java110.entity.merchant.Merchant; |
| | | import com.java110.entity.merchant.MerchantAttr; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * 小区单元组件内部之间使用,没有给外围系统提供服务能力 |
| | | * 小区单元服务接口类,要求全部以字符串传输,方便微服务化 |
| | | * 新建客户,修改客户,删除客户,查询客户等功能 |
| | | * <p> |
| | | * |
| | | * Created by wuxw on 2016/12/27. |
| | | */ |
| | | public interface IUnitServiceDao { |
| | | |
| | | /** |
| | | * 保存 小区单元信息 |
| | | * |
| | | * @param businessUnitInfo 小区单元信息 封装 |
| | | * @throws DAOException 操作数据库异常 |
| | | */ |
| | | void saveBusinessUnitInfo(Map businessUnitInfo) throws DAOException; |
| | | public void saveBusinessUnitInfo(Map businessUnitInfo) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询小区单元信息(business过程) |
| | | * 根据bId 查询小区单元信息 |
| | | * |
| | | * @param info bId 信息 |
| | | * @return 小区单元信息 |
| | | * @throws DAOException |
| | | */ |
| | | List<Map> getBusinessUnitInfo(Map info) throws DAOException; |
| | | public List<Map> getBusinessUnitInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存 小区单元信息 Business数据到 Instance中 |
| | | * |
| | | * @param info |
| | | * @throws DAOException |
| | | */ |
| | | void saveUnitInfoInstance(Map info) throws DAOException; |
| | | public void saveUnitInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询小区单元信息(instance过程) |
| | | * 根据bId 查询小区单元信息 |
| | | * |
| | | * @param info bId 信息 |
| | | * @return 小区单元信息 |
| | | * @throws DAOException |
| | | */ |
| | | List<Map> getUnitInfo(Map info) throws DAOException; |
| | | public List<Map> getUnitInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改小区单元信息 |
| | | * |
| | | * @param info 修改信息 |
| | | * @throws DAOException |
| | | */ |
| | | void updateUnitInfoInstance(Map info) throws DAOException; |
| | | public void updateUnitInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询小区单元总数 |
| | | * |
| | | * @param info 小区单元信息 |
| | | * @return 小区单元数量 |
| | | */ |
| | | int queryUnitsCount(Map info); |
| | | |
| | | } |
| | |
| | | //@Transactional |
| | | public class UnitServiceDaoImpl extends BaseServiceDao implements IUnitServiceDao { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(UnitServiceDaoImpl.class); |
| | | private static Logger logger = LoggerFactory.getLogger(UnitServiceDaoImpl.class); |
| | | |
| | | /** |
| | | * 小区单元信息封装 |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询小区单元数量 |
| | | * |
| | | * @param info 小区单元信息 |
| | | * @return 小区单元数量 |
| | | */ |
| | | @Override |
| | | public int queryUnitsCount(Map info) { |
| | | logger.debug("查询小区单元数据 入参 info : {}", info); |
| | | |
| | | List<Map> businessUnitInfos = sqlSessionTemplate.selectList("unitServiceDaoImpl.queryUnitsCount", info); |
| | | if (businessUnitInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessUnitInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | protected void flushBusinessUnitInfo(Map businessUnitInfo, String statusCd) { |
| | | businessUnitInfo.put("newBId", businessUnitInfo.get("b_id")); |
| | | businessUnitInfo.put("floorId", businessUnitInfo.get("floor_id")); |
| | | businessUnitInfo.put("operate", businessUnitInfo.get("operate")); |
| | | businessUnitInfo.put("layerCount", businessUnitInfo.get("layer_count")); |
| | | businessUnitInfo.put("unitId", businessUnitInfo.get("unit_id")); |
| | |
| | | |
| | | currentUnitInfo.put("bId", business.getbId()); |
| | | |
| | | currentUnitInfo.put("floorId", currentUnitInfo.get("floor_id")); |
| | | currentUnitInfo.put("operate", currentUnitInfo.get("operate")); |
| | | currentUnitInfo.put("layerCount", currentUnitInfo.get("layer_count")); |
| | | currentUnitInfo.put("unitId", currentUnitInfo.get("unit_id")); |
| | |
| | | @Transactional |
| | | public class UpdateUnitInfoListener extends AbstractUnitBusinessServiceDataFlowListener { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(UpdateUnitInfoListener.class); |
| | | private static Logger logger = LoggerFactory.getLogger(UpdateUnitInfoListener.class); |
| | | @Autowired |
| | | IUnitServiceDao unitServiceDaoImpl; |
| | | |
| New file |
| | |
| | | package com.java110.community.smo.impl; |
| | | |
| | | |
| | | import com.java110.common.util.BeanConvertUtil; |
| | | import com.java110.community.dao.IFloorServiceDao; |
| | | import com.java110.community.dao.IUnitServiceDao; |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.core.smo.unit.IUnitInnerServiceSMO; |
| | | import com.java110.core.smo.user.IUserInnerServiceSMO; |
| | | import com.java110.dto.FloorDto; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.UnitDto; |
| | | import com.java110.dto.UserDto; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName FloorInnerServiceSMOImpl |
| | | * @Description 楼单元内部服务实现类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:20 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @RestController |
| | | public class UnitInnerServiceSMOImpl extends BaseServiceSMO implements IUnitInnerServiceSMO { |
| | | |
| | | @Autowired |
| | | private IUnitServiceDao unitServiceDaoImpl; |
| | | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public List<UnitDto> queryUnits(@RequestBody UnitDto unitDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = unitDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | unitDto.setPage((page - 1) * unitDto.getRow()); |
| | | unitDto.setRow(page * unitDto.getRow()); |
| | | } |
| | | |
| | | List<UnitDto> units = BeanConvertUtil.covertBeanList(unitServiceDaoImpl.getUnitInfo(BeanConvertUtil.beanCovertMap(unitDto)), UnitDto.class); |
| | | |
| | | if (units == null || units.size() == 0) { |
| | | return units; |
| | | } |
| | | |
| | | String[] userIds = getUserIds(units); |
| | | //根据 userId 查询用户信息 |
| | | List<UserDto> users = userInnerServiceSMOImpl.getUserInfo(userIds); |
| | | |
| | | for (UnitDto unit : units) { |
| | | refreshFloor(unit, users); |
| | | } |
| | | return units; |
| | | } |
| | | |
| | | /** |
| | | * 从用户列表中查询用户,将用户中的信息 刷新到 floor对象中 |
| | | * |
| | | * @param unit 小区楼单元信息 |
| | | * @param users 用户列表 |
| | | */ |
| | | private void refreshFloor(UnitDto unit, List<UserDto> users) { |
| | | for (UserDto user : users) { |
| | | if (unit.getUserId().equals(user.getUserId())) { |
| | | BeanConvertUtil.covertBean(user, unit); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取批量userId |
| | | * |
| | | * @param units 小区楼信息 |
| | | * @return 批量userIds 信息 |
| | | */ |
| | | private String[] getUserIds(List<UnitDto> units) { |
| | | List<String> userIds = new ArrayList<String>(); |
| | | for (UnitDto unit : units) { |
| | | userIds.add(unit.getUserId()); |
| | | } |
| | | |
| | | return userIds.toArray(new String[userIds.size()]); |
| | | } |
| | | |
| | | @Override |
| | | public int queryUnitsCount(@RequestBody UnitDto unitDto) { |
| | | return unitServiceDaoImpl.queryUnitsCount(BeanConvertUtil.beanCovertMap(unitDto)); } |
| | | |
| | | public IUnitServiceDao getUnitServiceDaoImpl() { |
| | | return unitServiceDaoImpl; |
| | | } |
| | | |
| | | public void setUnitServiceDaoImpl(IUnitServiceDao unitServiceDaoImpl) { |
| | | this.unitServiceDaoImpl = unitServiceDaoImpl; |
| | | } |
| | | |
| | | public IUserInnerServiceSMO getUserInnerServiceSMOImpl() { |
| | | return userInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) { |
| | | this.userInnerServiceSMOImpl = userInnerServiceSMOImpl; |
| | | } |
| | | } |
| | |
| | | > API服务做删除小区楼时调用该接口 |
| | | |
| | | ###### URL |
| | | > [http://floor-service/floorApi/service](http://floor-service/floorApi/service) |
| | | > [http://community-service/floorApi/service](http://community-service/floorApi/service) |
| | | |
| | | ###### 支持格式 |
| | | > JSON |
| | |
| | | |
| | | |
| | | ###### 举例 |
| | | > 地址:[http://floor-service/floorApi/service](http://floor-service/floorApi/service) |
| | | > 地址:[http://community-service/floorApi/service](http://community-service/floorApi/service) |
| | | |
| | | ``` javascript |
| | | 请求头信息: |
| | |
| | | > API服务做保存小区楼时调用该接口 |
| | | |
| | | ###### URL |
| | | > [http://floor-service/floorApi/service](http://floor-service/floorApi/service) |
| | | > [http://community-service/floorApi/service](http://community-service/floorApi/service) |
| | | |
| | | ###### 支持格式 |
| | | > JSON |
| | |
| | | |
| | | |
| | | ###### 举例 |
| | | > 地址:[http://floor-service/floorApi/service](http://floor-service/floorApi/service) |
| | | > 地址:[http://community-service/floorApi/service](http://community-service/floorApi/service) |
| | | |
| | | ``` javascript |
| | | 请求头信息: |
| | |
| | | > API服务做修改小区楼时调用该接口 |
| | | |
| | | ###### URL |
| | | > [http://floor-service/floorApi/service](http://floor-service/floorApi/service) |
| | | > [http://community-service/floorApi/service](http://community-service/floorApi/service) |
| | | |
| | | ###### 支持格式 |
| | | > JSON |
| | |
| | | |
| | | |
| | | ###### 举例 |
| | | > 地址:[http://floor-service/floorApi/service](http://floor-service/floorApi/service) |
| | | > 地址:[http://community-service/floorApi/service](http://community-service/floorApi/service) |
| | | |
| | | ``` javascript |
| | | 请求头信息: |
| | |
| | | |business|businessTypeCd|1|String|12|业务类型编码|500100030002| |
| | | |business|datas|1|Object|-|数据节点|不同的服务下的节点不一样| |
| | | |datas|businessUnitInfo|1|Object|-|小区成员|小区成员| |
| | | |businessUnitInfo|floorId|1|String|30|-|-| |
| | | |businessUnitInfo|layerCount|1|String|30|-|-| |
| | | |businessUnitInfo|unitId|1|String|30|-|-| |
| | | |businessUnitInfo|unitNum|1|String|30|-|-| |
| | |
| | | "remark": "备注", |
| | | "datas": { |
| | | "businessUnitInfo": { |
| | | "layerCount":"填写具体值", |
| | | "floorId":"填写具体值", |
| | | "layerCount":"填写具体值", |
| | | "unitId":"填写具体值", |
| | | "unitNum":"填写具体值", |
| | | "lift":"填写具体值", |
| | |
| | | |business|businessTypeCd|1|String|12|业务类型编码|500100030002| |
| | | |business|datas|1|Object|-|数据节点|不同的服务下的节点不一样| |
| | | |datas|businessUnitInfo|1|Object|-|小区成员|小区成员| |
| | | |businessUnitInfo|floorId|1|String|30|-|-| |
| | | |businessUnitInfo|layerCount|1|String|30|-|-| |
| | | |businessUnitInfo|unitId|1|String|30|-|-| |
| | | |businessUnitInfo|unitNum|1|String|30|-|-| |
| | |
| | | "remark": "备注", |
| | | "datas": { |
| | | "businessUnitInfo": { |
| | | "layerCount":"填写具体值", |
| | | "floorId":"填写具体值", |
| | | "layerCount":"填写具体值", |
| | | "unitId":"填写具体值", |
| | | "unitNum":"填写具体值", |
| | | "lift":"填写具体值", |
| New file |
| | |
| | | package com.java110.dto; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 分页数据封装对象 |
| | | */ |
| | | public class PageDto extends Dto implements Serializable { |
| | | |
| | | public static final int DEFAULT_PAGE = -1; |
| | | |
| | | // 分页页数 |
| | | private int page = DEFAULT_PAGE; |
| | | // 行数 |
| | | private int row; |
| | | |
| | | //页数 |
| | | private int records; |
| | | |
| | | // 总记录数 |
| | | private int total; |
| | | |
| | | |
| | | public int getPage() { |
| | | return page; |
| | | } |
| | | |
| | | public void setPage(int page) { |
| | | this.page = page; |
| | | } |
| | | |
| | | public int getRow() { |
| | | return row; |
| | | } |
| | | |
| | | public void setRow(int row) { |
| | | this.row = row; |
| | | } |
| | | |
| | | public int getTotal() { |
| | | return total; |
| | | } |
| | | |
| | | public void setTotal(int total) { |
| | | this.total = total; |
| | | } |
| | | |
| | | public int getRecords() { |
| | | return records; |
| | | } |
| | | |
| | | public void setRecords(int records) { |
| | | this.records = records; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.dto; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName FloorDto |
| | | * @Description 小区楼数据层封装 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 8:52 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | public class UnitDto extends PageDto implements Serializable { |
| | | |
| | | |
| | | /** |
| | | * unitId |
| | | */ |
| | | private String unitId; |
| | | |
| | | /** |
| | | * 编号 |
| | | */ |
| | | private String unitNum; |
| | | |
| | | /** |
| | | * 名称 |
| | | */ |
| | | private String floorId; |
| | | |
| | | private String remark; |
| | | private String layerCount; |
| | | private String lift; |
| | | |
| | | private String userId; |
| | | |
| | | private String userName; |
| | | |
| | | private Date createTime; |
| | | |
| | | |
| | | public String getUnitId() { |
| | | return unitId; |
| | | } |
| | | |
| | | public void setUnitId(String unitId) { |
| | | this.unitId = unitId; |
| | | } |
| | | |
| | | public String getUnitNum() { |
| | | return unitNum; |
| | | } |
| | | |
| | | public void setUnitNum(String unitNum) { |
| | | this.unitNum = unitNum; |
| | | } |
| | | |
| | | public String getFloorId() { |
| | | return floorId; |
| | | } |
| | | |
| | | public void setFloorId(String floorId) { |
| | | this.floorId = floorId; |
| | | } |
| | | |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | public String getLayerCount() { |
| | | return layerCount; |
| | | } |
| | | |
| | | public void setLayerCount(String layerCount) { |
| | | this.layerCount = layerCount; |
| | | } |
| | | |
| | | public String getLift() { |
| | | return lift; |
| | | } |
| | | |
| | | public void setLift(String lift) { |
| | | this.lift = lift; |
| | | } |
| | | |
| | | public String getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(String userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public String getUserName() { |
| | | return userName; |
| | | } |
| | | |
| | | public void setUserName(String userName) { |
| | | this.userName = userName; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | } |
| | |
| | | param.put("unitId", "unit_id"); |
| | | param.put("bId", "b_id"); |
| | | param.put("unitNum", "unit_num"); |
| | | param.put("floorId", "floor_id"); |
| | | param.put("layerCount", "layer_count"); |
| | | param.put("lift", "lift"); |
| | | param.put("statusCd", "status_cd"); |
| | |
| | | sqlValue += " and t." + params.get(key) + "= #{" + key + "}\n"; |
| | | sqlValue += "</if> \n"; |
| | | |
| | | |
| | | } |
| | | |
| | | //加入分页功能<if test="page != -1"> |
| | | // limit page,row |
| | | // </if> |
| | | sqlValue += "<if test=\"page != -1\">\n"; |
| | | sqlValue += " limit page,row\n"; |
| | | sqlValue += "</if> \n"; |
| | | |
| | | sql = sql.endsWith(",") ? sql.substring(0, sql.length() - 1) : sql; |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 拼装 查询数量 |
| | | * @param data 数据 |
| | | * @param fileContext 文件内容 |
| | | * @return |
| | | */ |
| | | private String dealGetCount(Data data, String fileContext) { |
| | | String sql = "select count(1) count"; |
| | | String sqlValue = " \nfrom " + data.getTableName() + " t \nwhere 1 =1 \n"; |
| | | |
| | | Map<String, String> params = data.getParams(); |
| | | |
| | | for (String key : params.keySet()) { |
| | | if ("operate".equals(key)) { |
| | | continue; |
| | | } |
| | | sqlValue += "<if test=\"" + key + " !=null and " + key + " != ''\">\n"; |
| | | sqlValue += " and t." + params.get(key) + "= #{" + key + "}\n"; |
| | | sqlValue += "</if> \n"; |
| | | |
| | | |
| | | } |
| | | |
| | | sql = sql.endsWith(",") ? sql.substring(0, sql.length() - 1) : sql; |
| | | |
| | | sql += sqlValue; |
| | | |
| | | fileContext = fileContext.replace("$queryCount$", sql); |
| | | |
| | | return fileContext; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 生成代码 |
| | |
| | | fileContext = dealSaveInfoInstance(data, fileContext); |
| | | fileContext = dealGetInfo(data, fileContext); |
| | | fileContext = dealUpdateInfoInstance(data, fileContext); |
| | | fileContext = dealGetCount(data, fileContext); |
| | | |
| | | System.out.println(this.getClass().getResource("/listener").getPath()); |
| | | String writePath = this.getClass().getResource("/listener").getPath() + "/" + toUpperCaseFirstOne(data.getName()) + "ServiceDaoImplMapper.xml"; |
| | |
| | | * @param businessStoreInfo 商户信息 封装 |
| | | * @throws DAOException 操作数据库异常 |
| | | */ |
| | | public void saveBusinessStoreInfo(Map businessStoreInfo) throws DAOException; |
| | | void saveBusinessStoreInfo(Map businessStoreInfo) throws DAOException; |
| | | |
| | | |
| | | |
| | |
| | | * @return 商户信息 |
| | | * @throws DAOException |
| | | */ |
| | | public Map getBusinessStoreInfo(Map info) throws DAOException; |
| | | Map getBusinessStoreInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | |
| | | * @param info |
| | | * @throws DAOException |
| | | */ |
| | | public void saveStoreInfoInstance(Map info) throws DAOException; |
| | | void saveStoreInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | |
| | | * @return 商户信息 |
| | | * @throws DAOException |
| | | */ |
| | | public Map getStoreInfo(Map info) throws DAOException; |
| | | Map getStoreInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | |
| | | * @param info 修改信息 |
| | | * @throws DAOException |
| | | */ |
| | | public void updateStoreInfoInstance(Map info) throws DAOException; |
| | | void updateStoreInfoInstance(Map info) throws DAOException; |
| | | |
| | | /** |
| | | * 查询商户总数 |
| | | * |
| | | * @param info 商户信息 |
| | | * @return 商户数量 |
| | | */ |
| | | int queryStoresCount(Map info); |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询商户数量 |
| | | * @param info 商户信息 |
| | | * @return 商户数量 |
| | | */ |
| | | @Override |
| | | public int queryStoresCount(Map info) { |
| | | logger.debug("查询商户数据 入参 info : {}",info); |
| | | |
| | | List<Map> businessStoreInfos = sqlSessionTemplate.selectList("storeServiceDaoImpl.queryStoresCount", info); |
| | | if (businessStoreInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessStoreInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | public void updateStoreInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询商户总数 |
| | | * |
| | | * @param info 商户信息 |
| | | * @return 商户数量 |
| | | */ |
| | | int queryStoresCount(Map info); |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询商户数量 |
| | | * @param info 商户信息 |
| | | * @return 商户数量 |
| | | */ |
| | | @Override |
| | | public int queryStoresCount(Map info) { |
| | | logger.debug("查询商户数据 入参 info : {}",info); |
| | | |
| | | List<Map> businessStoreInfos = sqlSessionTemplate.selectList("storeServiceDaoImpl.queryStoresCount", info); |
| | | if (businessStoreInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessStoreInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | $updateInfoInstance$ |
| | | </update> |
| | | |
| | | <!-- 查询商户数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryStoresCount" parameterType="Map" resultType="Map"> |
| | | $queryCount$ |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <!-- 保存小区单元信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveBusinessUnitInfo" parameterType="Map"> |
| | | insert into business_building_unit( |
| | | operate,layer_count,unit_id,unit_num,lift,remark,b_id,user_id |
| | | floor_id,operate,layer_count,unit_id,unit_num,lift,remark,b_id,user_id |
| | | ) values ( |
| | | #{operate},#{layerCount},#{unitId},#{unitNum},#{lift},#{remark},#{bId},#{userId} |
| | | #{floorId},#{operate},#{layerCount},#{unitId},#{unitNum},#{lift},#{remark},#{bId},#{userId} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询小区单元信息(Business) add by wuxw 2018-07-03 --> |
| | | <select id="getBusinessUnitInfo" parameterType="Map" resultType="Map"> |
| | | select t.operate,t.layer_count,t.layer_count layerCount,t.unit_id,t.unit_id unitId,t.unit_num,t.unit_num unitNum,t.lift,t.remark,t.b_id,t.b_id bId,t.user_id,t.user_id userId |
| | | select t.floor_id,t.floor_id floorId,t.operate,t.layer_count,t.layer_count layerCount,t.unit_id,t.unit_id unitId,t.unit_num,t.unit_num unitNum,t.lift,t.remark,t.b_id,t.b_id bId,t.user_id,t.user_id userId |
| | | from business_building_unit t |
| | | where 1 =1 |
| | | <if test="floorId !=null and floorId != ''"> |
| | | and t.floor_id= #{floorId} |
| | | </if> |
| | | <if test="operate !=null and operate != ''"> |
| | | and t.operate= #{operate} |
| | | </if> |
| | |
| | | <!-- 保存小区单元信息至 instance表中 add by wuxw 2018-07-03 --> |
| | | <insert id="saveUnitInfoInstance" parameterType="Map"> |
| | | insert into building_unit( |
| | | layer_count,unit_id,unit_num,lift,status_cd,remark,b_id,user_id |
| | | ) select t.layer_count,t.unit_id,t.unit_num,t.lift,'0',t.remark,t.b_id,t.user_id from business_building_unit t where 1=1 |
| | | floor_id,layer_count,unit_id,unit_num,lift,status_cd,remark,b_id,user_id |
| | | ) select t.floor_id,t.layer_count,t.unit_id,t.unit_num,t.lift,'0',t.remark,t.b_id,t.user_id from business_building_unit t where 1=1 |
| | | <if test="floorId !=null and floorId != ''"> |
| | | and t.floor_id= #{floorId} |
| | | </if> |
| | | and t.operate= 'ADD' |
| | | <if test="layerCount !=null and layerCount != ''"> |
| | | and t.layer_count= #{layerCount} |
| | |
| | | |
| | | <!-- 查询小区单元信息 add by wuxw 2018-07-03 --> |
| | | <select id="getUnitInfo" parameterType="Map" resultType="Map"> |
| | | select t.layer_count,t.layer_count layerCount,t.unit_id,t.unit_id unitId,t.unit_num,t.unit_num unitNum,t.lift,t.status_cd,t.status_cd statusCd,t.remark,t.b_id,t.b_id bId,t.user_id,t.user_id userId |
| | | select t.floor_id,t.floor_id floorId,t.layer_count,t.layer_count layerCount,t.unit_id,t.unit_id unitId,t.unit_num,t.unit_num unitNum,t.lift,t.status_cd,t.status_cd statusCd,t.remark,t.b_id,t.b_id bId,t.user_id,t.user_id userId |
| | | from building_unit t |
| | | where 1 =1 |
| | | <if test="floorId !=null and floorId != ''"> |
| | | and t.floor_id= #{floorId} |
| | | </if> |
| | | <if test="layerCount !=null and layerCount != ''"> |
| | | and t.layer_count= #{layerCount} |
| | | </if> |
| | | <if test="unitId !=null and unitId != ''"> |
| | | and t.unit_id= #{unitId} |
| | | </if> |
| | | <if test="unitNum !=null and unitNum != ''"> |
| | | and t.unit_num= #{unitNum} |
| | | </if> |
| | | <if test="lift !=null and lift != ''"> |
| | | and t.lift= #{lift} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="remark !=null and remark != ''"> |
| | | and t.remark= #{remark} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="userId !=null and userId != ''"> |
| | | and t.user_id= #{userId} |
| | | </if> |
| | | <if test="page != -1"> |
| | | limit page,row |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 修改小区单元信息 add by wuxw 2018-07-03 --> |
| | | <update id="updateUnitInfoInstance" parameterType="Map"> |
| | | update building_unit t set t.status_cd = #{statusCd} |
| | | <if test="floorId !=null and floorId != ''"> |
| | | , t.floor_id= #{floorId} |
| | | </if> |
| | | <if test="layerCount !=null and layerCount != ''"> |
| | | , t.layer_count= #{layerCount} |
| | | </if> |
| | | <if test="unitNum !=null and unitNum != ''"> |
| | | , t.unit_num= #{unitNum} |
| | | </if> |
| | | <if test="lift !=null and lift != ''"> |
| | | , t.lift= #{lift} |
| | | </if> |
| | | <if test="remark !=null and remark != ''"> |
| | | , t.remark= #{remark} |
| | | </if> |
| | | <if test="userId !=null and userId != ''"> |
| | | , t.user_id= #{userId} |
| | | </if> |
| | | where 1=1 <if test="unitId !=null and unitId != ''"> |
| | | and t.unit_id= #{unitId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询小区单元数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryUnitsCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from building_unit t |
| | | where 1 =1 |
| | | <if test="floorId !=null and floorId != ''"> |
| | | and t.floor_id= #{floorId} |
| | | </if> |
| | | <if test="layerCount !=null and layerCount != ''"> |
| | | and t.layer_count= #{layerCount} |
| | | </if> |
| | |
| | | and t.user_id= #{userId} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 修改小区单元信息 add by wuxw 2018-07-03 --> |
| | | <update id="updateUnitInfoInstance" parameterType="Map"> |
| | | update building_unit t set t.status_cd = #{statusCd} |
| | | <if test="layerCount !=null and layerCount != ''"> |
| | | , t.layer_count= #{layerCount} |
| | | </if> |
| | | <if test="unitNum !=null and unitNum != ''"> |
| | | , t.unit_num= #{unitNum} |
| | | </if> |
| | | <if test="lift !=null and lift != ''"> |
| | | , t.lift= #{lift} |
| | | </if> |
| | | <if test="remark !=null and remark != ''"> |
| | | , t.remark= #{remark} |
| | | </if> |
| | | <if test="userId !=null and userId != ''"> |
| | | , t.user_id= #{userId} |
| | | </if> |
| | | where 1=1 <if test="unitId !=null and unitId != ''"> |
| | | and t.unit_id= #{unitId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | |
| | | </update> |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package com.java110.core.smo.unit; |
| | | |
| | | import com.java110.core.feign.FeignConfiguration; |
| | | import com.java110.dto.UnitDto; |
| | | import org.springframework.cloud.netflix.feign.FeignClient; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName IFloorInnerServiceSMO |
| | | * @Description 小区楼接口类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:04 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @FeignClient(name = "community-service", configuration = {FeignConfiguration.class}) |
| | | @RequestMapping("/unitApi") |
| | | public interface IUnitInnerServiceSMO { |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * |
| | | * @param unitDto 数据对象分享 |
| | | * @return UnitDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/queryUnits", method = RequestMethod.POST) |
| | | List<UnitDto> queryUnits(@RequestBody UnitDto unitDto); |
| | | |
| | | /** |
| | | * 查询<p>小区楼</p>总记录数 |
| | | * |
| | | * @param unitDto 数据对象分享 |
| | | * @return 小区下的小区楼记录数 |
| | | */ |
| | | @RequestMapping(value = "/queryUnitsCount", method = RequestMethod.POST) |
| | | int queryUnitsCount(@RequestBody UnitDto unitDto); |
| | | } |