<?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="cn.timer.api.dao.spmk.SpmkKjMapper"> <resultMap id="BaseResultMap" type="cn.timer.api.bean.spmk.SpmkKj" > <id column="id" property="id" /> <result column="name" property="name" /> <result column="type" property="type" /> </resultMap> <sql id="Base_Column_List"> id, name, type </sql> <sql id="Base_Column_List_Alias"> id SpmkKj_id, name SpmkKj_name, type SpmkKj_type </sql> <!-- <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.spmk.SpmkKj"> INSERT INTO spmk_kj <trim prefix="(" suffix=")" suffixOverrides=","> <if test ='null != name'> name, </if> <if test ='null != type'> type </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test ='null != name'> #{name}, </if> <if test ='null != type'> #{type} </if> </trim> </insert> <delete id="delete" > DELETE FROM spmk_kj WHERE id = #{id} </delete> <update id="update" parameterType="cn.timer.api.bean.spmk.SpmkKj"> UPDATE spmk_kj <set> <if test ='null != name'>name = #{name},</if> <if test ='null != type'>type = #{type}</if> </set> WHERE id = #{id} </update> <select id="load" resultMap="BaseResultMap"> SELECT <include refid="Base_Column_List" /> FROM spmk_kj WHERE id = #{id} </select> <select id="pageList" resultMap="BaseResultMap"> SELECT <include refid="Base_Column_List" /> FROM spmk_kj LIMIT #{offset}, #{pageSize} </select> <select id="pageListCount" resultType="java.lang.Integer"> SELECT count(1) FROM spmk_kj </select> --> </mapper>