<?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.devplatform.admin.modules.liresource.dao.LiLineDao">
  <!-- Result Map -->
  <resultMap id="BaseResultMap" type="com.devplatform.admin.modules.liresource.bean.LiLine">
    <result column="id" property="id"/>
    <result column="name" property="name"/>
    <result column="code" property="code"/>
    <result column="type" property="type"/>
    <result column="remark" property="remark"/>
    <result column="order_num" property="orderNum"/>
    <result column="status" property="status"/>
    <result column="sys_sign" property="sysSign"/>
    <result column="deleted" property="deleted"/>
    <result column="create_user_id" property="createUserId"/>
    <result column="create_time" property="createTime"/>
    <result column="update_user_id" property="updateUserId"/>
    <result column="update_time" property="updateTime"/>
    <result column="byx1" property="byx1"/>
    <result column="byx2" property="byx2"/>
    <result column="byx3" property="byx3"/>
  </resultMap>

  <!-- li_line table all fields -->
  <sql id="Base_Column_List">
		id,name,code,type,remark,order_num,status,sys_sign,deleted,create_user_id,create_time,update_user_id,update_time,byx1,byx2,byx3
	</sql>

  <!-- 公共查询条件 -->
  <sql id="Example_Where_Clause">
    where deleted=0
    <if test="id!=null and id!=''">and id = #{id}</if>
    <if test="name!=null and name!=''">and name = #{name}</if>
    <if test="code!=null and code!=''">and code = #{code}</if>
    <if test="type!=null ">and type = #{type}</if>
    <if test="remark!=null and remark!=''">and remark = #{remark}</if>
    <if test="orderNum!=null ">and order_num = #{orderNum}</if>
    <if test="status!=null ">and status = #{status}</if>
    <if test="sysSign!=null and sysSign!=''">and sys_sign = #{sysSign}</if>
    <if test="deleted!=null ">and deleted = #{deleted}</if>
    <if test="createUserId!=null and createUserId!=''">and create_user_id = #{createUserId}</if>
    <if test="createTime!=null ">and create_time = #{createTime}</if>
    <if test="updateUserId!=null and updateUserId!=''">and update_user_id = #{updateUserId}</if>
    <if test="updateTime!=null ">and update_time = #{updateTime}</if>
    <if test="byx1!=null and byx1!=''">and byx1 = #{byx1}</if>
    <if test="byx2!=null and byx2!=''">and byx2 = #{byx2}</if>
    <if test="byx3!=null and byx3!=''">and byx3 = #{byx3}</if>
  </sql>

  <!--查询总数-->
  <select id="queryPageByCount" parameterType="Object" resultType="java.lang.Integer">
    select count(1) from li_line
    <include refid="queryPageByListClause"></include>
  </select>

  <select id="queryPageByList" parameterType="Object" resultMap="BaseResultMap">
    select * from li_line
    <include refid="queryPageByListClause"></include>
    <if test="pager.orderCondition != null and pager.orderCondition != ''">
      ${pager.orderCondition}
    </if>
    <if test="pager.mysqlQueryCondition != null and pager.mysqlQueryCondition != ''">
      ${pager.mysqlQueryCondition}
    </if>
  </select>

  <!-- 公共查询条件 -->
  <sql id="queryPageByListClause">
    where deleted=0
    <if test="id!=null and id!=''">and id = #{id}</if>
    <if test="name!=null and name!=''">and name = #{name}</if>
    <if test="code!=null and code!=''">and code = #{code}</if>
    <if test="type!=null ">and type = #{type}</if>
    <if test="remark!=null and remark!=''">and remark = #{remark}</if>
    <if test="orderNum!=null ">and order_num = #{orderNum}</if>
    <if test="status!=null ">and status = #{status}</if>
    <if test="sysSign!=null and sysSign!=''">and sys_sign = #{sysSign}</if>
    <if test="deleted!=null ">and deleted = #{deleted}</if>
    <if test="createUserId!=null and createUserId!=''">and create_user_id = #{createUserId}</if>
    <if test="createTime!=null ">and create_time = #{createTime}</if>
    <if test="updateUserId!=null and updateUserId!=''">and update_user_id = #{updateUserId}</if>
    <if test="updateTime!=null ">and update_time = #{updateTime}</if>
    <if test="byx1!=null and byx1!=''">and byx1 = #{byx1}</if>
    <if test="byx2!=null and byx2!=''">and byx2 = #{byx2}</if>
    <if test="byx3!=null and byx3!=''">and byx3 = #{byx3}</if>
  </sql>

  <select id="getTreeList" parameterType="Object" resultMap="BaseResultMap">
    select id,name,code from li_line
    <include refid="queryPageByListClause"></include>
    order by order_num
  </select>


</mapper>