Commit 3d6e5caa authored by 周昊's avatar 周昊

1、修改楼层列表筛选,导出删除

parent 8d797c53
...@@ -43,6 +43,7 @@ public class LedgerFloorController extends BaseController ...@@ -43,6 +43,7 @@ public class LedgerFloorController extends BaseController
public TableDataInfo list(LedgerFloor ledgerFloor) public TableDataInfo list(LedgerFloor ledgerFloor)
{ {
startPage(); startPage();
ledgerFloor.setDeptId(getDeptId());
List<LedgerFloor> list = ledgerFloorService.selectLedgerFloorList(ledgerFloor); List<LedgerFloor> list = ledgerFloorService.selectLedgerFloorList(ledgerFloor);
return getDataTable(list); return getDataTable(list);
} }
...@@ -55,6 +56,7 @@ public class LedgerFloorController extends BaseController ...@@ -55,6 +56,7 @@ public class LedgerFloorController extends BaseController
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, LedgerFloor ledgerFloor) public void export(HttpServletResponse response, LedgerFloor ledgerFloor)
{ {
ledgerFloor.setDeptId(getDeptId());
List<LedgerFloor> list = ledgerFloorService.selectLedgerFloorList(ledgerFloor); List<LedgerFloor> list = ledgerFloorService.selectLedgerFloorList(ledgerFloor);
ExcelUtil<LedgerFloor> util = new ExcelUtil<LedgerFloor>(LedgerFloor.class); ExcelUtil<LedgerFloor> util = new ExcelUtil<LedgerFloor>(LedgerFloor.class);
util.exportExcel(response, list, "基础数据-楼层数据"); util.exportExcel(response, list, "基础数据-楼层数据");
...@@ -78,6 +80,7 @@ public class LedgerFloorController extends BaseController ...@@ -78,6 +80,7 @@ public class LedgerFloorController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody LedgerFloor ledgerFloor) public AjaxResult add(@RequestBody LedgerFloor ledgerFloor)
{ {
ledgerFloor.setCreateBy(getUsername());
return toAjax(ledgerFloorService.insertLedgerFloor(ledgerFloor)); return toAjax(ledgerFloorService.insertLedgerFloor(ledgerFloor));
} }
...@@ -89,6 +92,7 @@ public class LedgerFloorController extends BaseController ...@@ -89,6 +92,7 @@ public class LedgerFloorController extends BaseController
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody LedgerFloor ledgerFloor) public AjaxResult edit(@RequestBody LedgerFloor ledgerFloor)
{ {
ledgerFloor.setUpdateBy(getUsername());
return toAjax(ledgerFloorService.updateLedgerFloor(ledgerFloor)); return toAjax(ledgerFloorService.updateLedgerFloor(ledgerFloor));
} }
......
...@@ -23,23 +23,21 @@ public class LedgerFloor extends BaseEntityClean ...@@ -23,23 +23,21 @@ public class LedgerFloor extends BaseEntityClean
private Long id; private Long id;
/** 楼宇id */ /** 楼宇id */
@Excel(name = "楼宇id")
private Long buildingId; private Long buildingId;
/** 楼层名称 */ /** 楼层名称 */
@Excel(name = "楼层名称") @Excel(name = "楼层名称",sort = 2)
private String name; private String name;
/** 楼层属性 */ /** 楼层属性 */
@Excel(name = "楼层属性") @Excel(name = "楼层属性",sort = 3)
private String type; private String type;
/** 房间数量 */ /** 房间数量 */
@Excel(name = "房间数量")
private Long roomNumber; private Long roomNumber;
/** 状态(0正常 1停用) */ /** 状态(0正常 1停用) */
@Excel(name = "状态", readConverterExp = "0=正常,1=停用") @Excel(name = "状态", readConverterExp = "0=正常,1=停用",sort = 4)
private String status; private String status;
/** 删除标志(0代表存在 1代表删除) */ /** 删除标志(0代表存在 1代表删除) */
...@@ -49,7 +47,12 @@ public class LedgerFloor extends BaseEntityClean ...@@ -49,7 +47,12 @@ public class LedgerFloor extends BaseEntityClean
* 楼栋名称 * 楼栋名称
*/ */
@TableField(exist = false) @TableField(exist = false)
@Excel(name = "楼宇名称",sort = 1)
private String buildingName; private String buildingName;
/** 组织机构id */
@TableField(exist = false)
private Long deptId;
} }
...@@ -23,15 +23,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -23,15 +23,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<select id="selectLedgerFloorList" parameterType="com.censoft.censoftrongtong.domain.LedgerFloor" resultMap="LedgerFloorResult"> <select id="selectLedgerFloorList" parameterType="com.censoft.censoftrongtong.domain.LedgerFloor" resultMap="LedgerFloorResult">
select * from(SELECT f.id, f.building_id, b.name 'building_name', f.NAME, f.type, f.room_number, f.STATUS, f.del_flag, f.create_by, f.create_time, f.update_by, f.update_time FROM ledger_floor f LEFT JOIN ledger_building b on f.building_id=b.id) tt SELECT
f.id,
f.building_id,
b.NAME 'building_name',
f.NAME,
f.type,
f.room_number,
f.STATUS,
f.del_flag,
f.create_by,
f.create_time,
f.update_by,
f.update_time
FROM
ledger_floor f
LEFT JOIN ledger_building b ON f.building_id = b.id
LEFT JOIN sys_dept d ON b.dept_id = d.dept_id
<where> <where>
<if test="buildingName != null "> and tt.building_name like concat('%', #{buildingName}, '%')</if> <if test="buildingName != null "> and b.building_name like concat('%', #{buildingName}, '%')</if>
<if test="buildingId != null "> and tt.building_id = #{buildingId}</if> <if test="buildingId != null "> and b.building_id = #{buildingId}</if>
<if test="name != null and name != ''"> and tt.name like concat('%', #{name}, '%')</if> <if test="name != null and name != ''"> and f.name like concat('%', #{name}, '%')</if>
<if test="type != null and type != ''"> and tt.type = #{type}</if> <if test="type != null and type != ''"> and f.type = #{type}</if>
<if test="roomNumber != null "> and tt.room_number = #{roomNumber}</if> <if test="roomNumber != null "> and f.room_number = #{roomNumber}</if>
<if test="status != null and status != ''"> and tt.status = #{status}</if> <if test="status != null and status != ''"> and f.status = #{status}</if>
<if test="delFlag != null and delFlag != ''"> and tt.del_flag = #{delFlag}</if> and f.del_flag = '0'
</where> </where>
</select> </select>
...@@ -86,11 +102,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -86,11 +102,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<delete id="deleteLedgerFloorById" parameterType="Long"> <delete id="deleteLedgerFloorById" parameterType="Long">
delete from ledger_floor where id = #{id} update ledger_floor set del_flag = '1' where id = #{id}
</delete> </delete>
<delete id="deleteLedgerFloorByIds" parameterType="String"> <delete id="deleteLedgerFloorByIds" parameterType="String">
delete from ledger_floor where id in update ledger_floor set del_flag = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
......
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