118 lines
4.4 KiB
XML
118 lines
4.4 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.house.mapper.HouseMapper">
|
|
|
|
<select id="findhouselist" resultType="com.bwie.common.domain.House">
|
|
SELECT
|
|
house.*,
|
|
`mode`.mode_name
|
|
FROM
|
|
house
|
|
left join `mode` on house.mode_id=`mode`.mode_id
|
|
<where>
|
|
<if test="startPrice!=null and startPrice!=''">
|
|
and house_monthmoney > #{startPrice}
|
|
</if>
|
|
<if test="endPrice!=null and endPrice!=''">
|
|
and house_monthmoney < #{endPrice}
|
|
</if>
|
|
<if test="modeId!=null and modeId!=''">
|
|
and house.mode_id=#{modeId}
|
|
</if>
|
|
<if test="houseName!=null and houseName!=''">
|
|
and house_name=#{houseName}
|
|
</if>
|
|
</where>
|
|
GROUP BY house.house_id
|
|
</select>
|
|
<select id="findmodeist" resultType="com.bwie.common.domain.Mode">
|
|
select * from mode
|
|
</select>
|
|
<select id="getliveList" resultType="com.bwie.common.domain.Live">
|
|
select * from live
|
|
</select>
|
|
<select id="getrecentmoney" resultType="com.bwie.common.domain.Recent">
|
|
SELECT
|
|
recent.*,
|
|
`user`.user_name,
|
|
`user`.user_sex,
|
|
house.house_name,
|
|
`mode`.mode_name,
|
|
live.live_time
|
|
FROM
|
|
recent
|
|
LEFT JOIN `user` ON recent.user_id = `user`.user_id
|
|
LEFT JOIN house ON recent.house_id = house.house_id
|
|
LEFT JOIN MODE ON house.mode_id = `mode`.mode_id
|
|
LEFT join live ON recent.live_id = live.live_id
|
|
<where>
|
|
<if test="userName!=null and userName!=''">
|
|
and user.user_name =#{userName}
|
|
</if>
|
|
<if test="recentStatus!=null and recentStatus!=''">
|
|
and recent_status=#{recentStatus}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
<select id="findrecenttime" resultType="java.lang.Integer">
|
|
select user_recenttime from user where user_id=#{userId}
|
|
</select>
|
|
<select id="findbyuserId" resultType="com.bwie.common.domain.Recent">
|
|
SELECT
|
|
recent.*,
|
|
`user`.user_name,
|
|
`user`.user_sex,
|
|
house.house_name,
|
|
`mode`.mode_name,
|
|
live.live_time
|
|
FROM
|
|
recent
|
|
LEFT JOIN `user` ON recent.user_id = `user`.user_id
|
|
LEFT JOIN house ON recent.house_id = house.house_id
|
|
LEFT JOIN MODE ON house.mode_id = `mode`.mode_id
|
|
LEFT join live ON recent.live_id = live.live_id
|
|
where user.user_id=#{userId}
|
|
</select>
|
|
<select id="findall" resultType="com.bwie.common.domain.Recent">
|
|
SELECT
|
|
recent.*,
|
|
`user`.user_name,
|
|
`user`.user_sex,
|
|
house.house_name,
|
|
`mode`.mode_name,
|
|
live.live_time
|
|
FROM
|
|
recent
|
|
LEFT JOIN `user` ON recent.user_id = `user`.user_id
|
|
LEFT JOIN house ON recent.house_id = house.house_id
|
|
LEFT JOIN MODE ON house.mode_id = `mode`.mode_id
|
|
LEFT join live ON recent.live_id = live.live_id
|
|
where recent_status=0
|
|
</select>
|
|
<select id="find" resultType="com.bwie.common.domain.User">
|
|
select * from user where user_id=#{userId}
|
|
</select>
|
|
|
|
|
|
<insert id="addrecent">
|
|
INSERT INTO `week2`.`recent`
|
|
(`recent_id`, `user_id`, `apply_time`, `house_id`, `live_id`, `real_price`, `recent_price`, `recent_status`, `recent_content`) VALUES
|
|
(0, #{userId}, now(), #{houseId}, #{liveId}, #{realPrice}, #{recentPrice}, 0, #{recentContent});
|
|
</insert>
|
|
<insert id="insertrecent">
|
|
INSERT INTO `week2`.`recent`
|
|
(`recent_id`, `user_id`, `apply_time`, `house_id`, `live_id`, `real_price`, `recent_price`, `recent_status`, `recent_content`) VALUES
|
|
(0, #{userId}, now(), #{houseId}, #{liveId}, #{realPrice}, #{realPrice}, 0, #{recentContent});
|
|
</insert>
|
|
|
|
<update id="upduser">
|
|
update user set user_recenttime=user_recenttime+1 where user_id =#{userId}
|
|
</update>
|
|
<update id="updstatus">
|
|
update recent set recent_status=1 where user_id=#{userId}
|
|
</update>
|
|
<update id="updstatus1">
|
|
update recent set recent_status=2 where user_id=#{userId}
|
|
</update>
|
|
</mapper>
|