123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262 |
- <?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.cdu.lys.graduation.repository.dao.BillDOMapper" >
- <resultMap id="BaseResultMap" type="com.cdu.lys.graduation.repository.entity.BillDO" >
- <constructor >
- <idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="total_order_amount" jdbcType="DOUBLE" javaType="java.lang.Double" />
- <arg column="total_actual_amount" jdbcType="DOUBLE" javaType="java.lang.Double" />
- <arg column="total_cost" jdbcType="DOUBLE" javaType="java.lang.Double" />
- <arg column="net_income" jdbcType="DOUBLE" javaType="java.lang.Double" />
- <arg column="total_number" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="cancel_number" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="bill_date" jdbcType="TIMESTAMP" javaType="java.util.Date" />
- </constructor>
- </resultMap>
- <sql id="Example_Where_Clause" >
- <where >
- <foreach collection="oredCriteria" item="criteria" separator="or" >
- <if test="criteria.valid" >
- <trim prefix="(" suffix=")" prefixOverrides="and" >
- <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 collection="criterion.value" item="listItem" open="(" close=")" 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="(" suffix=")" prefixOverrides="and" >
- <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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Base_Column_List" >
- id, total_order_amount, total_actual_amount, total_cost, net_income, total_number,
- cancel_number, bill_date
- </sql>
- <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.cdu.lys.graduation.repository.entity.BillDOExample" >
- select
- <if test="distinct" >
- distinct
- </if>
- 'true' as QUERYID,
- <include refid="Base_Column_List" />
- from tb_bill
- <if test="_parameter != null" >
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null" >
- order by ${orderByClause}
- </if>
- </select>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from tb_bill
- where id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from tb_bill
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <delete id="deleteByExample" parameterType="com.cdu.lys.graduation.repository.entity.BillDOExample" >
- delete from tb_bill
- <if test="_parameter != null" >
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <insert id="insert" parameterType="com.cdu.lys.graduation.repository.entity.BillDO" >
- <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into tb_bill (total_order_amount, total_actual_amount,
- total_cost, net_income, total_number,
- cancel_number, bill_date)
- values (#{totalOrderAmount,jdbcType=DOUBLE}, #{totalActualAmount,jdbcType=DOUBLE},
- #{totalCost,jdbcType=DOUBLE}, #{netIncome,jdbcType=DOUBLE}, #{totalNumber,jdbcType=INTEGER},
- #{cancelNumber,jdbcType=INTEGER}, #{billDate,jdbcType=TIMESTAMP})
- </insert>
- <insert id="insertSelective" parameterType="com.cdu.lys.graduation.repository.entity.BillDO" >
- <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into tb_bill
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="totalOrderAmount != null" >
- total_order_amount,
- </if>
- <if test="totalActualAmount != null" >
- total_actual_amount,
- </if>
- <if test="totalCost != null" >
- total_cost,
- </if>
- <if test="netIncome != null" >
- net_income,
- </if>
- <if test="totalNumber != null" >
- total_number,
- </if>
- <if test="cancelNumber != null" >
- cancel_number,
- </if>
- <if test="billDate != null" >
- bill_date,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="totalOrderAmount != null" >
- #{totalOrderAmount,jdbcType=DOUBLE},
- </if>
- <if test="totalActualAmount != null" >
- #{totalActualAmount,jdbcType=DOUBLE},
- </if>
- <if test="totalCost != null" >
- #{totalCost,jdbcType=DOUBLE},
- </if>
- <if test="netIncome != null" >
- #{netIncome,jdbcType=DOUBLE},
- </if>
- <if test="totalNumber != null" >
- #{totalNumber,jdbcType=INTEGER},
- </if>
- <if test="cancelNumber != null" >
- #{cancelNumber,jdbcType=INTEGER},
- </if>
- <if test="billDate != null" >
- #{billDate,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.cdu.lys.graduation.repository.entity.BillDOExample" resultType="java.lang.Integer" >
- select count(*) from tb_bill
- <if test="_parameter != null" >
- <include refid="Example_Where_Clause" />
- </if>
- </select>
- <update id="updateByExampleSelective" parameterType="map" >
- update tb_bill
- <set >
- <if test="record.id != null" >
- id = #{record.id,jdbcType=INTEGER},
- </if>
- <if test="record.totalOrderAmount != null" >
- total_order_amount = #{record.totalOrderAmount,jdbcType=DOUBLE},
- </if>
- <if test="record.totalActualAmount != null" >
- total_actual_amount = #{record.totalActualAmount,jdbcType=DOUBLE},
- </if>
- <if test="record.totalCost != null" >
- total_cost = #{record.totalCost,jdbcType=DOUBLE},
- </if>
- <if test="record.netIncome != null" >
- net_income = #{record.netIncome,jdbcType=DOUBLE},
- </if>
- <if test="record.totalNumber != null" >
- total_number = #{record.totalNumber,jdbcType=INTEGER},
- </if>
- <if test="record.cancelNumber != null" >
- cancel_number = #{record.cancelNumber,jdbcType=INTEGER},
- </if>
- <if test="record.billDate != null" >
- bill_date = #{record.billDate,jdbcType=TIMESTAMP},
- </if>
- </set>
- <if test="_parameter != null" >
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByExample" parameterType="map" >
- update tb_bill
- set id = #{record.id,jdbcType=INTEGER},
- total_order_amount = #{record.totalOrderAmount,jdbcType=DOUBLE},
- total_actual_amount = #{record.totalActualAmount,jdbcType=DOUBLE},
- total_cost = #{record.totalCost,jdbcType=DOUBLE},
- net_income = #{record.netIncome,jdbcType=DOUBLE},
- total_number = #{record.totalNumber,jdbcType=INTEGER},
- cancel_number = #{record.cancelNumber,jdbcType=INTEGER},
- bill_date = #{record.billDate,jdbcType=TIMESTAMP}
- <if test="_parameter != null" >
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.cdu.lys.graduation.repository.entity.BillDO" >
- update tb_bill
- <set >
- <if test="totalOrderAmount != null" >
- total_order_amount = #{totalOrderAmount,jdbcType=DOUBLE},
- </if>
- <if test="totalActualAmount != null" >
- total_actual_amount = #{totalActualAmount,jdbcType=DOUBLE},
- </if>
- <if test="totalCost != null" >
- total_cost = #{totalCost,jdbcType=DOUBLE},
- </if>
- <if test="netIncome != null" >
- net_income = #{netIncome,jdbcType=DOUBLE},
- </if>
- <if test="totalNumber != null" >
- total_number = #{totalNumber,jdbcType=INTEGER},
- </if>
- <if test="cancelNumber != null" >
- cancel_number = #{cancelNumber,jdbcType=INTEGER},
- </if>
- <if test="billDate != null" >
- bill_date = #{billDate,jdbcType=TIMESTAMP},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.cdu.lys.graduation.repository.entity.BillDO" >
- update tb_bill
- set total_order_amount = #{totalOrderAmount,jdbcType=DOUBLE},
- total_actual_amount = #{totalActualAmount,jdbcType=DOUBLE},
- total_cost = #{totalCost,jdbcType=DOUBLE},
- net_income = #{netIncome,jdbcType=DOUBLE},
- total_number = #{totalNumber,jdbcType=INTEGER},
- cancel_number = #{cancelNumber,jdbcType=INTEGER},
- bill_date = #{billDate,jdbcType=TIMESTAMP}
- where id = #{id,jdbcType=INTEGER}
- </update>
- </mapper>
|