61 lines
3.3 KiB
XML
61 lines
3.3 KiB
XML
<?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.bwie.floor.mapper.FloorMapper">
|
|
<insert id="addFloor">
|
|
INSERT INTO `wuye`.`floor` (`floor_name`, `floor_count`, `floor_start`, `floor_area`)
|
|
VALUES ( #{floorName}, #{floorCount}, 0, #{floorArea});
|
|
</insert>
|
|
<insert id="addclient">
|
|
INSERT INTO `wuye`.`client` ( `client_name`, `client_tel`, `client_type`, `client_document`, `client_document_number`, `client_sex`, `client_nation`)
|
|
VALUES ( #{clientName}, #{clientTel}, #{clientType}, #{clientDocument}, #{clientDocumentNumber}, #{clientSex}, #{clientNation});
|
|
</insert>
|
|
<insert id="addRoom">
|
|
INSERT INTO `wuye`.`room` ( `room_name`, `floor_id`, `client_id`, `room_floor_count`)
|
|
VALUES ( #{roomName}, #{floorId}, #{clientId}, #{roomFloorCount});
|
|
|
|
</insert>
|
|
<insert id="addSpace">
|
|
INSERT INTO `wuye`.`space` ( `space_number`, `client_id`, `space_type`, `space_start_time`, `space_end_time`, `space_status`)
|
|
VALUES ( #{spaceNumber}, #{clientId}, #{spaceType}, now(), #{spaceEndTime}, 1);
|
|
</insert>
|
|
<update id="floorDel">
|
|
UPDATE `wuye`.`floor` SET `floor_start` = 1 WHERE `floor_id` = #{floorId};
|
|
</update>
|
|
<update id="upFloor">
|
|
UPDATE `wuye`.`client` SET `client_name` = #{clientName}, `client_tel` = #{clientTel}, `client_type` = #{clientType}, `client_document` = #{clientDocument}, `client_document_number` = #{clientDocumentNumber}, `client_sex` = #{clientSex}, `client_nation` = #{clientNation} WHERE `client_id` = #{clientId};
|
|
</update>
|
|
<update id="upRoom">
|
|
UPDATE `wuye`.`room` SET `room_name` = #{roomName}, `floor_id` = #{floorId}, `client_id` = #{clientId}, `room_floor_count` = #{roomFloorCount} WHERE `room_id` = #{roomId};
|
|
|
|
</update>
|
|
<update id="upSpace">
|
|
UPDATE `wuye`.`space` SET `space_number` = #{spaceNumber}, `client_id` = #{clientId}, `space_type` = #{spaceType}, `space_start_time` = #{spaceStartTime}, `space_end_time` = #{spaceEndTime}, `space_status` = 1 WHERE `space_id` = #{spaceId};
|
|
</update>
|
|
|
|
<select id="list" resultType="com.bwie.common.domain.Floor">
|
|
select * from floor
|
|
</select>
|
|
<select id="clientList" resultType="com.bwie.common.domain.Client">
|
|
select * from client
|
|
</select>
|
|
<select id="roomList" resultType="com.bwie.common.domain.Room">
|
|
SELECT * FROM room
|
|
LEFT JOIN client on room.client_id=client.client_id
|
|
LEFT JOIN floor on room.floor_id =floor.floor_id
|
|
</select>
|
|
<select id="SpaceList" resultType="com.bwie.common.domain.Space">
|
|
SELECT * FROM space
|
|
LEFT JOIN client ON space.client_id =client.client_id
|
|
LEFT JOIN room on client.client_id =room.client_id
|
|
</select>
|
|
<select id="floorFindList" resultType="com.bwie.common.domain.Floor">
|
|
select * from floor where floor_start =0
|
|
</select>
|
|
<select id="findByFloorId" resultType="com.bwie.common.domain.Floor">
|
|
select * from floor where floor_id = #{floorId}
|
|
</select>
|
|
<select id="findByclient" resultType="com.bwie.common.domain.Client">
|
|
select * from client
|
|
</select>
|
|
</mapper>
|