Commit 7fc320d3 authored by 陈晓晋's avatar 陈晓晋

建筑和楼层配置id查询20230713

parent ef1f7ff0
...@@ -30,7 +30,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -30,7 +30,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectLedgerBuildingList" parameterType="com.censoft.censoftrongtong.domain.LedgerBuilding" resultMap="LedgerBuildingResult"> <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.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> <where>
<if test="projectName != null "> and project_name like concat('%', #{projectName}, '%') </if> <if test="projectName != null "> and tt.project_name like concat('%', #{projectName}, '%') </if>
<if test="projectId != null "> and tt.project_id = #{projectId} </if>
<if test="name != null and name != ''"> and tt.name like concat('%', #{name}, '%')</if> <if test="name != null and name != ''"> and tt.name like concat('%', #{name}, '%')</if>
<if test="type != null and type != ''"> and tt.type = #{type}</if> <if test="type != null and type != ''"> and tt.type = #{type}</if>
<if test="deptId != null "> and tt.dept_name like concat('%', #{deptName}, '%')</if> <if test="deptId != null "> and tt.dept_name like concat('%', #{deptName}, '%')</if>
......
...@@ -26,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -26,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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 * 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
<where> <where>
<if test="buildingName != null "> and tt.building_name like concat('%', #{buildingName}, '%')</if> <if test="buildingName != null "> and tt.building_name like concat('%', #{buildingName}, '%')</if>
<if test="buildingId != null "> and tt.building_id = #{buildingId}</if>
<if test="name != null and name != ''"> and tt.name like concat('%', #{name}, '%')</if> <if test="name != null and name != ''"> and tt.name like concat('%', #{name}, '%')</if>
<if test="type != null and type != ''"> and tt.type = #{type}</if> <if test="type != null and type != ''"> and tt.type = #{type}</if>
<if test="roomNumber != null "> and tt.room_number = #{roomNumber}</if> <if test="roomNumber != null "> and tt.room_number = #{roomNumber}</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