<?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.ty.lift.ud.dataBank.mapper.LiftFaultCodeMapper">
	<resultMap id="BaseResultMap"
		type="cn.com.ty.lift.ud.dataBank.mapper.entity.LiftFaultCodeEntity">
		<id column="id" property="id" jdbcType="INTEGER" />
		<result column="brand_id" property="brandId" jdbcType="INTEGER" />
		<result column="code" property="code"
			jdbcType="VARCHAR" />
		<result column="descr" property="descr"
			jdbcType="VARCHAR" />
		<result column="cause" property="cause"
			jdbcType="VARCHAR" />
		<result column="recovery_method" property="recoveryMethod"
			jdbcType="VARCHAR" />
		<result column="imgs" property="imgs"
			jdbcType="VARCHAR" />
		<result column="sort" property="sort" jdbcType="INTEGER" />
		<result column="topFlag" property="top_flag" jdbcType="INTEGER" />
		<result column="statuz" property="statuz" jdbcType="INTEGER" />
		<result column="create_by" property="createBy"
			jdbcType="VARCHAR" />
		<result column="create_time" property="createTime"
			jdbcType="TIMESTAMP" />
		<result column="update_by" property="updateBy"
			jdbcType="VARCHAR" />
		<result column="update_time" property="updateTime"
			jdbcType="TIMESTAMP" />
	</resultMap>

   <select id="selectByQuery" resultMap="BaseResultMap" >
    SELECT a.* FROM lift_fault_code a LEFT JOIN lift_brand b ON a.brand_id =b.id
    <where>
        ${ew.sqlSegment}
    </where>
    limit #{page.pageIndex},#{page.pageSize}
  </select>
  <select id="countByQuery" resultType="java.lang.Integer">
    select count(0) FROM lift_fault_code a LEFT JOIN lift_brand b ON a.brand_id =b.id
    <where>
        ${ew.sqlSegment}
    </where>
  </select>
</mapper>