<?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.iemes.mapper.base.BaseMapper">
	<!--mybatis ehcache缓存配置 -->
	<!-- 以下两个<cache>标签二选一,第一个可以输出日志,第二个不输出日志 <cache type="org.mybatis.caches.ehcache.LoggingEhcache" 
		/> -->
	<!-- <cache type="org.mybatis.caches.ehcache.EhcacheCache"/> -->
	<!-- 以下与实体类的中字段一致 -->
	<select id="initTableField" resultType="java.util.HashMap">
		select TABLE_NAME,group_concat(COLUMN_NAME) COLUMN_NAME 
		from information_schema.columns 
		where table_name in (${table_name}) and table_schema in (${database_name})  GROUP BY TABLE_NAME
	</select>
	<select id="findByWhere" resultType="java.util.HashMap">
		select * from table
		
	</select>
	
	<select id="findByAll" resultType="java.util.HashMap">
		select * from table
	</select>

	<select id="findByPage" resultType="java.util.HashMap">
		select * from table
	</select>

	<insert id="addEntity" useGeneratedKeys="true" keyProperty="id">
		insert into (fleids) values (values)
	</insert>
	
	<insert id="batchSave">
		insert into (fleids) values (values),(values),(values)
	</insert>

	<update id="editEntity">
		update table set (${fleids}) where id = (${id})
	</update>
	<!-- 这里的id可以是userid.或其他 -->
	<delete id="deleteByNames">
		delete from table where id in (${ids})
	</delete>

	<select id="findByNames" resultType="java.util.HashMap">
		select * from table where id
		in ()
	</select>

	<select id="findByAttribute" resultType="java.util.HashMap">
		select * from table
		where id in ()
	</select>
	
	<delete id="deleteByAttribute">
		delete from table where id in ()
	</delete>
	
	<select id="findbyFrist" resultType="java.util.HashMap">
		select * from table where id=()
	</select>
</mapper>