<?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="me.zhengjie.modules.mnt.mapper.AppMapper">
    <resultMap id="BaseResultMap" type="me.zhengjie.modules.mnt.domain.App">
        <id column="app_id" property="id"/>
        <result column="name" property="name"/>
        <result column="port" property="port"/>
        <result column="upload_path" property="uploadPath"/>
        <result column="deploy_path" property="deployPath"/>
        <result column="backup_path" property="backupPath"/>
        <result column="start_script" property="startScript"/>
        <result column="deploy_script" property="deployScript"/>
        <result column="create_by" property="createBy"/>
        <result column="update_by" property="updateBy"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
    </resultMap>

    <sql id="Base_Column_List">
        app_id,name,port,upload_path,deploy_path,backup_path,start_script,deploy_script,create_by,update_by,create_time,update_time
    </sql>

    <select id="queryAll" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from mnt_app
        <where>
            <if test="criteria.name != null and criteria.name != ''">
                and name like concat('%',#{criteria.name},'%')
            </if>
            <if test="criteria.createTime != null and criteria.createTime.size() > 0">
                and create_time between #{criteria.createTime[0]} and #{criteria.createTime[1]}
            </if>
        </where>
        order by app_id desc
    </select>
</mapper>