<?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.panzhihua.service_community.dao.ComActColumnDao">
|
|
<resultMap type="com.panzhihua.service_community.entity.ComActColumn" id="ComActColumnBaseResultMap">
|
<result property="id" column="id"/>
|
<result property="name" column="name"/>
|
<result property="createBy" column="create_by"/>
|
<result property="createTime" column="create_time"/>
|
<result property="updateBy" column="update_by"/>
|
<result property="updateTime" column="update_time"/>
|
<result property="status" column="status"/>
|
<result property="type" column="type"/>
|
<result property="description" column="description"/>
|
</resultMap>
|
<select id="pageList" resultType="com.panzhihua.common.model.vos.community.ComActColumnVO">
|
select * from com_act_column
|
<where>
|
1=1
|
<if test="commonPage.type!=null">
|
and type = #{commonPage.type}
|
</if>
|
<if test="commonPage.type != 1">
|
<if test="commonPage.communityId!=null">
|
and community_id = ${commonPage.communityId}
|
</if>
|
<if test="commonPage.streetId!=null">
|
and street_id = #{commonPage.streetId}
|
</if>
|
</if>
|
<if test="commonPage.status!=null">
|
and status =#{commonPage.status}
|
</if>
|
<if test="commonPage.keyword!=null and commonPage.keyword!=''">
|
and name like concat('%',#{commonPage.keyword},'%')
|
</if>
|
<if test="commonPage.name!=null and commonPage.name!=''">
|
and name like concat('%',#{commonPage.name},'%')
|
</if>
|
<if test="commonPage.paramId !=null">
|
and parent_id = #{commonPage.paramId}
|
</if>
|
</where>
|
order by create_time desc
|
</select>
|
|
<resultMap id="levelMap" type="com.panzhihua.common.model.vos.community.ComActColumnLevelVO">
|
<result property="id" column="id"/>
|
<result property="name" column="name"/>
|
<collection property="comActColumnVOList" column="id=parent_id" ofType="com.panzhihua.common.model.vos.community.ComActColumnVO" javaType="java.util.ArrayList">
|
<result property="id" column="sid"/>
|
<result property="name" column="sname"/>
|
</collection>
|
</resultMap>
|
<select id="queryLevel" resultMap="levelMap">
|
select t.id,t.name,t1.id as sid,t1.name as sname from com_act_column t left join com_act_column t1 on t.id =t1.parent_id
|
<where>
|
1=1
|
<if test="type !=null ">
|
and t.type =#{type}
|
</if>
|
<if test="type != 4">
|
<if test="communityId !=null ">
|
and t.community_id =#{communityId}
|
</if>
|
<if test="streetId !=null ">
|
and t.street_id =#{streetId}
|
</if>
|
</if>
|
<if test="parentId !=null">
|
and t.parent_id=#{parentId}
|
</if>
|
</where>
|
order by t.create_time desc
|
</select>
|
|
</mapper>
|