123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- <?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.platform.yijia.dao.IntegralOrderMapper">
- <!--返回结果-->
- <resultMap id="BaseResultMap" type="com.platform.yijia.pojo.IntegralOrder">
- <id column="id" jdbcType="INTEGER" property="id" />
- <result column="integral_order_no" jdbcType="VARCHAR" property="integralOrderNo" />
- <result column="wares_type" jdbcType="VARCHAR" property="waresType" />
- <result column="wares_name" jdbcType="VARCHAR" property="waresName" />
- <result column="wares_id" jdbcType="INTEGER" property="waresId" />
- <result column="wares_pic" jdbcType="VARCHAR" property="waresPic" />
- <result column="wares_detail" jdbcType="VARCHAR" property="waresDetail" />
- <result column="union_id" jdbcType="VARCHAR" property="unionId" />
- <result column="customer_name" jdbcType="VARCHAR" property="customerName" />
- <result column="exchange_num" jdbcType="INTEGER" property="exchangeNum" />
- <result column="exchange_time" jdbcType="TIMESTAMP" property="exchangeTime" />
- <result column="status" jdbcType="VARCHAR" property="status" />
- <result column="integral" jdbcType="INTEGER" property="integral" />
- <result column="station_id" jdbcType="INTEGER" property="stationId" />
- </resultMap>
- <!--查询列-->
- <sql id="Base_Column_List">
- id, integral_order_no, wares_type, wares_name, wares_name, wares_id, wares_pic, wares_detail, union_id, customer_name, exchange_num, exchange_time,
- status, integral, station_id
- </sql>
- <!--查询个人积分订单信息-->
- <select id="getUserIntegralOrderList" resultMap="BaseResultMap" parameterType="com.platform.yijia.pojo.IntegralOrder">
- SELECT
- <include refid="Base_Column_List" />
- FROM integral_order
- <where>
- <if test="unionId !=null and unionId !=''">
- union_id = #{unionId}
- </if>
- <if test="stationId !=null and stationId !=''">
- AND station_id = #{stationId}
- </if>
- </where>
- ORDER BY exchange_time DESC
- </select>
- <!--新增积分订单-->
- <insert id="insertIntegralOrder" parameterType="com.platform.yijia.pojo.IntegralOrder">
- INSERT INTO integral_order
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="integralOrderNo !=null">
- integral_order_no,
- </if>
- <if test="waresType !=null">
- wares_type,
- </if>
- <if test="waresName !=null">
- wares_name,
- </if>
- <if test="waresId !=null">
- wares_id,
- </if>
- <if test="waresPic !=null">
- wares_pic,
- </if>
- <if test="waresDetail !=null">
- wares_detail,
- </if>
- <if test="unionId !=null">
- union_id,
- </if>
- <if test="customerName !=null">
- customer_name,
- </if>
- <if test="exchangeNum !=null">
- exchange_num,
- </if>
- <if test="exchangeTime !=null">
- exchange_time,
- </if>
- <if test="status !=null">
- status,
- </if>
- <if test="integral !=null">
- integral,
- </if>
- <if test="stationId !=null">
- station_id,
- </if>
- <if test="stationName !=null">
- station_name,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="integralOrderNo !=null">
- #{integralOrderNo},
- </if>
- <if test="waresType !=null">
- #{waresType},
- </if>
- <if test="waresName !=null">
- #{waresName},
- </if>
- <if test="waresId !=null">
- #{waresId},
- </if>
- <if test="waresPic !=null">
- #{waresPic},
- </if>
- <if test="waresDetail !=null">
- #{waresDetail},
- </if>
- <if test="unionId !=null">
- #{unionId},
- </if>
- <if test="customerName !=null">
- #{customerName},
- </if>
- <if test="exchangeNum !=null">
- #{exchangeNum},
- </if>
- <if test="exchangeTime !=null">
- #{exchangeTime},
- </if>
- <if test="status !=null">
- #{status},
- </if>
- <if test="integral !=null">
- #{integral},
- </if>
- <if test="stationId !=null">
- #{stationId},
- </if>
- <if test="stationName !=null">
- #{stationName},
- </if>
- </trim>
- </insert>
- </mapper>
|