<?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.SpmkMbMapper"> <resultMap id="BaseResultMap" type="cn.timer.api.bean.spmk.SpmkMb" > <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 SpmkMb_id, name SpmkMb_name, type SpmkMb_type </sql> <!-- <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.spmk.SpmkMb"> INSERT INTO spmk_mb <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_mb WHERE id = #{id} </delete> <update id="update" parameterType="cn.timer.api.bean.spmk.SpmkMb"> UPDATE spmk_mb <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_mb WHERE id = #{id} </select> <select id="pageList" resultMap="BaseResultMap"> SELECT <include refid="Base_Column_List" /> FROM spmk_mb LIMIT #{offset}, #{pageSize} </select> <select id="pageListCount" resultType="java.lang.Integer"> SELECT count(1) FROM spmk_mb </select> --> </mapper>