<?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="lingtao.net.dao.BugMapper">
    <select id="getBugs" parameterType="Bug" resultType="Bug">
        SELECT
        *
        FROM
        bug
        <where>
            <if test="createBy !=null and createBy != '' ">
                createBy like '%${createBy}%'
            </if>
        </where>
        ORDER BY id DESC
    </select>


    <insert id="addBug" parameterType="Bug">
        INSERT INTO bug
        (id,
         product,
         bugRemark,
         images,
         createBy,
         createDate)
        VALUES (NULL,
                #{product},
                #{bugRemark},
                #{images},
                #{createBy},
                now())
    </insert>
    <update id="updateBug" parameterType="Bug">
        update bug
        set answer = #{answer}
        where id = #{id}
    </update>
</mapper>