<?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.ischoolbar.programmer.dao.admin.LogDao">
	<!-- 日志插入操作 -->
	<insert id="add" parameterType="com.ischoolbar.programmer.entity.admin.Log">
		insert into log(id,content,createTime) values(null,#{content},#{createTime})
	</insert>
	<!-- 日志信息搜索查询 -->
	<select id="findList" parameterType="Map" resultType="com.ischoolbar.programmer.entity.admin.Log">
		select * from log 
		<if test="content != null">
			where content like '%${content}%' 
		</if>
		<if test="offset != null and pageSize != null">
			limit #{offset},#{pageSize}
		</if>
	</select>
	<!-- 模糊搜索总条数 -->
	<select id="getTotal" parameterType="Map" resultType="Integer">
		select count(*) from log 
		<if test="content != null">
			where content like '%${content}%' 
		</if>
	</select>
	<!-- 删除日志信息 -->
	<delete id="delete" parameterType="String">
		delete from log where id in(${value})
	</delete>
</mapper>