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.
323 lines
12 KiB
323 lines
12 KiB
|
3 years ago
|
<?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="cc.hiver.mall.dao.mapper.PurchaseMapper">
|
||
|
|
<resultMap id="BaseResultMap" type="cc.hiver.mall.entity.Purchase">
|
||
|
|
<id column="id" jdbcType="BIGINT" property="id" />
|
||
|
|
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||
|
|
<result column="del_flag" jdbcType="INTEGER" property="delFlag" />
|
||
|
|
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
||
|
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||
|
|
<result column="supplier_id" jdbcType="VARCHAR" property="supplierId" />
|
||
|
|
<result column="shop_id" jdbcType="VARCHAR" property="shopId" />
|
||
|
|
<result column="total_amount" jdbcType="DECIMAL" property="totalAmount" />
|
||
|
|
<result column="should_pay" jdbcType="DECIMAL" property="shouldPay" />
|
||
|
|
<result column="already_pay" jdbcType="DECIMAL" property="alreadyPay" />
|
||
|
|
<result column="no_pay" jdbcType="DECIMAL" property="noPay" />
|
||
|
|
</resultMap>
|
||
|
|
<sql id="Example_Where_Clause">
|
||
|
|
<where>
|
||
|
|
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||
|
|
<if test="criteria.valid">
|
||
|
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||
|
|
<foreach collection="criteria.criteria" item="criterion">
|
||
|
|
<choose>
|
||
|
|
<when test="criterion.noValue">
|
||
|
|
and ${criterion.condition}
|
||
|
|
</when>
|
||
|
|
<when test="criterion.singleValue">
|
||
|
|
and ${criterion.condition} #{criterion.value}
|
||
|
|
</when>
|
||
|
|
<when test="criterion.betweenValue">
|
||
|
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||
|
|
</when>
|
||
|
|
<when test="criterion.listValue">
|
||
|
|
and ${criterion.condition}
|
||
|
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||
|
|
#{listItem}
|
||
|
|
</foreach>
|
||
|
|
</when>
|
||
|
|
</choose>
|
||
|
|
</foreach>
|
||
|
|
</trim>
|
||
|
|
</if>
|
||
|
|
</foreach>
|
||
|
|
</where>
|
||
|
|
</sql>
|
||
|
|
<sql id="Update_By_Example_Where_Clause">
|
||
|
|
<where>
|
||
|
|
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||
|
|
<if test="criteria.valid">
|
||
|
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||
|
|
<foreach collection="criteria.criteria" item="criterion">
|
||
|
|
<choose>
|
||
|
|
<when test="criterion.noValue">
|
||
|
|
and ${criterion.condition}
|
||
|
|
</when>
|
||
|
|
<when test="criterion.singleValue">
|
||
|
|
and ${criterion.condition} #{criterion.value}
|
||
|
|
</when>
|
||
|
|
<when test="criterion.betweenValue">
|
||
|
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||
|
|
</when>
|
||
|
|
<when test="criterion.listValue">
|
||
|
|
and ${criterion.condition}
|
||
|
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||
|
|
#{listItem}
|
||
|
|
</foreach>
|
||
|
|
</when>
|
||
|
|
</choose>
|
||
|
|
</foreach>
|
||
|
|
</trim>
|
||
|
|
</if>
|
||
|
|
</foreach>
|
||
|
|
</where>
|
||
|
|
</sql>
|
||
|
|
<sql id="Base_Column_List">
|
||
|
|
id, create_by, create_time, del_flag, update_by, update_time, supplier_id, shop_id,
|
||
|
|
total_amount, should_pay, already_pay, no_pay
|
||
|
|
</sql>
|
||
|
|
<select id="selectByExample" parameterType="cc.hiver.mall.entity.PurchaseExample" resultMap="BaseResultMap">
|
||
|
|
select
|
||
|
|
<if test="distinct">
|
||
|
|
distinct
|
||
|
|
</if>
|
||
|
|
<include refid="Base_Column_List" />
|
||
|
|
from t_purchase
|
||
|
|
<if test="_parameter != null">
|
||
|
|
<include refid="Example_Where_Clause" />
|
||
|
|
</if>
|
||
|
|
<if test="orderByClause != null">
|
||
|
|
order by ${orderByClause}
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||
|
|
select
|
||
|
|
<include refid="Base_Column_List" />
|
||
|
|
from t_purchase
|
||
|
|
where id = #{id,jdbcType=BIGINT}
|
||
|
|
</select>
|
||
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||
|
|
delete from t_purchase
|
||
|
|
where id = #{id,jdbcType=BIGINT}
|
||
|
|
</delete>
|
||
|
|
<delete id="deleteByExample" parameterType="cc.hiver.mall.entity.PurchaseExample">
|
||
|
|
delete from t_purchase
|
||
|
|
<if test="_parameter != null">
|
||
|
|
<include refid="Example_Where_Clause" />
|
||
|
|
</if>
|
||
|
|
</delete>
|
||
|
|
<insert id="insert" parameterType="cc.hiver.mall.entity.Purchase">
|
||
|
|
insert into t_purchase (id, create_by, create_time,
|
||
|
|
del_flag, update_by, update_time,
|
||
|
|
supplier_id, shop_id, total_amount,
|
||
|
|
should_pay, already_pay, no_pay
|
||
|
|
)
|
||
|
|
values (#{id,jdbcType=BIGINT}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
||
|
|
#{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
|
||
|
|
#{supplierId,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR}, #{totalAmount,jdbcType=DECIMAL},
|
||
|
|
#{shouldPay,jdbcType=DECIMAL}, #{alreadyPay,jdbcType=DECIMAL}, #{noPay,jdbcType=DECIMAL}
|
||
|
|
)
|
||
|
|
</insert>
|
||
|
|
<insert id="insertSelective" parameterType="cc.hiver.mall.entity.Purchase">
|
||
|
|
insert into t_purchase
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="id != null">
|
||
|
|
id,
|
||
|
|
</if>
|
||
|
|
<if test="createBy != null">
|
||
|
|
create_by,
|
||
|
|
</if>
|
||
|
|
<if test="createTime != null">
|
||
|
|
create_time,
|
||
|
|
</if>
|
||
|
|
<if test="delFlag != null">
|
||
|
|
del_flag,
|
||
|
|
</if>
|
||
|
|
<if test="updateBy != null">
|
||
|
|
update_by,
|
||
|
|
</if>
|
||
|
|
<if test="updateTime != null">
|
||
|
|
update_time,
|
||
|
|
</if>
|
||
|
|
<if test="supplierId != null">
|
||
|
|
supplier_id,
|
||
|
|
</if>
|
||
|
|
<if test="shopId != null">
|
||
|
|
shop_id,
|
||
|
|
</if>
|
||
|
|
<if test="totalAmount != null">
|
||
|
|
total_amount,
|
||
|
|
</if>
|
||
|
|
<if test="shouldPay != null">
|
||
|
|
should_pay,
|
||
|
|
</if>
|
||
|
|
<if test="alreadyPay != null">
|
||
|
|
already_pay,
|
||
|
|
</if>
|
||
|
|
<if test="noPay != null">
|
||
|
|
no_pay,
|
||
|
|
</if>
|
||
|
|
</trim>
|
||
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="id != null">
|
||
|
|
#{id,jdbcType=BIGINT},
|
||
|
|
</if>
|
||
|
|
<if test="createBy != null">
|
||
|
|
#{createBy,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="createTime != null">
|
||
|
|
#{createTime,jdbcType=TIMESTAMP},
|
||
|
|
</if>
|
||
|
|
<if test="delFlag != null">
|
||
|
|
#{delFlag,jdbcType=INTEGER},
|
||
|
|
</if>
|
||
|
|
<if test="updateBy != null">
|
||
|
|
#{updateBy,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="updateTime != null">
|
||
|
|
#{updateTime,jdbcType=TIMESTAMP},
|
||
|
|
</if>
|
||
|
|
<if test="supplierId != null">
|
||
|
|
#{supplierId,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="shopId != null">
|
||
|
|
#{shopId,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="totalAmount != null">
|
||
|
|
#{totalAmount,jdbcType=DECIMAL},
|
||
|
|
</if>
|
||
|
|
<if test="shouldPay != null">
|
||
|
|
#{shouldPay,jdbcType=DECIMAL},
|
||
|
|
</if>
|
||
|
|
<if test="alreadyPay != null">
|
||
|
|
#{alreadyPay,jdbcType=DECIMAL},
|
||
|
|
</if>
|
||
|
|
<if test="noPay != null">
|
||
|
|
#{noPay,jdbcType=DECIMAL},
|
||
|
|
</if>
|
||
|
|
</trim>
|
||
|
|
</insert>
|
||
|
|
<select id="countByExample" parameterType="cc.hiver.mall.entity.PurchaseExample" resultType="java.lang.Long">
|
||
|
|
select count(*) from t_purchase
|
||
|
|
<if test="_parameter != null">
|
||
|
|
<include refid="Example_Where_Clause" />
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
<update id="updateByExampleSelective" parameterType="map">
|
||
|
|
update t_purchase
|
||
|
|
<set>
|
||
|
|
<if test="record.id != null">
|
||
|
|
id = #{record.id,jdbcType=BIGINT},
|
||
|
|
</if>
|
||
|
|
<if test="record.createBy != null">
|
||
|
|
create_by = #{record.createBy,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="record.createTime != null">
|
||
|
|
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||
|
|
</if>
|
||
|
|
<if test="record.delFlag != null">
|
||
|
|
del_flag = #{record.delFlag,jdbcType=INTEGER},
|
||
|
|
</if>
|
||
|
|
<if test="record.updateBy != null">
|
||
|
|
update_by = #{record.updateBy,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="record.updateTime != null">
|
||
|
|
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||
|
|
</if>
|
||
|
|
<if test="record.supplierId != null">
|
||
|
|
supplier_id = #{record.supplierId,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="record.shopId != null">
|
||
|
|
shop_id = #{record.shopId,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="record.totalAmount != null">
|
||
|
|
total_amount = #{record.totalAmount,jdbcType=DECIMAL},
|
||
|
|
</if>
|
||
|
|
<if test="record.shouldPay != null">
|
||
|
|
should_pay = #{record.shouldPay,jdbcType=DECIMAL},
|
||
|
|
</if>
|
||
|
|
<if test="record.alreadyPay != null">
|
||
|
|
already_pay = #{record.alreadyPay,jdbcType=DECIMAL},
|
||
|
|
</if>
|
||
|
|
<if test="record.noPay != null">
|
||
|
|
no_pay = #{record.noPay,jdbcType=DECIMAL},
|
||
|
|
</if>
|
||
|
|
</set>
|
||
|
|
<if test="_parameter != null">
|
||
|
|
<include refid="Update_By_Example_Where_Clause" />
|
||
|
|
</if>
|
||
|
|
</update>
|
||
|
|
<update id="updateByExample" parameterType="map">
|
||
|
|
update t_purchase
|
||
|
|
set id = #{record.id,jdbcType=BIGINT},
|
||
|
|
create_by = #{record.createBy,jdbcType=VARCHAR},
|
||
|
|
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||
|
|
del_flag = #{record.delFlag,jdbcType=INTEGER},
|
||
|
|
update_by = #{record.updateBy,jdbcType=VARCHAR},
|
||
|
|
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||
|
|
supplier_id = #{record.supplierId,jdbcType=VARCHAR},
|
||
|
|
shop_id = #{record.shopId,jdbcType=VARCHAR},
|
||
|
|
total_amount = #{record.totalAmount,jdbcType=DECIMAL},
|
||
|
|
should_pay = #{record.shouldPay,jdbcType=DECIMAL},
|
||
|
|
already_pay = #{record.alreadyPay,jdbcType=DECIMAL},
|
||
|
|
no_pay = #{record.noPay,jdbcType=DECIMAL}
|
||
|
|
<if test="_parameter != null">
|
||
|
|
<include refid="Update_By_Example_Where_Clause" />
|
||
|
|
</if>
|
||
|
|
</update>
|
||
|
|
<update id="updateByPrimaryKeySelective" parameterType="cc.hiver.mall.entity.Purchase">
|
||
|
|
update t_purchase
|
||
|
|
<set>
|
||
|
|
<if test="createBy != null">
|
||
|
|
create_by = #{createBy,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="createTime != null">
|
||
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||
|
|
</if>
|
||
|
|
<if test="delFlag != null">
|
||
|
|
del_flag = #{delFlag,jdbcType=INTEGER},
|
||
|
|
</if>
|
||
|
|
<if test="updateBy != null">
|
||
|
|
update_by = #{updateBy,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="updateTime != null">
|
||
|
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||
|
|
</if>
|
||
|
|
<if test="supplierId != null">
|
||
|
|
supplier_id = #{supplierId,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="shopId != null">
|
||
|
|
shop_id = #{shopId,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="totalAmount != null">
|
||
|
|
total_amount = #{totalAmount,jdbcType=DECIMAL},
|
||
|
|
</if>
|
||
|
|
<if test="shouldPay != null">
|
||
|
|
should_pay = #{shouldPay,jdbcType=DECIMAL},
|
||
|
|
</if>
|
||
|
|
<if test="alreadyPay != null">
|
||
|
|
already_pay = #{alreadyPay,jdbcType=DECIMAL},
|
||
|
|
</if>
|
||
|
|
<if test="noPay != null">
|
||
|
|
no_pay = #{noPay,jdbcType=DECIMAL},
|
||
|
|
</if>
|
||
|
|
</set>
|
||
|
|
where id = #{id,jdbcType=BIGINT}
|
||
|
|
</update>
|
||
|
|
<update id="updateByPrimaryKey" parameterType="cc.hiver.mall.entity.Purchase">
|
||
|
|
update t_purchase
|
||
|
|
set create_by = #{createBy,jdbcType=VARCHAR},
|
||
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||
|
|
del_flag = #{delFlag,jdbcType=INTEGER},
|
||
|
|
update_by = #{updateBy,jdbcType=VARCHAR},
|
||
|
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||
|
|
supplier_id = #{supplierId,jdbcType=VARCHAR},
|
||
|
|
shop_id = #{shopId,jdbcType=VARCHAR},
|
||
|
|
total_amount = #{totalAmount,jdbcType=DECIMAL},
|
||
|
|
should_pay = #{shouldPay,jdbcType=DECIMAL},
|
||
|
|
already_pay = #{alreadyPay,jdbcType=DECIMAL},
|
||
|
|
no_pay = #{noPay,jdbcType=DECIMAL}
|
||
|
|
where id = #{id,jdbcType=BIGINT}
|
||
|
|
</update>
|
||
|
|
</mapper>
|