Commit f7016a85 authored by yf's avatar yf

Merge branch 'develop' of http://git.censoft.com.cn/rongtong/ruoyi-vue-master into develop

parents 5a1aea34 3d60b095
package com.censoft.censoftrongtong.controller;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.censoft.censoftrongtong.domain.LedgerBuilding;
import com.censoft.censoftrongtong.domain.LedgerFloor;
import com.censoft.censoftrongtong.service.ILedgerBuildingService;
import com.censoft.censoftrongtong.service.ILedgerFloorService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -102,4 +105,36 @@ public class LedgerBuildingController extends BaseController
{
return toAjax(ledgerBuildingService.deleteLedgerBuildingByIds(ids));
}
@Resource
private ILedgerFloorService ledgerFloorService;
//批量导入
@GetMapping("/insert/all")
public void test(LedgerBuilding ledgerBuilding)
{
List<LedgerBuilding> list = ledgerBuildingService.selectLedgerBuildingList(ledgerBuilding);
for (LedgerBuilding building : list) {
if (building.getGroundFloor()!=0){
for (int i = 1; i <= building.getGroundFloor(); i++) {
LedgerFloor ledgerFloor = new LedgerFloor();
ledgerFloor.setBuildingId(building.getId());
ledgerFloor.setName(i+"层");
ledgerFloor.setType("地上");
ledgerFloorService.insertLedgerFloor(ledgerFloor);
}
}
if (building.getUndergroundFloor()!=0){
for (int i = 1; i <= building.getUndergroundFloor(); i++) {
LedgerFloor ledgerFloor = new LedgerFloor();
ledgerFloor.setBuildingId(building.getId());
ledgerFloor.setName(-i+"层");
ledgerFloor.setType("地下");
ledgerFloorService.insertLedgerFloor(ledgerFloor);
}
}
}
return ;
}
}
......@@ -44,6 +44,14 @@ public class LedgerBuilding extends BaseEntityClean
@Excel(name = "楼层")
private String floor;
/** 地上楼层 */
@Excel(name = "地上楼层")
private Integer groundFloor;
/** 地下楼层 */
@Excel(name = "地下楼层")
private Integer undergroundFloor;
/** 用途 */
@Excel(name = "用途")
private String useto;
......
......@@ -11,6 +11,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="type" column="type" />
<result property="deptId" column="dept_id" />
<result property="floor" column="floor" />
<result property="groundFloor" column="ground_floor" />
<result property="undergroundFloor" column="underground_floor" />
<result property="useto" column="useto" />
<result property="city" column="city" />
<result property="area" column="area" />
......@@ -28,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectLedgerBuildingList" parameterType="com.censoft.censoftrongtong.domain.LedgerBuilding" resultMap="LedgerBuildingResult">
select * from (SELECT b.id, b.project_id, p.NAME 'project_name', b.NAME, b.type, b.dept_id, d.dept_name, b.floor, b.useto, b.city, b.area, b.address, b.STATUS, b.del_flag, b.create_by, b.create_time, b.update_by, b.update_time FROM ledger_building b LEFT JOIN sys_dept d ON b.dept_id = d.dept_id LEFT JOIN ledger_project p ON b.project_id = p.id) tt
select * from (SELECT b.id, b.project_id, p.NAME 'project_name', b.NAME, b.type, b.dept_id, d.dept_name, b.floor,b.ground_floor,b.underground_floor, b.useto, b.city, b.area, b.address, b.STATUS, b.del_flag, b.create_by, b.create_time, b.update_by, b.update_time FROM ledger_building b LEFT JOIN sys_dept d ON b.dept_id = d.dept_id LEFT JOIN ledger_project p ON b.project_id = p.id) tt
<where>
<if test="projectName != null "> and tt.project_name like concat('%', #{projectName}, '%') </if>
<if test="projectId != null "> and tt.project_id = #{projectId} </if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment