|
@@ -10,6 +10,8 @@
|
|
|
<result column="projectId" property="projectId"/>
|
|
|
<result column="projectItemId" property="projectItemId"/>
|
|
|
<result column="projectItemTargetId" property="projectItemTargetId"/>
|
|
|
+ <result column="chargePersonId" property="chargePersonId"/>
|
|
|
+ <result column="chargePersonName" property="chargePersonName"/>
|
|
|
<result column="name" property="name"/>
|
|
|
<result column="roomTypeId" property="roomTypeId"/>
|
|
|
<result column="roomNumber" property="roomNumber"/>
|
|
@@ -32,88 +34,91 @@
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="ProjectItemTargetRoomQuery">
|
|
|
- SELECT * FROM project_item_target_room
|
|
|
+ SELECT a.*, b.name as chargePersonName FROM project_item_target_room a LEFT JOIN mgr_user b ON a.chargePersonId = b.id
|
|
|
</sql>
|
|
|
|
|
|
<select id="get" resultMap="projectItemTargetRoomResult">
|
|
|
<include refid="ProjectItemTargetRoomQuery"/>
|
|
|
- where id=#{id}
|
|
|
+ where a.id=#{id}
|
|
|
</select>
|
|
|
|
|
|
<select id="getProjectItemTargetId" resultMap="projectItemTargetRoomResult">
|
|
|
<include refid="ProjectItemTargetRoomQuery"/>
|
|
|
- where projectItemTargetId=#{projectItemTargetId}
|
|
|
+ where a.projectItemTargetId=#{projectItemTargetId}
|
|
|
</select>
|
|
|
|
|
|
<select id="getProjectItemTargetRoom" resultMap="projectItemTargetRoomResult">
|
|
|
<include refid="ProjectItemTargetRoomQuery"/>
|
|
|
<where>
|
|
|
<if test="id != 0">
|
|
|
- and id = #{id}
|
|
|
+ and a.id = #{id}
|
|
|
</if>
|
|
|
<if test="code != null">
|
|
|
- and code = #{code}
|
|
|
+ and a.code = #{code}
|
|
|
</if>
|
|
|
<if test="projectId != 0">
|
|
|
- and projectId = #{projectId}
|
|
|
+ and a.projectId = #{projectId}
|
|
|
</if>
|
|
|
<if test="projectItemId != 0">
|
|
|
- and projectItemId = #{projectItemId}
|
|
|
+ and a.projectItemId = #{projectItemId}
|
|
|
</if>
|
|
|
<if test="projectItemTargetId != 0">
|
|
|
- and projectItemTargetId = #{projectItemTargetId}
|
|
|
+ and a.projectItemTargetId = #{projectItemTargetId}
|
|
|
</if>
|
|
|
<if test="name != null">
|
|
|
- and name = #{name}
|
|
|
+ and a.name = #{name}
|
|
|
+ </if>
|
|
|
+ <if test="chargePersonId != 0">
|
|
|
+ and a.chargePersonId = #{chargePersonId}
|
|
|
</if>
|
|
|
<if test="roomTypeId != 0">
|
|
|
- and roomTypeId = #{roomTypeId}
|
|
|
+ and a.roomTypeId = #{roomTypeId}
|
|
|
</if>
|
|
|
<if test="roomNumber != null">
|
|
|
- and roomNumber = #{roomNumber}
|
|
|
+ and a.roomNumber = #{roomNumber}
|
|
|
</if>
|
|
|
<if test="roomState != null">
|
|
|
- and roomState = #{roomState}
|
|
|
+ and a.roomState = #{roomState}
|
|
|
</if>
|
|
|
<if test="investmentState != null">
|
|
|
- and investmentState = #{investmentState}
|
|
|
+ and a.investmentState = #{investmentState}
|
|
|
</if>
|
|
|
<if test="invocationDate != null">
|
|
|
- and invocationDate = #{invocationDate}
|
|
|
+ and a.invocationDate = #{invocationDate}
|
|
|
</if>
|
|
|
<if test="decoration != 0">
|
|
|
- and decoration = #{decoration}
|
|
|
+ and a.decoration = #{decoration}
|
|
|
</if>
|
|
|
<if test="propertyCertificateNumber != null">
|
|
|
- and propertyCertificateNumber = #{propertyCertificateNumber}
|
|
|
+ and a.propertyCertificateNumber = #{propertyCertificateNumber}
|
|
|
</if>
|
|
|
<if test="tagIds != null">and
|
|
|
<foreach item="tagId" collection="tagIds.split(',')" open="(" separator=" and " close=")">
|
|
|
- FIND_IN_SET (#{tagId}, tagIds)
|
|
|
+ FIND_IN_SET (#{tagId}, a.tagIds)
|
|
|
</foreach>
|
|
|
</if>
|
|
|
<if test="openState != null">
|
|
|
- and openState = #{openState}
|
|
|
+ and a.openState = #{openState}
|
|
|
</if>
|
|
|
<if test="price != null">
|
|
|
- and price = #{price}
|
|
|
+ and a.price = #{price}
|
|
|
</if>
|
|
|
<if test="payWay != 0">
|
|
|
- and payWay = #{payWay}
|
|
|
+ and a.payWay = #{payWay}
|
|
|
</if>
|
|
|
<if test="payType != 0">
|
|
|
- and payType = #{payType}
|
|
|
+ and a.payType = #{payType}
|
|
|
</if>
|
|
|
<if test="introduce != null">
|
|
|
- and introduce = #{introduce}
|
|
|
+ and a.introduce = #{introduce}
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
|
|
- INSERT INTO project_item_target_room(`projectId`, `projectItemId`, `projectItemTargetId`,`name`, `roomTypeId`, `roomNumber`, `area`, `roomState`, `investmentState`,
|
|
|
+ INSERT INTO project_item_target_room(`projectId`, `projectItemId`, `projectItemTargetId`,`name`, `chargePersonId`, `roomTypeId`, `roomNumber`, `area`, `roomState`, `investmentState`,
|
|
|
`invocationDate`, `decoration`, `propertyCertificateNumber`, `showPicture`, `picture`, `video`, `tagIds`, `openState`, `price`, `payWay`, `payType`, `introduce`, `data`)
|
|
|
- VALUES (#{projectId}, #{projectItemId}, #{projectItemTargetId}, #{name}, #{roomTypeId}, #{roomNumber}, #{area}, #{roomState}, #{investmentState},
|
|
|
+ VALUES (#{projectId}, #{projectItemId}, #{projectItemTargetId}, #{name}, #{chargePersonId}, #{roomTypeId}, #{roomNumber}, #{area}, #{roomState}, #{investmentState},
|
|
|
#{invocationDate}, #{decoration}, #{propertyCertificateNumber}, #{showPicture}, #{picture}, #{video}, #{tagIds}, #{openState}, #{price}, #{payWay}, #{payType}, #{introduce}, #{data})
|
|
|
</insert>
|
|
|
|
|
@@ -143,6 +148,9 @@
|
|
|
<if test="name != null">
|
|
|
and name = #{name}
|
|
|
</if>
|
|
|
+ <if test="chargePersonId != 0">
|
|
|
+ and chargePersonId = #{chargePersonId}
|
|
|
+ </if>
|
|
|
<if test="roomTypeId != 0">
|
|
|
and roomTypeId = #{roomTypeId}
|
|
|
</if>
|
|
@@ -188,63 +196,66 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getLimit" resultMap="projectItemTargetRoomResult">
|
|
|
- SELECT * FROM project_item_target_room
|
|
|
+ <include refid="ProjectItemTargetRoomQuery"/>
|
|
|
<where>
|
|
|
<if test="p.code != null">
|
|
|
- and code = #{p.code}
|
|
|
+ and a.code = #{p.code}
|
|
|
</if>
|
|
|
<if test="p.projectId != 0">
|
|
|
- and projectId = #{p.projectId}
|
|
|
+ and a.projectId = #{p.projectId}
|
|
|
</if>
|
|
|
<if test="p.projectItemId != 0">
|
|
|
- and projectItemId = #{p.projectItemId}
|
|
|
+ and a.projectItemId = #{p.projectItemId}
|
|
|
</if>
|
|
|
<if test="p.projectItemTargetId != 0">
|
|
|
- and projectItemTargetId = #{p.projectItemTargetId}
|
|
|
+ and a.projectItemTargetId = #{p.projectItemTargetId}
|
|
|
</if>
|
|
|
<if test="p.name != null">
|
|
|
- and name = #{p.name}
|
|
|
+ and a.name = #{p.name}
|
|
|
+ </if>
|
|
|
+ <if test="p.chargePersonId != 0">
|
|
|
+ and a.chargePersonId = #{p.chargePersonId}
|
|
|
</if>
|
|
|
<if test="p.roomTypeId != 0">
|
|
|
- and roomTypeId = #{p.roomTypeId}
|
|
|
+ and a.roomTypeId = #{p.roomTypeId}
|
|
|
</if>
|
|
|
<if test="p.roomNumber != null">
|
|
|
- and roomNumber = #{p.roomNumber}
|
|
|
+ and a.roomNumber = #{p.roomNumber}
|
|
|
</if>
|
|
|
<if test="p.roomState != null">
|
|
|
- and roomState = #{p.roomState}
|
|
|
+ and a.roomState = #{p.roomState}
|
|
|
</if>
|
|
|
<if test="p.investmentState != null">
|
|
|
- and investmentState = #{p.investmentState}
|
|
|
+ and a.investmentState = #{p.investmentState}
|
|
|
</if>
|
|
|
<if test="p.invocationDate != null">
|
|
|
- and invocationDate = #{p.invocationDate}
|
|
|
+ and a.invocationDate = #{p.invocationDate}
|
|
|
</if>
|
|
|
<if test="p.decoration != 0">
|
|
|
- and decoration = #{p.decoration}
|
|
|
+ and a.decoration = #{p.decoration}
|
|
|
</if>
|
|
|
<if test="p.propertyCertificateNumber != null">
|
|
|
- and propertyCertificateNumber = #{p.propertyCertificateNumber}
|
|
|
+ and a.propertyCertificateNumber = #{p.propertyCertificateNumber}
|
|
|
</if>
|
|
|
<if test="p.tagIds != null">and
|
|
|
<foreach item="tagId" collection="p.tagIds.split(',')" open="(" separator=" and " close=")">
|
|
|
- FIND_IN_SET (#{tagId}, tagIds)
|
|
|
+ FIND_IN_SET (#{tagId}, a.tagIds)
|
|
|
</foreach>
|
|
|
</if>
|
|
|
<if test="p.openState != null">
|
|
|
- and openState = #{p.openState}
|
|
|
+ and a.openState = #{p.openState}
|
|
|
</if>
|
|
|
<if test="p.price != null">
|
|
|
- and price = #{p.price}
|
|
|
+ and a.price = #{p.price}
|
|
|
</if>
|
|
|
<if test="p.payWay != 0">
|
|
|
- and payWay = #{p.payWay}
|
|
|
+ and a.payWay = #{p.payWay}
|
|
|
</if>
|
|
|
<if test="p.payType != 0">
|
|
|
- and payType = #{p.payType}
|
|
|
+ and a.payType = #{p.payType}
|
|
|
</if>
|
|
|
<if test="p.introduce != null">
|
|
|
- and introduce = #{p.introduce}
|
|
|
+ and a.introduce = #{p.introduce}
|
|
|
</if>
|
|
|
</where>
|
|
|
limit #{currIndex} , #{pageSize}
|
|
@@ -257,6 +268,7 @@
|
|
|
<if test="projectItemId!=0">projectItemId=#{projectItemId},</if>
|
|
|
<if test="projectItemTargetId!=0">projectItemTargetId=#{projectItemTargetId},</if>
|
|
|
<if test="name!=null">name=#{name},</if>
|
|
|
+ <if test="chargePersonId!=0">chargePersonId=#{chargePersonId},</if>
|
|
|
<if test="roomTypeId!=0">roomTypeId=#{roomTypeId},</if>
|
|
|
<if test="roomNumber!=null">roomNumber=#{roomNumber},</if>
|
|
|
<if test="area!=null">area=#{area},</if>
|