<?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.QuoteLogMapper">

	<select id="quoteLogs" parameterType="QuoteLog" resultType="QuoteLog">
		SELECT
			quoteId,
			quoteTime,
			quoteIp,
			realname,
			remark,
			brower,
			os,
			shopname
		FROM
			tbl_quote_log
		where
			quoteId > 1600000
		<if test="realname !=null and realname != '' ">
			and realname like '%${realname}%'
		</if>
		<if test="remark !=null and remark != '' ">
			and remark like '%${remark}%'
		</if>
		<if test="shopname !=null and shopname != '' ">
			and shopname like '%${shopname}%'
		</if>
		<if test="price !=null and price != '' ">
			and price >= #{price}
		</if>
		<if test="quoteTimeBegin !=null and quoteTimeBegin != '' ">
			<![CDATA[and quoteTime >= #{quoteTimeBegin} ]]>
		</if>
		<if test="quoteTimeEnd !=null and quoteTimeEnd != '' ">
			 <![CDATA[and quoteTime <= #{quoteTimeEnd} ]]>
		</if>
		ORDER BY quoteId DESC
	</select>


	<insert id="insertSelective" parameterType="QuoteLog">
		INSERT INTO tbl_quote_log
			(
			quoteId,
			quoteIp,
			os,
			realname,
			username,
			brower,
			remark,
			shopname,
			price
			)
		VALUES
			(
			NULL,
			#{quoteIp},
			#{os},
			#{realname},
			#{username},
			#{brower},
			#{remark},
			#{shopname},
			#{price}
			)
	</insert>
</mapper>