You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
<?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.example.demo.mapper.RateMapper"> <select id="selectAll" resultType="com.example.demo.domain.vo.RateDetail"> SELECT r.id,r.rate_name rateName,r.num,r.admin_id adminId,r.create_time createTime,r.update_time updateTime FROM rate r </select>
<select id="selectById" resultType="com.example.demo.domain.entity.Rate"> SELECT * FROM rate WHERE id= #{id} </select>
<update id="update"> UPDATE rate <set> <if test="num!=null"> num= #{num}, </if> <if test="rateName!=null and rateName.length>0"> rate_name= #{rateName}, </if> <if test="adminId!=null"> admin_id= #{adminId}, </if> </set> WHERE id=#{id} </update>
<insert id="add"> INSERT INTO rate (rate_name, num, admin_id, create_time) VALUES (#{rateName}, #{num}, #{adminId}, #{createTime}) <selectKey keyProperty="id" resultType="java.lang.Integer" order="AFTER"> SELECT LAST_INSERT_ID() </selectKey> </insert>
</mapper>
|