<?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="org.springblade.modules.property.mapper.PropertyCompanyCommentMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="propertyCompanyCommentResultMap" type="org.springblade.modules.property.vo.PropertyCompanyCommentVO" autoMapping="true">
|
<id property="id" column="id"/>
|
<collection property="children" column="id" javaType="java.util.List"
|
ofType="org.springblade.modules.property.vo.PropertyCompanyCommentVO"
|
autoMapping="true"
|
select="selectPropertyCompanyCommentByParentId">
|
</collection>
|
</resultMap>
|
|
<!--自定义分页查询-->
|
<select id="selectPropertyCompanyCommentPage" resultType="org.springblade.modules.property.vo.PropertyCompanyCommentVO">
|
select
|
jpcc.*,
|
bu.real_name as realName,bu.avatar
|
from jczz_property_company_comment jpcc
|
left join blade_user bu on bu.id = jpcc.create_user
|
where jpcc.is_deleted = 0
|
and jpcc.parent_id = 0
|
<if test="propertyCompanyComment.propertyCompanyId!=null">
|
and jpcc.property_company_id = #{propertyCompanyComment.propertyCompanyId}
|
</if>
|
<if test="propertyCompanyComment.checkStatus!=null">
|
and jpcc.check_status = #{propertyCompanyComment.checkStatus}
|
</if>
|
|
<if test="propertyCompanyComment.createUser!=null">
|
and jpcc.create_user = #{propertyCompanyComment.createUser}
|
</if>
|
</select>
|
|
<!--自定义分页查询(递归)-->
|
<select id="selectPropertyCompanyCommentPageRec" parameterType="long"
|
resultMap="propertyCompanyCommentResultMap">
|
select
|
jpcc.*,
|
bu.real_name as realName,bu.avatar
|
from jczz_property_company_comment jpcc
|
left join blade_user bu on bu.id = jpcc.create_user
|
where jpcc.is_deleted = 0
|
and jpcc.parent_id = 0
|
<if test="propertyCompanyComment.propertyCompanyId!=null">
|
and jpcc.property_company_id = #{propertyCompanyComment.propertyCompanyId}
|
</if>
|
<if test="propertyCompanyComment.checkStatus!=null">
|
and jpcc.check_status = #{propertyCompanyComment.checkStatus}
|
</if>
|
|
<if test="propertyCompanyComment.createUser!=null">
|
and jpcc.create_user = #{propertyCompanyComment.createUser}
|
</if>
|
</select>
|
|
<!--递归查询-->
|
<select id="selectPropertyCompanyCommentByParentId"
|
resultType="org.springblade.modules.property.vo.PropertyCompanyCommentVO">
|
select
|
jpcc.*,
|
bu.real_name as realName,bu.avatar
|
from jczz_property_company_comment jpcc
|
left join blade_user bu on bu.id = jpcc.create_user
|
where jpcc.is_deleted = 0
|
and jpcc.parent_id = #{id}
|
</select>
|
|
</mapper>
|