<?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.panzhihua.service_equipment.dao.UnionExchangeRecordMapper">
|
<resultMap type="com.panzhihua.service_equipment.model.dos.UnionExchangeRecord" id="UnionExchangeRecordMap">
|
<result property="id" column="id"/>
|
<result property="communityId" column="community_id"/>
|
<result property="createTime" column="create_time"/>
|
<result property="updateTime" column="update_time"/>
|
<result property="userId" column="user_id"/>
|
<result property="orderNum" column="order_num"/>
|
<result property="goodsId" column="goods_id"/>
|
<result property="orderType" column="order_type"/>
|
<result property="consumptionPoints" column="consumption_points"/>
|
<result property="consignee" column="consignee"/>
|
<result property="consigneePhone" column="consignee_phone"/>
|
<result property="consigneeAddress" column="consignee_address"/>
|
<result property="lat" column="lat"/>
|
<result property="lng" column="lng"/>
|
<result property="goodsNum" column="goods_num"/>
|
<result property="logisticsCompany" column="logistics_company"/>
|
<result property="logisticsNum" column="logistics_num"/>
|
<result property="playIntegral" column="play_integral"/>
|
</resultMap>
|
|
<sql id="base_sql">
|
id,
|
order_num,
|
user_id,
|
(select su.name from sys_user as su where su.user_id=union_integral_record.user_id) as usserName,
|
(select su.phone from sys_user as su where su.user_id=union_integral_record.user_id) as phone,
|
goods_id,
|
order_type,
|
consumption_points,
|
consignee,
|
consignee_phone,
|
consignee_address,
|
lat,
|
lng,
|
goods_num,
|
logistics_company,
|
logistics_num,
|
play_integral,
|
community_id
|
create_time,
|
update_time
|
</sql>
|
|
|
<select id="getData" resultMap="UnionExchangeRecordMap">
|
select <include refid="base_sql"/>
|
from union_exchange_record
|
where id=#{id}
|
order by create_time desc
|
</select>
|
|
<select id="getList" resultMap="UnionExchangeRecordMap">
|
select <include refid="base_sql"/>
|
from union_exchange_record
|
<where>
|
1=1
|
<if test="communityId!=null and communityId!='' ">
|
and community_id=#{communityId}
|
</if>
|
<if test="userId!=null and userId!='' ">
|
and user_id=#{userId}
|
</if>
|
</where>
|
order by create_time desc
|
</select>
|
|
<insert id="insert">
|
insert into union_exchange_record
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="item.id != null">
|
id,
|
</if>
|
<if test="item.userId != null">
|
user_id,
|
</if>
|
<if test="item.communityId != null">
|
community_id,
|
</if>
|
<if test="item.orderNum != null">
|
order_num,
|
</if>
|
<if test="item.goodsId != null">
|
goods_id,
|
</if>
|
<if test="item.orderType != null">
|
order_type,
|
</if>
|
<if test="item.consumptionPoints != null">
|
consumption_points,
|
</if>
|
<if test="item.consignee != null">
|
consignee,
|
</if>
|
<if test="item.consigneePhone != null">
|
consignee_phone,
|
</if>
|
<if test="item.consigneeAddress != null">
|
consignee_address,
|
</if>
|
<if test="item.lat != null">
|
lat,
|
</if>
|
<if test="item.lng != null">
|
lng,
|
</if>
|
<if test="item.goodsNum != null">
|
goods_num,
|
</if>
|
<if test="item.logisticsCompany != null">
|
logistics_company,
|
</if>
|
<if test="item.logisticsNum != null">
|
logistics_num,
|
</if>
|
<if test="item.playIntegral != null">
|
play_integral,
|
</if>
|
create_time
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="item.id != null">
|
#{item.id},
|
</if>
|
<if test="item.userId != null">
|
#{item.userId},
|
</if>
|
<if test="item.communityId != null">
|
#{item.communityId},
|
</if>
|
<if test="item.orderNum != null">
|
#{item.orderNum},
|
</if>
|
<if test="item.goodsId != null">
|
#{item.goodsId},
|
</if>
|
<if test="item.orderType != null">
|
#{item.orderType},
|
</if>
|
<if test="item.consumptionPoints != null">
|
#{item.consumptionPoints},
|
</if>
|
<if test="item.consignee != null">
|
#{item.consignee},
|
</if>
|
<if test="item.consigneePhone != null">
|
#{item.consigneePhone},
|
</if>
|
<if test="item.consigneeAddress != null">
|
#{item.consigneeAddress},
|
</if>
|
<if test="item.lat != null">
|
#{item.lat},
|
</if>
|
<if test="item.lng != null">
|
#{item.lng},
|
</if>
|
<if test="item.goodsNum != null">
|
#{item.goodsNum},
|
</if>
|
<if test="item.logisticsCompany != null">
|
#{item.logisticsCompany},
|
</if>
|
<if test="item.logisticsNum != null">
|
#{item.logisticsNum},
|
</if>
|
<if test="item.playIntegral != null">
|
#{item.playIntegral},
|
</if>
|
sysdate()
|
</trim>
|
</insert>
|
|
<update id="update">
|
update union_exchange_record
|
<set>
|
<if test="item.id != null">
|
id=#{item.id},
|
</if>
|
<if test="item.userId != null">
|
user_id=#{item.userId},
|
</if>
|
<if test="item.communityId != null">
|
community_id=#{item.communityId},
|
</if>
|
<if test="item.orderNum != null">
|
order_num=#{item.orderNum},
|
</if>
|
<if test="item.goodsId != null">
|
goods_id=#{item.goodsId},
|
</if>
|
<if test="item.orderType != null">
|
order_type=#{item.orderType},
|
</if>
|
<if test="item.consumptionPoints != null">
|
consumption_points=#{item.consumptionPoints},
|
</if>
|
<if test="item.consignee != null">
|
consignee=#{item.consignee},
|
</if>
|
<if test="item.consigneePhone != null">
|
consignee_phone=#{item.consigneePhone},
|
</if>
|
<if test="item.consigneeAddress != null">
|
consignee_address=#{item.consigneeAddress},
|
</if>
|
<if test="item.lat != null">
|
lat=#{item.lat},
|
</if>
|
<if test="item.lng != null">
|
lng=#{item.lng},
|
</if>
|
<if test="item.goodsNum != null">
|
goods_num=#{item.goodsNum},
|
</if>
|
<if test="item.logisticsCompany != null">
|
logistics_company=#{item.logisticsCompany},
|
</if>
|
<if test="item.logisticsNum != null">
|
logistics_num=#{item.logisticsNum},
|
</if>
|
<if test="item.playIntegral != null">
|
play_integral=#{item.playIntegral},
|
</if>
|
update_time=sysdate()
|
</set>
|
where id = #{item.id}
|
</update>
|
|
<delete id="delete" parameterType="String">
|
delete from union_exchange_record where id=#{id}
|
</delete>
|
|
|
|
|
</mapper>
|