<?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.cdslut.propertymanager.dao.LoginDao"> <resultMap id="BaseResultMap" type="com.cdslut.propertymanager.entity"> <id column="id" jdbcType="INTEGER" property="id" /> <result column="stu_name" jdbcType="VARCHAR" property="stuName" /> <result column="stu_age" jdbcType="INTEGER" property="stuAge" /> </resultMap> <sql id="Base_Column_List"> id, stu_name, stu_age </sql> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> select <include refid="Base_Column_List" /> from t_student where id = #{id,jdbcType=INTEGER} </select> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> delete from t_student where id = #{id,jdbcType=INTEGER} </delete> <insert id="insert" parameterType="com.example.springbootworkspace.model.Student"> insert into t_student (id, stu_name, stu_age ) values (#{id,jdbcType=INTEGER}, #{stuName,jdbcType=VARCHAR}, #{stuAge,jdbcType=INTEGER} ) </insert> <insert id="insertSelective" parameterType="com.example.springbootworkspace.model.Student"> insert into t_student <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null"> id, </if> <if test="stuName != null"> stu_name, </if> <if test="stuAge != null"> stu_age, </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null"> #{id,jdbcType=INTEGER}, </if> <if test="stuName != null"> #{stuName,jdbcType=VARCHAR}, </if> <if test="stuAge != null"> #{stuAge,jdbcType=INTEGER}, </if> </trim> </insert> <update id="updateByPrimaryKeySelective" parameterType="com.example.springbootworkspace.model.Student"> update t_student <set> <if test="stuName != null"> stu_name = #{stuName,jdbcType=VARCHAR}, </if> <if test="stuAge != null"> stu_age = #{stuAge,jdbcType=INTEGER}, </if> </set> where id = #{id,jdbcType=INTEGER} </update> <update id="updateByPrimaryKey" parameterType="com.example.springbootworkspace.model.Student"> update t_student set stu_name = #{stuName,jdbcType=VARCHAR}, stu_age = #{stuAge,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER} </update> </mapper>
暂无评论