<?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.PropertyCompanyMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="propertyCompanyResultMap" type="org.springblade.modules.property.entity.PropertyCompanyEntity">
|
<result column="id" property="id"/>
|
<result column="name" property="name"/>
|
<result column="address" property="address"/>
|
<result column="social_credit_code" property="socialCreditCode"/>
|
<result column="province" property="province"/>
|
<result column="city" property="city"/>
|
<result column="area" property="area"/>
|
<result column="remark" property="remark"/>
|
<result column="create_user" property="createUser"/>
|
<result column="create_time" property="createTime"/>
|
<result column="update_user" property="updateUser"/>
|
<result column="update_time" property="updateTime"/>
|
<result column="is_deleted" property="isDeleted"/>
|
</resultMap>
|
|
<!--自定义分页查询-->
|
<select id="selectPropertyCompanyPage" resultType="org.springblade.modules.property.vo.PropertyCompanyVO">
|
select * from jczz_property_company where is_deleted = 0
|
<if test="propertyCompany.name!=null and propertyCompany.name!=''">
|
and name like concat('%',#{propertyCompany.name},'%')
|
</if>
|
</select>
|
|
<!--物业公司列表查询(不分页)-->
|
<select id="getPropertyCompanyList" resultType="org.springblade.modules.property.vo.PropertyCompanyVO">
|
select * from jczz_property_company where is_deleted = 0
|
<if test="propertyCompany.name!=null and propertyCompany.name!=''">
|
and name like concat('%',#{propertyCompany.name},'%')
|
</if>
|
</select>
|
|
<!--物业公司列表查询(不分页)-->
|
<select id="getUserByPropertyCompany" resultType="java.util.Map">
|
select
|
bu.id,bu.real_name as name
|
from blade_user bu
|
left join blade_dept bd on bd.id = bu.dept_id and bd.is_deleted = 0
|
left join jczz_property_company jpc on jpc.dept_id = bd.id and jpc.is_deleted = 0
|
where bu.is_deleted = 0 and bu.real_name is not null
|
and jpc.id = #{propertyCompany.id}
|
</select>
|
|
<!--查询对应的机构id集合-->
|
<select id="getDeptListByCompanyId" resultType="java.lang.Long">
|
select dept_id from jczz_property_company
|
jpc where is_deleted = 0
|
<choose>
|
<when test="list != null and list.size()>0">
|
and id in
|
<foreach collection="list" item="id" separator ="," open="(" close=")">
|
#{id}
|
</foreach>
|
</when>
|
<otherwise>
|
and id in ('')
|
</otherwise>
|
</choose>
|
</select>
|
|
|
</mapper>
|