mapper.xml <?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.gj.mapper.InfoManageMapper" > <insert id="add" parameterType="com.gj.model.InfoManage" > insert t_info_manage <include refid="InfoManageSet" /> </insert > <sql id="InfoManageSet"> <set > <if test= "to_user_name != null">to_user_name=#{to_user_name,jdbcType=VARCHAR},</if > </set> </sql > </mapper>
mapper.java package com.gj.mapper; import com.gj.model.InfoManage; public interface InfoManageMapper { public int add(InfoManage infoManage ); }
插入和修改语法一样,你们懂的,程序员这点悟性都没有。。。。
时间: 2024-10-08 16:20:14