<?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.izouma.awesomeadmin.dao.TestAaaMapper" >
    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.TestAaa" >
                <id column="id" property="id" jdbcType="INTEGER" />
                                        <result column="del_flag" property="delFlag" jdbcType="CHAR" />
                                <result column="test_name" property="testName" jdbcType="VARCHAR" />
                                <result column="remark" property="remark" jdbcType="VARCHAR" />
            </resultMap>
    <sql id="Base_Column_List" >
            id,            del_flag,            test_name,            remark        </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
        select
        <include refid="Base_Column_List" />
        from test_aaa
        where id = #{id,jdbcType=INTEGER}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
        delete from test_aaa
        where id = #{id,jdbcType=INTEGER}
    </delete>
    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.TestAaa" useGeneratedKeys="true" keyProperty="id">
        insert into test_aaa
        <trim prefix="(" suffix=")" suffixOverrides="," >
                                    <if test="delFlag!= null" >
                del_flag,
            </if>
                                <if test="testName!= null" >
                test_name,
            </if>
                                <if test="remark!= null" >
                remark,
            </if>
                    </trim>
        <trim prefix="values (" suffix=")" suffixOverrides="," >
                                                    <if test="delFlag != null" >
                #{delFlag,jdbcType=CHAR},
            </if>
                                            <if test="testName != null" >
                #{testName,jdbcType=VARCHAR},
            </if>
                                            <if test="remark != null" >
                #{remark,jdbcType=VARCHAR},
            </if>
                            </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.TestAaa" >
        update test_aaa
        <set >
                                                     <if test="delFlag != null" >
               del_flag= #{delFlag,jdbcType=CHAR},
            </if>
                                             <if test="testName != null" >
               test_name= #{testName,jdbcType=VARCHAR},
            </if>
                                             <if test="remark != null" >
               remark= #{remark,jdbcType=VARCHAR},
            </if>
                             </set>
        where id = #{id,jdbcType=INTEGER}
    </update>
    <select id="queryTestAaaByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestAaa">
        select <include refid="Base_Column_List"/> from test_aaa
        <where>
            and del_flag = 'N'
                    <if test="record.id != null and !&quot;&quot;.equals(record.id)">
                and  id = #{record.id}
            </if>
                     <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
                and  del_flag = #{record.delFlag}
            </if>
                     <if test="record.testName != null and !&quot;&quot;.equals(record.testName)">
                and  test_name = #{record.testName}
            </if>
                     <if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
                and  remark = #{record.remark}
            </if>
                 </where>
        order by id desc
    </select>
    <select id="queryAllTestAaa" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestAaa">
        select <include refid="Base_Column_List"/> from test_aaa
        <where>
            and del_flag = 'N'
                    <if test="id != null and !&quot;&quot;.equals(id)">
                and  id = #{id}
            </if>
                    <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
                and  del_flag = #{delFlag}
            </if>
                    <if test="testName != null and !&quot;&quot;.equals(testName)">
                and  test_name = #{testName}
            </if>
                    <if test="remark != null and !&quot;&quot;.equals(remark)">
                and  remark = #{remark}
            </if>
                </where>
        order by id desc
    </select>
    <select id="queryTestAaa" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestAaa">
        select top 1 <include refid="Base_Column_List"/> from test_aaa
        <where>
            and del_flag = 'N'
                    <if test="id != null and !&quot;&quot;.equals(id)">
                and id = #{id}
            </if>
                     <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
                and del_flag = #{delFlag}
            </if>
                     <if test="testName != null and !&quot;&quot;.equals(testName)">
                and test_name = #{testName}
            </if>
                     <if test="remark != null and !&quot;&quot;.equals(remark)">
                and remark = #{remark}
            </if>
         
        </where>
    </select>
    <update id="delete">
        UPDATE test_aaa SET del_flag = 'Y'
        <where>
            AND id = #{id}
        </where>
    </update>
    <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestAaa">
        select <include refid="Base_Column_List"/> from test_aaa
        <where>
            and del_flag = 'N'
                                                                                                                                    </where>
        order by id desc
    </select>
</mapper>

