mapper.system.SysOrderMapper.xml Maven / Gradle / Ivy
<?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.seal.system.mapper.SysOrderMapper"> <resultMap type="SysOrder" id="SysOrderResult"> <result property="orderId" column="order_id" /> <result property="userId" column="user_id" /> <result property="status" column="status" /> <result property="orderNo" column="order_no" /> </resultMap> <sql id="selectSysOrderVo"> select order_id, user_id, status, order_no from sys_order </sql> <select id="selectSysOrderList" parameterType="SysOrder" resultMap="SysOrderResult"> <include refid="selectSysOrderVo"/> </select> <select id="selectSysOrderById" parameterType="Long" resultMap="SysOrderResult"> <include refid="selectSysOrderVo"/> where order_id = #{orderId} </select> <insert id="insertSysOrder" parameterType="SysOrder"> insert into sys_order <trim prefix="(" suffix=")" suffixOverrides=","> <if test="orderId != null">order_id,</if> <if test="userId != null">user_id,</if> <if test="status != null">status,</if> <if test="orderNo != null">order_no,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="orderId != null">#{orderId},</if> <if test="userId != null">#{userId},</if> <if test="status != null">#{status},</if> <if test="orderNo != null">#{orderNo},</if> </trim> </insert> </mapper>
© 2015 - 2024 Weber Informatics LLC | Privacy Policy