1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <?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.CustomerPointsRecordMapper">
- <!--返回结果-->
- <resultMap id="BaseResultMap" type="com.platform.yijia.pojo.CustomerPointsRecord">
- <id column="id" jdbcType="INTEGER" property="id" />
- <result column="union_id" jdbcType="VARCHAR" property="unionId" />
- <result column="customer_name" jdbcType="VARCHAR" property="customerName" />
- <result column="record_type" jdbcType="VARCHAR" property="recordType" />
- <result column="integral" jdbcType="INTEGER" property="integral" />
- <result column="station_id" jdbcType="INTEGER" property="stationId" />
- <result column="station_name" jdbcType="VARCHAR" property="stationName" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- </resultMap>
- <!--查询列-->
- <sql id="Base_Column_List">
- id, union_id, customer_name, record_type, integral, station_id, station_name,
- create_time
- </sql>
- <!--查询客户积分记录信息-->
- <select id="getCustomerPointsRecordList" resultMap="BaseResultMap" parameterType="com.platform.yijia.pojo.CustomerPointsRecord">
- SELECT
- <include refid="Base_Column_List" />
- FROM customer_points_record
- <where>
- <if test="unionId !=null and unionId !=''">
- union_id = #{unionId}
- </if>
- <if test="stationId !=null and stationId !=''">
- AND station_id = #{stationId}
- </if>
- <if test="createTime !=null">
- <![CDATA[ AND create_time >= #{createTime} ]]>
- </if>
- </where>
- ORDER BY create_time DESC
- </select>
- <!--插入客户积分记录表-->
- <insert id="insertCustomerPointsRecordInfo" parameterType="com.platform.yijia.pojo.CustomerPoints">
- INSERT INTO customer_points_record
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="unionId !=null">
- union_id,
- </if>
- <if test="customerName !=null">
- customer_name,
- </if>
- <if test="recordType !=null">
- record_type,
- </if>
- <if test="integral !=null">
- integral,
- </if>
- <if test="stationId !=null">
- station_id,
- </if>
- <if test="stationName !=null">
- station_name,
- </if>
- <if test="createTime !=null">
- create_time,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="unionId !=null">
- #{unionId},
- </if>
- <if test="customerName !=null">
- #{customerName},
- </if>
- <if test="recordType !=null">
- #{recordType},
- </if>
- <if test="integral !=null">
- #{integral},
- </if>
- <if test="stationId !=null">
- #{stationId},
- </if>
- <if test="stationName !=null">
- #{stationName},
- </if>
- <if test="createTime !=null">
- #{createTime},
- </if>
- </trim>
- </insert>
- </mapper>
|