标签:include condition rop sele property mybatis ddr com 主键
<insert id="addPerson" parameterType="person">
/* keyColumn 表中的主键列名
keyProperty 实体类中的字段名*/
<selectKey keyColumn="pid" keyProperty="pid" resultType="int" order="AFTER">
select last_insert_id();
</selectKey>
insert person(pname,address)values(#{pname},#{address})
</insert>
<select id="getByCondition3" resultType="person">
<include refid="sel"/> where pname=#{name} and address=#{add}
</select>
<sql id="sel">
select *from person
</sql>
<!--别名-->
<typeAliases>
<typeAlias type="com.ujiuye.bean.PersonBean" alias="person"/>
<typeAlias type="com.ujiuye.bean.StudentBean" alias="student"/>
</typeAliases>
标签:include condition rop sele property mybatis ddr com 主键
原文地址:https://www.cnblogs.com/masterhxh/p/12896618.html