PropertyRoomMapper.xml 1.64 KB
<?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="cn.com.glsx.entmicro.mapper.PropertyRoomMapper">
  <resultMap id="BaseResultMap" type="cn.com.glsx.entmicro.model.PropertyRoom">
    <!--
      WARNING - @mbg.generated
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="pid" jdbcType="INTEGER" property="pid" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="level" jdbcType="VARCHAR" property="level" />
    <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
    <result column="created_by" jdbcType="VARCHAR" property="createdBy" />
    <result column="created_time" jdbcType="TIMESTAMP" property="createdTime" />
    <result column="updated_by" jdbcType="VARCHAR" property="updatedBy" />
    <result column="updated_time" jdbcType="TIMESTAMP" property="updatedTime" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
    -->
    id, pid, `name`, `level`, del_flag, created_by, created_time, updated_by, updated_time
  </sql>

  <select id="page" resultType="cn.com.glsx.entmicro.dto.PropertyRoomDTO">
    SELECT
    id,
    pid,
    name,
    level
    from scrm_property_room
    WHERE del_flag = 0
    <if test="pid != null">
      and pid = #{pid}
    </if>
    <if test="level != null">
      and level = #{level}
    </if>
    <if test="name != null and name != ''">
      and name like concat('%',#{name},'%')
    </if>
    <if test="firstId != null">
      order by id = #{firstId} desc, id asc
    </if>
  </select>
</mapper>