<?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.ssm.manage.mapper.ServiceOrdersMapper">

    <resultMap type="com.ssm.manage.entity.ServiceOrders" id="BaseResultMap">
        <result property="id" column="id" jdbcType="BIGINT"/>
        <result property="roomId" column="room_id" jdbcType="BIGINT"/>
        <result property="roomNum" column="room_num" jdbcType="VARCHAR"/>
        <result property="roomName" column="room_name" jdbcType="VARCHAR"/>
        <result property="roomHandId" column="room_hand_id" jdbcType="BIGINT"/>
        <result property="serviceStartDate" column="service_start_date" jdbcType="TIMESTAMP"/>
        <result property="cashNumber" column="cash_number" jdbcType="INTEGER"/>
        <result property="memberId" column="member_id" jdbcType="BIGINT"/>
        <result property="memberName" column="member_name" jdbcType="VARCHAR"/>
        <result property="mobilePhone" column="mobile_phone" jdbcType="VARCHAR"/>
        <result property="memberIdentityCard" column="member_identity_card" jdbcType="VARCHAR"/>
        <result property="card" column="card" jdbcType="VARCHAR"/>
        <result property="projectId" column="project_id" jdbcType="BIGINT"/>
        <result property="projectName" column="project_name" jdbcType="VARCHAR"/>
        <result property="storeId" column="store_id" jdbcType="BIGINT"/>
        <result property="storeName" column="store_name" jdbcType="VARCHAR"/>
        <result property="price" column="price" jdbcType="NUMERIC"/>
        <result property="minumumPrice" column="minumum_price" jdbcType="NUMERIC"/>
        <result property="priceMember" column="price_member" jdbcType="NUMERIC"/>
        <result property="minumumPriceMember" column="minumum_price_member" jdbcType="NUMERIC"/>
        <result property="transactionPrice" column="transaction_price" jdbcType="NUMERIC"/>
        <result property="numberTimes" column="number_times" jdbcType="INTEGER"/>
        <result property="amount" column="amount" jdbcType="NUMERIC"/>
        <result property="collectionCashAmount" column="collection_cash_amount" jdbcType="NUMERIC"/>
        <result property="collectionIntegralAmount" column="collection_integral_amount" jdbcType="NUMERIC"/>
        <result property="integral" column="integral" jdbcType="INTEGER"/>
        <result property="giveIntegral" column="give_integral" jdbcType="INTEGER"/>
        <result property="collectionRechargeAmount" column="collection_recharge_amount" jdbcType="NUMERIC"/>
        <result property="collectionGiftAmount" column="collection_gift_amount" jdbcType="DECIMAL"/>
        <result property="cashAmount" column="cash_amount" jdbcType="NUMERIC"/>
        <result property="achievementLarge" column="achievement_large" jdbcType="VARCHAR"/>
        <result property="achievementZhonggong" column="achievement_zhonggong" jdbcType="NUMERIC"/>
        <result property="achievementTechnician" column="achievement_technician" jdbcType="NUMERIC"/>
        <result property="achievementSmall" column="achievement_small" jdbcType="NUMERIC"/>
        <result property="commissionLarge" column="commission_large" jdbcType="NUMERIC"/>
        <result property="commissionZhonggong" column="commission_zhonggong" jdbcType="NUMERIC"/>
        <result property="commissionTechnician" column="commission_technician" jdbcType="NUMERIC"/>
        <result property="commissionSmall" column="commission_small" jdbcType="NUMERIC"/>
        <result property="cardAchievementLarge" column="card_achievement_large" jdbcType="NUMERIC"/>
        <result property="cardAchievementZhonggong" column="card_achievement_zhonggong" jdbcType="NUMERIC"/>
        <result property="cardAchievementTechnician" column="card_achievement_technician" jdbcType="NUMERIC"/>
        <result property="cardAchievementSmall" column="card_achievement_small" jdbcType="NUMERIC"/>
        <result property="cardCommissionLarge" column="card_commission_large" jdbcType="NUMERIC"/>
        <result property="cardCommissionZhonggong" column="card_commission_zhonggong" jdbcType="NUMERIC"/>
        <result property="cardCommissionTechnician" column="card_commission_technician" jdbcType="NUMERIC"/>
        <result property="cardCommissionSmall" column="card_commission_small" jdbcType="NUMERIC"/>
        <result property="technicianOneNumber" column="technician_one_number" jdbcType="VARCHAR"/>
        <result property="serviceTechnicianOneStaffId" column="service_technician_one_staff_id" jdbcType="INTEGER"/>
        <result property="serviceTechnicianOneStaffName" column="service_technician_one_staff_name" jdbcType="VARCHAR"/>
        <result property="serviceTechnicianOneIdentityCard" column="service_technician_one_identity_card" jdbcType="VARCHAR"/>
        <result property="serviceTechnicianOneAchievementAmount" column="service_technician_one_achievement_amount" jdbcType="NUMERIC"/>
        <result property="serviceTechnicianOneCommissionAmount" column="service_technician_one_commission_amount" jdbcType="NUMERIC"/>
        <result property="serviceTechnicianOneRatio" column="service_technician_one_ratio" jdbcType="NUMERIC"/>
        <result property="paymentAmount" column="payment_amount" jdbcType="NUMERIC"/>
        <result property="settlementNum" column="settlement_num" jdbcType="VARCHAR"/>
        <result property="settlementId" column="settlement_id" jdbcType="INTEGER"/>
        <result property="state" column="state" jdbcType="INTEGER"/>
        <result property="order" column="order" jdbcType="INTEGER"/>
        <result property="serviceEndDate" column="service_end_date" jdbcType="TIMESTAMP"/>
        <result property="servicingTime" column="servicing_time" jdbcType="VARCHAR"/>
        <result property="practicalServicingTime" column="practical_servicing_time" jdbcType="VARCHAR"/>
        <result property="inputId" column="input_id" jdbcType="BIGINT"/>
        <result property="inputBy" column="input_by" jdbcType="VARCHAR"/>
        <result property="inputDate" column="input_date" jdbcType="TIMESTAMP"/>
        <result property="updateId" column="update_id" jdbcType="BIGINT"/>
        <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
        <result property="updateDate" column="update_date" jdbcType="TIMESTAMP"/>
        <result property="docDate" column="doc_date" jdbcType="TIMESTAMP"/>
        <result property="docState" column="doc_state" jdbcType="INTEGER"/>
        <result property="renew" column="renew" jdbcType="INTEGER"/>
        <result property="noDiscount" column="no_discount" jdbcType="INTEGER"/>
        <result property="courseAccountId" column="course_account_id" jdbcType="INTEGER"/>
        <result property="overtime" column="overtime" jdbcType="INTEGER"/>
        <result property="overtimeMoney" column="overtime_money" jdbcType="NUMERIC"/>
        <result property="projectNum" column="project_num" jdbcType="VARCHAR"/>
        <result property="grade" column="grade" jdbcType="INTEGER"/>
        <result property="staffNum" column="staff_num" jdbcType="VARCHAR"/>
        <result property="staffName" column="staff_name" jdbcType="VARCHAR"/>
        <result property="brandNumber" column="brand_number" jdbcType="VARCHAR"/>
        <result property="staffId" column="staff_id" jdbcType="BIGINT"/>

        <result property="marketComm" column="market_comm" jdbcType="NUMERIC"/>
        <result property="clockComm" column="clock_comm" jdbcType="NUMERIC"/>
        <result property="roundClockComm" column="round_clock_comm" jdbcType="NUMERIC"/>
        <result property="isClock" column="is_clock" jdbcType="INTEGER"/>
        <result property="man" column="man" jdbcType="INTEGER"/>
        <result property="woman" column="woman" jdbcType="INTEGER"/>
        <result property="projectNature" column="project_nature" jdbcType="INTEGER"/>
        <result property="cardMarketComm" column="card_market_comm" jdbcType="NUMERIC"/>
        <result property="cardClockComm" column="card_clock_comm" jdbcType="NUMERIC"/>
        <result property="cardRoundClockComm" column="card_round_clock_comm" jdbcType="NUMERIC"/>

        <result property="commodityCash" column="commodity_cash" jdbcType="NUMERIC"/>
        <result property="commodityCard" column="commodity_card" jdbcType="NUMERIC"/>
    </resultMap>

    <sql id="BaseColumnList">
        a.id,
        a.room_id,
        a.room_num,
        a.room_name,
        a.room_hand_id,
        a.service_start_date,
        a.cash_number,
        a.member_id,
        a.member_name,
        a.mobile_phone,
        a.member_identity_card,
        a.card,
        a.project_id,
        a.project_name,
        a.store_id,
        a.store_name,
        a.price,
        a.minumum_price,
        a.price_member,
        a.minumum_price_member,
        a.transaction_price,
        a.number_times,
        a.amount,
        a.collection_cash_amount,
        a.collection_integral_amount,
        a.integral,
        a.give_integral,
        a.collection_recharge_amount,
        a.collection_gift_amount,
        a.achievement_large,
        a.achievement_zhonggong,
        a.achievement_technician,
        a.achievement_small,
        a.commission_large,
        a.commission_zhonggong,
        a.commission_technician,
        a.commission_small,
        a.card_achievement_large,
        a.card_achievement_zhonggong,
        a.card_achievement_technician,
        a.card_achievement_small,
        a.card_commission_large,
        a.card_commission_zhonggong,
        a.card_commission_technician,
        a.card_commission_small,
        a.technician_one_number,
        a.service_technician_one_staff_id,
        a.service_technician_one_staff_name,
        a.service_technician_one_identity_card,
        a.service_technician_one_achievement_amount,
        a.service_technician_one_commission_amount,
        a.service_technician_one_ratio,
        a.payment_amount,
        a.settlement_num,
        a.settlement_id,
        a.state,
        a.service_end_date,
        a.servicing_time,
        a.input_id,
        a.input_by,
        a.input_date,
        a.update_id,
        a.update_by,
        a.update_date,
        a.doc_date,
        a.doc_state,
        a.renew,
        a.no_discount,
        a.course_account_id,
        a.overtime,
        a.overtime_money,
        a.project_num,
        a.grade,
        a.staff_num,
        a.staff_name,
        a.brand_number,
        a.staff_id,
        a.market_comm,
        a.clock_comm,
        a.round_clock_comm,
        a.is_clock,
        a.man,
        a.woman,
        a.project_nature,
        a.card_clock_comm,
        a.card_round_clock_comm,
        a.card_market_comm,
        a.commodity_cash,
        a.commodity_card
    </sql>

    <select id="getDocNum" parameterType="com.ssm.manage.query.ServiceOrdersRequest" resultMap="BaseResultMap">
        select <include refid="BaseColumnList" /> from service_orders_${tab} a
        <where>
            <if test="storeId != null">
                and a.store_id = #{storeId,jdbcType = BIGINT}
            </if>
            <if test="selectDate != null">
                and a.settlement_num like concat(#{selectDate,jdbcType = VARCHAR},'%')
            </if>
            <if test="settlementNum != null">
                and a.settlement_num = #{settlementNum,jdbcType = VARCHAR}
            </if>
            <if test="id != null">
                and a.id = #{id,jdbcType = VARCHAR}
            </if>
        </where>
        order by a.settlement_num desc
    </select>

    <select id="getSettsNum" parameterType="com.ssm.manage.query.ServiceOrdersRequest" resultMap="BaseResultMap">
        select <include refid="BaseColumnList" /> from service_orders_${tab} a
        <where>
            <if test="storeId != null">
                and a.store_id = #{storeId,jdbcType = BIGINT}
            </if>
            <if test="settlementNum != null">
                and a.settlement_num = #{settlementNum,jdbcType = VARCHAR}
            </if>
        </where>
        order by a.settlement_num desc
    </select>

    <!--新增所有列-->
    <insert id="addServiceOrders" parameterType="com.ssm.manage.entity.ServiceOrders">
        insert into service_orders_${tab}(id,room_id, room_num, room_name, room_hand_id, service_start_date, cash_number, member_id, member_name, mobile_phone, member_identity_card, card, project_id, project_name, store_id, store_name, price, minumum_price, price_member, minumum_price_member, transaction_price, number_times, amount, collection_cash_amount, collection_integral_amount, integral, give_integral, collection_recharge_amount, collection_gift_amount, cash_amount, achievement_large, achievement_zhonggong, achievement_technician, achievement_small, commission_large, commission_zhonggong, commission_technician, commission_small, card_achievement_large, card_achievement_zhonggong, card_achievement_technician, card_achievement_small, card_commission_large, card_commission_zhonggong, card_commission_technician, card_commission_small, technician_one_number, service_technician_one_staff_id, service_technician_one_staff_name, service_technician_one_identity_card, service_technician_one_achievement_amount, service_technician_one_commission_amount, service_technician_one_ratio, payment_amount, settlement_num, settlement_id, state, service_end_date, servicing_time, input_id, input_by, input_date, update_id, update_by, update_date,doc_date,doc_state,renew,no_discount,course_account_id,overtime, overtime_money,project_num,grade,staff_num,staff_name,brand_number,staff_id,market_comm,clock_comm,round_clock_comm,is_clock,man,woman,project_nature, card_clock_comm, card_round_clock_comm, card_market_comm,commodity_cash,commodity_card)
        values (#{id},#{roomId}, #{roomNum}, #{roomName}, #{roomHandId}, #{serviceStartDate}, #{cashNumber}, #{memberId}, #{memberName}, #{mobilePhone}, #{memberIdentityCard}, #{card}, #{projectId}, #{projectName}, #{storeId}, #{storeName}, #{price}, #{minumumPrice}, #{priceMember}, #{minumumPriceMember}, #{transactionPrice}, #{numberTimes}, #{amount}, #{collectionCashAmount}, #{collectionIntegralAmount}, #{integral}, #{giveIntegral}, #{collectionRechargeAmount}, #{collectionGiftAmount}, #{cashAmount}, #{achievementLarge}, #{achievementZhonggong}, #{achievementTechnician}, #{achievementSmall}, #{commissionLarge}, #{commissionZhonggong}, #{commissionTechnician}, #{commissionSmall}, #{cardAchievementLarge}, #{cardAchievementZhonggong}, #{cardAchievementTechnician}, #{cardAchievementSmall}, #{cardCommissionLarge}, #{cardCommissionZhonggong}, #{cardCommissionTechnician}, #{cardCommissionSmall}, #{technicianOneNumber}, #{serviceTechnicianOneStaffId}, #{serviceTechnicianOneStaffName}, #{serviceTechnicianOneIdentityCard}, #{serviceTechnicianOneAchievementAmount}, #{serviceTechnicianOneCommissionAmount}, #{serviceTechnicianOneRatio}, #{paymentAmount}, #{settlementNum}, #{settlementId}, #{state}, #{serviceEndDate}, #{servicingTime}, #{inputId}, #{inputBy}, #{inputDate}, #{updateId}, #{updateBy}, #{updateDate}, #{docDate}, #{docState}, #{renew}, #{noDiscount}, #{courseAccountId}, #{overtime}, #{overtimeMoney}, #{projectNum}, #{grade}, #{staffNum}, #{staffName}, #{brandNumber}, #{staffId}, #{marketComm}, #{clockComm}, #{roundClockComm}, #{isClock}, #{man}, #{woman}, #{projectNature}, #{cardClockComm}, #{cardRoundClockComm}, #{cardMarketComm}, #{commodityCash}, #{commodityCard})
    </insert>

<!--    修改&作废-->
    <update id="cancelServiceOrders" parameterType="com.ssm.manage.entity.ServiceOrders">
        update service_orders_${tab}
        <set>
            <if test="roomId != null">
                room_id = #{roomId},
            </if>
            <if test="roomNum != null and roomNum != ''">
                room_num = #{roomNum},
            </if>
            <if test="roomName != null and roomName != ''">
                room_name = #{roomName},
            </if>
            <if test="roomHandId != null">
                room_hand_id = #{roomHandId},
            </if>
<!--            <if test="serviceStartDate != null">-->
<!--                service_start_date = #{serviceStartDate},-->
<!--            </if>-->
            <if test="cashNumber != null">
                cash_number = #{cashNumber},
            </if>
            <if test="memberId != null">
                member_id = #{memberId},
            </if>
            <if test="memberName != null and memberName != ''">
                member_name = #{memberName},
            </if>
            <if test="mobilePhone != null and mobilePhone != ''">
                mobile_phone = #{mobilePhone},
            </if>
            <if test="memberIdentityCard != null and memberIdentityCard != ''">
                member_identity_card = #{memberIdentityCard},
            </if>
            <if test="card != null and card != ''">
                card = #{card},
            </if>
            <if test="projectId != null">
                project_id = #{projectId},
            </if>
            <if test="projectName != null and projectName != ''">
                project_name = #{projectName},
            </if>
            <if test="storeId != null">
                store_id = #{storeId},
            </if>
            <if test="storeName != null and storeName != ''">
                store_name = #{storeName},
            </if>
            <if test="price != null">
                price = #{price},
            </if>
            <if test="minumumPrice != null">
                minumum_price = #{minumumPrice},
            </if>
            <if test="priceMember != null">
                price_member = #{priceMember},
            </if>
            <if test="minumumPriceMember != null">
                minumum_price_member = #{minumumPriceMember},
            </if>
            <if test="transactionPrice != null">
                transaction_price = #{transactionPrice},
            </if>
            <if test="numberTimes != null">
                number_times = #{numberTimes},
            </if>
            <if test="amount != null">
                amount = #{amount},
            </if>
            <if test="collectionCashAmount != null">
                collection_cash_amount = #{collectionCashAmount},
            </if>
            <if test="collectionIntegralAmount != null">
                collection_integral_amount = #{collectionIntegralAmount},
            </if>
            <if test="integral != null">
                integral = #{integral},
            </if>
            <if test="giveIntegral != null">
                give_integral = #{giveIntegral},
            </if>
            <if test="collectionRechargeAmount != null">
                collection_recharge_amount = #{collectionRechargeAmount},
            </if>
            <if test="collectionGiftAmount != null">
                collection_gift_amount = #{collectionGiftAmount},
            </if>
            <if test="cashAmount != null">
                cash_amount = #{cashAmount},
            </if>
            <if test="achievementLarge != null">
                achievement_large = #{achievementLarge},
            </if>
            <if test="achievementZhonggong != null">
                achievement_zhonggong = #{achievementZhonggong},
            </if>
            <if test="achievementTechnician != null">
                achievement_technician = #{achievementTechnician},
            </if>
            <if test="achievementSmall != null">
                achievement_small = #{achievementSmall},
            </if>
            <if test="commissionLarge != null">
                commission_large = #{commissionLarge},
            </if>
            <if test="commissionZhonggong != null">
                commission_zhonggong = #{commissionZhonggong},
            </if>
            <if test="commissionTechnician != null">
                commission_technician = #{commissionTechnician},
            </if>
            <if test="commissionSmall != null">
                commission_small = #{commissionSmall},
            </if>
            <if test="cardAchievementLarge != null">
                card_achievement_large = #{cardAchievementLarge},
            </if>
            <if test="cardAchievementZhonggong != null">
                card_achievement_zhonggong = #{cardAchievementZhonggong},
            </if>
            <if test="cardAchievementTechnician != null">
                card_achievement_technician = #{cardAchievementTechnician},
            </if>
            <if test="cardAchievementSmall != null">
                card_achievement_small = #{cardAchievementSmall},
            </if>
            <if test="cardCommissionLarge != null">
                card_commission_large = #{cardCommissionLarge},
            </if>
            <if test="cardCommissionZhonggong != null">
                card_commission_zhonggong = #{cardCommissionZhonggong},
            </if>
            <if test="cardCommissionTechnician != null">
                card_commission_technician = #{cardCommissionTechnician},
            </if>
            <if test="cardCommissionSmall != null">
                card_commission_small = #{cardCommissionSmall},
            </if>
            <if test="technicianOneNumber != null and technicianOneNumber != ''">
                technician_one_number = #{technicianOneNumber},
            </if>
             service_technician_one_staff_id = #{serviceTechnicianOneStaffId},
            service_technician_one_staff_name = #{serviceTechnicianOneStaffName},
                service_technician_one_identity_card = #{serviceTechnicianOneIdentityCard},

                service_technician_one_achievement_amount = #{serviceTechnicianOneAchievementAmount},

                service_technician_one_commission_amount = #{serviceTechnicianOneCommissionAmount},

                service_technician_one_ratio = #{serviceTechnicianOneRatio},
            <if test="paymentAmount != null">
                payment_amount = #{paymentAmount},
            </if>
            <if test="settlementNum != null and settlementNum != ''">
                settlement_num = #{settlementNum},
            </if>
            <if test="settlementId != null">
                settlement_id = #{settlementId},
            </if>
            <if test="state != null">
                state = #{state},
            </if>
            <if test="serviceEndDate != null">
                service_end_date = #{serviceEndDate},
            </if>
            <if test="inputId != null">
                input_id = #{inputId},
            </if>
            <if test="inputBy != null and inputBy != ''">
                input_by = #{inputBy},
            </if>
            <if test="inputDate != null">
                input_date = #{inputDate},
            </if>
            <if test="updateId != null">
                update_id = #{updateId},
            </if>
            <if test="updateBy != null and updateBy != ''">
                update_by = #{updateBy},
            </if>
            <if test="updateDate != null">
                update_date = #{updateDate},
            </if>

<!--            <if test="docDate != null and docDate != ''">-->
<!--                doc_date = #{docDate},-->
<!--            </if>-->
            <if test="docState != null">
                doc_state = #{docState},
            </if>
            <if test="renew != null and renew != ''">
                renew = #{renew},
            </if>
            <if test="noDiscount != null">
                no_discount = #{noDiscount},
            </if>
            <if test="courseAccountId != null">
                course_account_id = #{courseAccountId},
            </if>
            <if test="overtimeMoney != null">
                overtime_money = #{overtimeMoney},
            </if>
            <if test="projectNum != null">
                project_num = #{projectNum},
            </if>
            <if test="grade != null">
                grade = #{grade},
            </if>
                staff_num = #{staffNum},
                staff_name = #{staffName},
                brand_number = #{brandNumber},
                staff_id = #{staffId},

            <if test="marketComm != null and marketComm != ''">
                market_comm = #{marketComm},
            </if>
            <if test="clockComm != null and clockComm != ''">
                clock_comm = #{clockComm},
            </if>
            <if test="roundClockComm != null and roundClockComm != ''">
                round_clock_comm = #{roundClockComm},
            </if>
            <if test="isClock != null">
                is_clock = #{isClock},
            </if>
            <if test="man != null">
                man = #{man},
            </if>
            <if test="woman != null">
                woman = #{woman},
            </if>
            <if test="cardMarketComm != null and cardMarketComm != ''">
                card_market_comm = #{cardMarketComm},
            </if>
            <if test="cardClockComm != null and cardClockComm != ''">
                card_clock_comm = #{cardClockComm},
            </if>
            <if test="cardRoundClockComm != null and cardRoundClockComm != ''">
                card_round_clock_comm = #{cardRoundClockComm},
            </if>
            <if test="projectNature != null and projectNature != ''">
                project_nature = #{projectNature},
            </if>
            <if test="commodityCash != null">
                commodity_cash = #{commodityCash},
            </if>
            <if test="commodityCard != null">
                commodity_card = #{commodityCard},
            </if>
        </set>
        where id = #{id}
    </update>



    <select id="selectGroup" parameterType="com.ssm.manage.query.ServiceOrdersRequest" resultMap="BaseResultMap">
        select MAX(store_id),MAX(store_name) ,SUM(number_times), SUM(collection_cash_amount),SUM(collection_recharge_amount),SUM(collection_cash_amount)+SUM(collection_recharge_amount) ,MAX(cash_number),MAX(member_name),MAX(mobile_phone),settlement_num,MAX(input_date) input_date,MAX(state) state,MAX(doc_date) doc_date
        from service_orders_${tab}
        <where>
            <if test="storeId != null">
                and store_id = #{storeId,jdbcType = BIGINT}
            </if>
            <if test="selectDate != null">
                and settlement_num like concat(#{selectDate,jdbcType = VARCHAR},'%')
            </if>
            <if test="id != null">
                and id = #{id,jdbcType = BIGINT}
            </if>
            <if test="settlementNum != null">
                and settlement_num = #{settlementNum,jdbcType = VARCHAR}
            </if>
        </where>
        group by settlement_num order by input_date,state desc
    </select>

    <select id="selectGroupIsPage" parameterType="com.ssm.manage.query.ServiceOrdersRequest" resultMap="BaseResultMap">
        select MAX(store_id) store_id,MAX(store_name) store_name,SUM(number_times) number_times, SUM(collection_cash_amount) collection_cash_amount,SUM(collection_recharge_amount) collection_recharge_amount,SUM(collection_cash_amount)+SUM(collection_recharge_amount) cash_amount,MAX(cash_number) cash_number,MAX(member_name) member_name,MAX(mobile_phone) mobile_phone,settlement_num,MAX(input_date) input_date,MAX(input_by) input_by,MAX(state) state,MAX(doc_date) doc_date,MAX(id) id
        from service_orders_${tab}
        <where>
            <if test="storeId != null">
                and store_id = #{storeId,jdbcType = BIGINT}
            </if>
            <if test="selectDate != null">
                and settlement_num like concat(#{selectDate,jdbcType = VARCHAR},'%')
            </if>
            <if test="id != null">
                and id = #{id,jdbcType = BIGINT}
            </if>
            <if test="settlementNum != null">
                and settlement_num like concat(#{settlementNum,jdbcType = VARCHAR},'%')
            </if>
            <if test="projectNature != null">
                and project_nature = #{projectNature,jdbcType = VARCHAR}
            </if>
            <if test="memberId != null">
                and member_id = #{memberId,jdbcType =BIGINT}
            </if>
            <if test="mobilePhone != null">
                and mobile_phone = #{mobilePhone,jdbcType =VARCHAR}
            </if>
        </where>
        group by settlement_num order by state,input_date desc limit #{pageNum},#{pageSize}
    </select>

    <select id="selectPage2" parameterType="com.ssm.manage.query.ServiceOrdersRequest" resultMap="BaseResultMap">
        select * from service_orders_${tab} a
        where
        a.store_id = #{storeId,jdbcType = BIGINT}
        <if test="docState != null">
            and a.state = #{docState, jdbcType = INTEGER}
        </if>
        <if test="dateStr != null">
            and a.doc_date like concat( #{dateStr, jdbcType = VARCHAR}, '%')
        </if>
        <if test="projectNature != null">
            and project_nature = #{projectNature,jdbcType = VARCHAR}
        </if>
        order by a.settlement_num desc
    </select>

    <select id="one" parameterType="com.ssm.manage.entity.ServiceOrders" resultMap="BaseResultMap">
        select
            *
        from service_orders_${tab}
        <where>
            <if test="storeId != null">
                and store_id = #{storeId,jdbcType = BIGINT}
            </if>
            <if test="selectDate != null">
                and settlement_num like concat(#{selectDate,jdbcType = VARCHAR},'%')
            </if>
            <if test="id != null">
                and id = #{id,jdbcType = BIGINT}
            </if>
            <if test="settlementNum != null">
                and settlement_num = #{settlementNum,jdbcType = VARCHAR}
            </if>
            <if test="projectNature != null">
                and project_nature = #{projectNature,jdbcType = VARCHAR}
            </if>
        </where>
    </select>

    <!--查询单个-->

    <!--查询指定行数据-->
<!--    <select id="queryAllByLimit" resultMap="BaseResultMap">-->
<!--        select-->
<!--          id, room_id, room_num, room_name, room_hand_id, service_start_date, cash_number, member_id, member_name, mobile_phone, member_identity_card, card, project_id, project_name, store_id, store_name, price, minumum_price, price_member, minumum_price_member, transaction_price, number_times, amount, collection_cash_amount, collection_integral_amount, integral, give_integral, collection_recharge_amount, collection_gift_amount, cash_amount, achievement_large, achievement_zhonggong, achievement_technician, achievement_small, commission_large, commission_zhonggong, commission_technician, commission_small, card_achievement_large, card_achievement_zhonggong, card_achievement_technician, card_achievement_small, card_commission_large, card_commission_zhonggong, card_commission_technician, card_commission_small, technician_one_number, service_technician_one_staff_id, service_technician_one_staff_name, service_technician_one_identity_card, service_technician_one_achievement_amount, service_technician_one_commission_amount, service_technician_one_ratio, payment_amount, settlement_num, settlement_id, state, order, service_end_date, service_time, input_id, input_by, input_date, update_id, update_by, update_date,-->
<!--        from service_orders_202204-->
<!--        <where>-->
<!--            <if test="id != null">-->
<!--                and id = #{id}-->
<!--            </if>-->
<!--            <if test="roomId != null">-->
<!--                and room_id = #{roomId}-->
<!--            </if>-->
<!--            <if test="roomNum != null and roomNum != ''">-->
<!--                and room_num = #{roomNum}-->
<!--            </if>-->
<!--            <if test="roomName != null and roomName != ''">-->
<!--                and room_name = #{roomName}-->
<!--            </if>-->
<!--            <if test="roomHandId != null">-->
<!--                and room_hand_id = #{roomHandId}-->
<!--            </if>-->
<!--            <if test="serviceStartDate != null">-->
<!--                and service_start_date = #{serviceStartDate}-->
<!--            </if>-->
<!--            <if test="cashNumber != null">-->
<!--                and cash_number = #{cashNumber}-->
<!--            </if>-->
<!--            <if test="memberId != null">-->
<!--                and member_id = #{memberId}-->
<!--            </if>-->
<!--            <if test="memberName != null and memberName != ''">-->
<!--                and member_name = #{memberName}-->
<!--            </if>-->
<!--            <if test="mobilePhone != null and mobilePhone != ''">-->
<!--                and mobile_phone = #{mobilePhone}-->
<!--            </if>-->
<!--            <if test="memberIdentityCard != null and memberIdentityCard != ''">-->
<!--                and member_identity_card = #{memberIdentityCard}-->
<!--            </if>-->
<!--            <if test="card != null and card != ''">-->
<!--                and card = #{card}-->
<!--            </if>-->
<!--            <if test="projectId != null">-->
<!--                and project_id = #{projectId}-->
<!--            </if>-->
<!--            <if test="projectName != null and projectName != ''">-->
<!--                and project_name = #{projectName}-->
<!--            </if>-->
<!--            <if test="storeId != null">-->
<!--                and store_id = #{storeId}-->
<!--            </if>-->
<!--            <if test="storeName != null and storeName != ''">-->
<!--                and store_name = #{storeName}-->
<!--            </if>-->
<!--            <if test="price != null">-->
<!--                and price = #{price}-->
<!--            </if>-->
<!--            <if test="minumumPrice != null">-->
<!--                and minumum_price = #{minumumPrice}-->
<!--            </if>-->
<!--            <if test="priceMember != null">-->
<!--                and price_member = #{priceMember}-->
<!--            </if>-->
<!--            <if test="minumumPriceMember != null">-->
<!--                and minumum_price_member = #{minumumPriceMember}-->
<!--            </if>-->
<!--            <if test="transactionPrice != null">-->
<!--                and transaction_price = #{transactionPrice}-->
<!--            </if>-->
<!--            <if test="numberTimes != null">-->
<!--                and number_times = #{numberTimes}-->
<!--            </if>-->
<!--            <if test="amount != null">-->
<!--                and amount = #{amount}-->
<!--            </if>-->
<!--            <if test="collectionCashAmount != null">-->
<!--                and collection_cash_amount = #{collectionCashAmount}-->
<!--            </if>-->
<!--            <if test="collectionIntegralAmount != null">-->
<!--                and collection_integral_amount = #{collectionIntegralAmount}-->
<!--            </if>-->
<!--            <if test="integral != null">-->
<!--                and integral = #{integral}-->
<!--            </if>-->
<!--            <if test="giveIntegral != null">-->
<!--                and give_integral = #{giveIntegral}-->
<!--            </if>-->
<!--            <if test="collectionRechargeAmount != null">-->
<!--                and collection_recharge_amount = #{collectionRechargeAmount}-->
<!--            </if>-->
<!--            <if test="collectionGiftAmount != null">-->
<!--                and collection_gift_amount = #{collectionGiftAmount}-->
<!--            </if>-->
<!--            <if test="cashAmount != null">-->
<!--                and cash_amount = #{cashAmount}-->
<!--            </if>-->
<!--            <if test="achievementLarge != null">-->
<!--                and achievement_large = #{achievementLarge}-->
<!--            </if>-->
<!--            <if test="achievementZhonggong != null">-->
<!--                and achievement_zhonggong = #{achievementZhonggong}-->
<!--            </if>-->
<!--            <if test="achievementTechnician != null">-->
<!--                and achievement_technician = #{achievementTechnician}-->
<!--            </if>-->
<!--            <if test="achievementSmall != null">-->
<!--                and achievement_small = #{achievementSmall}-->
<!--            </if>-->
<!--            <if test="commissionLarge != null">-->
<!--                and commission_large = #{commissionLarge}-->
<!--            </if>-->
<!--            <if test="commissionZhonggong != null">-->
<!--                and commission_zhonggong = #{commissionZhonggong}-->
<!--            </if>-->
<!--            <if test="commissionTechnician != null">-->
<!--                and commission_technician = #{commissionTechnician}-->
<!--            </if>-->
<!--            <if test="commissionSmall != null">-->
<!--                and commission_small = #{commissionSmall}-->
<!--            </if>-->
<!--            <if test="cardAchievementLarge != null">-->
<!--                and card_achievement_large = #{cardAchievementLarge}-->
<!--            </if>-->
<!--            <if test="cardAchievementZhonggong != null">-->
<!--                and card_achievement_zhonggong = #{cardAchievementZhonggong}-->
<!--            </if>-->
<!--            <if test="cardAchievementTechnician != null">-->
<!--                and card_achievement_technician = #{cardAchievementTechnician}-->
<!--            </if>-->
<!--            <if test="cardAchievementSmall != null">-->
<!--                and card_achievement_small = #{cardAchievementSmall}-->
<!--            </if>-->
<!--            <if test="cardCommissionLarge != null">-->
<!--                and card_commission_large = #{cardCommissionLarge}-->
<!--            </if>-->
<!--            <if test="cardCommissionZhonggong != null">-->
<!--                and card_commission_zhonggong = #{cardCommissionZhonggong}-->
<!--            </if>-->
<!--            <if test="cardCommissionTechnician != null">-->
<!--                and card_commission_technician = #{cardCommissionTechnician}-->
<!--            </if>-->
<!--            <if test="cardCommissionSmall != null">-->
<!--                and card_commission_small = #{cardCommissionSmall}-->
<!--            </if>-->
<!--            <if test="technicianOneNumber != null and technicianOneNumber != ''">-->
<!--                and technician_one_number = #{technicianOneNumber}-->
<!--            </if>-->
<!--            <if test="serviceTechnicianOneStaffId != null">-->
<!--                and service_technician_one_staff_id = #{serviceTechnicianOneStaffId}-->
<!--            </if>-->
<!--            <if test="serviceTechnicianOneStaffName != null and serviceTechnicianOneStaffName != ''">-->
<!--                and service_technician_one_staff_name = #{serviceTechnicianOneStaffName}-->
<!--            </if>-->
<!--            <if test="serviceTechnicianOneIdentityCard != null and serviceTechnicianOneIdentityCard != ''">-->
<!--                and service_technician_one_identity_card = #{serviceTechnicianOneIdentityCard}-->
<!--            </if>-->
<!--            <if test="serviceTechnicianOneAchievementAmount != null">-->
<!--                and service_technician_one_achievement_amount = #{serviceTechnicianOneAchievementAmount}-->
<!--            </if>-->
<!--            <if test="serviceTechnicianOneCommissionAmount != null">-->
<!--                and service_technician_one_commission_amount = #{serviceTechnicianOneCommissionAmount}-->
<!--            </if>-->
<!--            <if test="serviceTechnicianOneRatio != null">-->
<!--                and service_technician_one_ratio = #{serviceTechnicianOneRatio}-->
<!--            </if>-->
<!--            <if test="paymentAmount != null">-->
<!--                and payment_amount = #{paymentAmount}-->
<!--            </if>-->
<!--            <if test="settlementNum != null and settlementNum != ''">-->
<!--                and settlement_num = #{settlementNum}-->
<!--            </if>-->
<!--            <if test="settlementId != null">-->
<!--                and settlement_id = #{settlementId}-->
<!--            </if>-->
<!--            <if test="state != null">-->
<!--                and state = #{state}-->
<!--            </if>-->
<!--            <if test="order != null">-->
<!--                and order = #{order}-->
<!--            </if>-->
<!--            <if test="serviceEndDate != null">-->
<!--                and service_end_date = #{serviceEndDate}-->
<!--            </if>-->
<!--            <if test="serviceTime != null and serviceTime != ''">-->
<!--                and service_time = #{serviceTime}-->
<!--            </if>-->
<!--            <if test="inputId != null">-->
<!--                and input_id = #{inputId}-->
<!--            </if>-->
<!--            <if test="inputBy != null and inputBy != ''">-->
<!--                and input_by = #{inputBy}-->
<!--            </if>-->
<!--            <if test="inputDate != null">-->
<!--                and input_date = #{inputDate}-->
<!--            </if>-->
<!--            <if test="updateId != null">-->
<!--                and update_id = #{updateId}-->
<!--            </if>-->
<!--            <if test="updateBy != null and updateBy != ''">-->
<!--                and update_by = #{updateBy}-->
<!--            </if>-->
<!--            <if test="updateDate != null">-->
<!--                and update_date = #{updateDate}-->
<!--            </if>-->
<!--        </where>-->
<!--        limit #{pageable.offset}, #{pageable.pageSize}-->
<!--    </select>-->

    <!--统计总行数-->

<!--    <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">-->
<!--        insert into service_orders_202204(room_id, room_num, room_name, room_hand_id, service_start_date, cash_number, member_id, member_name, mobile_phone, member_identity_card, card, project_id, project_name, store_id, store_name, price, minumum_price, price_member, minumum_price_member, transaction_price, number_times, amount, collection_cash_amount, collection_integral_amount, integral, give_integral, collection_recharge_amount, collection_gift_amount, cash_amount, achievement_large, achievement_zhonggong, achievement_technician, achievement_small, commission_large, commission_zhonggong, commission_technician, commission_small, card_achievement_large, card_achievement_zhonggong, card_achievement_technician, card_achievement_small, card_commission_large, card_commission_zhonggong, card_commission_technician, card_commission_small, technician_one_number, service_technician_one_staff_id, service_technician_one_staff_name, service_technician_one_identity_card, service_technician_one_achievement_amount, service_technician_one_commission_amount, service_technician_one_ratio, payment_amount, settlement_num, settlement_id, state, order, service_end_date, service_time, input_id, input_by, input_date, update_id, update_by, update_date)-->
<!--        values-->
<!--        <foreach collection="entities" item="entity" separator=",">-->
<!--        (#{entity.roomId}, #{entity.roomNum}, #{entity.roomName}, #{entity.roomHandId}, #{entity.serviceStartDate}, #{entity.cashNumber}, #{entity.memberId}, #{entity.memberName}, #{entity.mobilePhone}, #{entity.memberIdentityCard}, #{entity.card}, #{entity.projectId}, #{entity.projectName}, #{entity.storeId}, #{entity.storeName}, #{entity.price}, #{entity.minumumPrice}, #{entity.priceMember}, #{entity.minumumPriceMember}, #{entity.transactionPrice}, #{entity.numberTimes}, #{entity.amount}, #{entity.collectionCashAmount}, #{entity.collectionIntegralAmount}, #{entity.integral}, #{entity.giveIntegral}, #{entity.collectionRechargeAmount}, #{entity.collectionGiftAmount}, #{entity.cashAmount}, #{entity.achievementLarge}, #{entity.achievementZhonggong}, #{entity.achievementTechnician}, #{entity.achievementSmall}, #{entity.commissionLarge}, #{entity.commissionZhonggong}, #{entity.commissionTechnician}, #{entity.commissionSmall}, #{entity.cardAchievementLarge}, #{entity.cardAchievementZhonggong}, #{entity.cardAchievementTechnician}, #{entity.cardAchievementSmall}, #{entity.cardCommissionLarge}, #{entity.cardCommissionZhonggong}, #{entity.cardCommissionTechnician}, #{entity.cardCommissionSmall}, #{entity.technicianOneNumber}, #{entity.serviceTechnicianOneStaffId}, #{entity.serviceTechnicianOneStaffName}, #{entity.serviceTechnicianOneIdentityCard}, #{entity.serviceTechnicianOneAchievementAmount}, #{entity.serviceTechnicianOneCommissionAmount}, #{entity.serviceTechnicianOneRatio}, #{entity.paymentAmount}, #{entity.settlementNum}, #{entity.settlementId}, #{entity.state}, #{entity.order}, #{entity.serviceEndDate}, #{entity.serviceTime}, #{entity.inputId}, #{entity.inputBy}, #{entity.inputDate}, #{entity.updateId}, #{entity.updateBy}, #{entity.updateDate})-->
<!--        </foreach>-->
<!--    </insert>-->

<!--    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">-->
<!--        insert into service_orders_202204(room_id, room_num, room_name, room_hand_id, service_start_date, cash_number, member_id, member_name, mobile_phone, member_identity_card, card, project_id, project_name, store_id, store_name, price, minumum_price, price_member, minumum_price_member, transaction_price, number_times, amount, collection_cash_amount, collection_integral_amount, integral, give_integral, collection_recharge_amount, collection_gift_amount, cash_amount, achievement_large, achievement_zhonggong, achievement_technician, achievement_small, commission_large, commission_zhonggong, commission_technician, commission_small, card_achievement_large, card_achievement_zhonggong, card_achievement_technician, card_achievement_small, card_commission_large, card_commission_zhonggong, card_commission_technician, card_commission_small, technician_one_number, service_technician_one_staff_id, service_technician_one_staff_name, service_technician_one_identity_card, service_technician_one_achievement_amount, service_technician_one_commission_amount, service_technician_one_ratio, payment_amount, settlement_num, settlement_id, state, order, service_end_date, service_time, input_id, input_by, input_date, update_id, update_by, update_date)-->
<!--        values-->
<!--        <foreach collection="entities" item="entity" separator=",">-->
<!--            (#{entity.roomId}, #{entity.roomNum}, #{entity.roomName}, #{entity.roomHandId}, #{entity.serviceStartDate}, #{entity.cashNumber}, #{entity.memberId}, #{entity.memberName}, #{entity.mobilePhone}, #{entity.memberIdentityCard}, #{entity.card}, #{entity.projectId}, #{entity.projectName}, #{entity.storeId}, #{entity.storeName}, #{entity.price}, #{entity.minumumPrice}, #{entity.priceMember}, #{entity.minumumPriceMember}, #{entity.transactionPrice}, #{entity.numberTimes}, #{entity.amount}, #{entity.collectionCashAmount}, #{entity.collectionIntegralAmount}, #{entity.integral}, #{entity.giveIntegral}, #{entity.collectionRechargeAmount}, #{entity.collectionGiftAmount}, #{entity.cashAmount}, #{entity.achievementLarge}, #{entity.achievementZhonggong}, #{entity.achievementTechnician}, #{entity.achievementSmall}, #{entity.commissionLarge}, #{entity.commissionZhonggong}, #{entity.commissionTechnician}, #{entity.commissionSmall}, #{entity.cardAchievementLarge}, #{entity.cardAchievementZhonggong}, #{entity.cardAchievementTechnician}, #{entity.cardAchievementSmall}, #{entity.cardCommissionLarge}, #{entity.cardCommissionZhonggong}, #{entity.cardCommissionTechnician}, #{entity.cardCommissionSmall}, #{entity.technicianOneNumber}, #{entity.serviceTechnicianOneStaffId}, #{entity.serviceTechnicianOneStaffName}, #{entity.serviceTechnicianOneIdentityCard}, #{entity.serviceTechnicianOneAchievementAmount}, #{entity.serviceTechnicianOneCommissionAmount}, #{entity.serviceTechnicianOneRatio}, #{entity.paymentAmount}, #{entity.settlementNum}, #{entity.settlementId}, #{entity.state}, #{entity.order}, #{entity.serviceEndDate}, #{entity.serviceTime}, #{entity.inputId}, #{entity.inputBy}, #{entity.inputDate}, #{entity.updateId}, #{entity.updateBy}, #{entity.updateDate})-->
<!--        </foreach>-->
<!--        on duplicate key update-->
<!--        room_id = values(room_id),-->
<!--        room_num = values(room_num),-->
<!--        room_name = values(room_name),-->
<!--        room_hand_id = values(room_hand_id),-->
<!--        service_start_date = values(service_start_date),-->
<!--        cash_number = values(cash_number),-->
<!--        member_id = values(member_id),-->
<!--        member_name = values(member_name),-->
<!--        mobile_phone = values(mobile_phone),-->
<!--        member_identity_card = values(member_identity_card),-->
<!--        card = values(card),-->
<!--        project_id = values(project_id),-->
<!--        project_name = values(project_name),-->
<!--        store_id = values(store_id),-->
<!--        store_name = values(store_name),-->
<!--        price = values(price),-->
<!--        minumum_price = values(minumum_price),-->
<!--        price_member = values(price_member),-->
<!--        minumum_price_member = values(minumum_price_member),-->
<!--        transaction_price = values(transaction_price),-->
<!--        number_times = values(number_times),-->
<!--        amount = values(amount),-->
<!--        collection_cash_amount = values(collection_cash_amount),-->
<!--        collection_integral_amount = values(collection_integral_amount),-->
<!--        integral = values(integral),-->
<!--        give_integral = values(give_integral),-->
<!--        collection_recharge_amount = values(collection_recharge_amount),-->
<!--        collection_gift_amount = values(collection_gift_amount),-->
<!--        cash_amount = values(cash_amount),-->
<!--        achievement_large = values(achievement_large),-->
<!--        achievement_zhonggong = values(achievement_zhonggong),-->
<!--        achievement_technician = values(achievement_technician),-->
<!--        achievement_small = values(achievement_small),-->
<!--        commission_large = values(commission_large),-->
<!--        commission_zhonggong = values(commission_zhonggong),-->
<!--        commission_technician = values(commission_technician),-->
<!--        commission_small = values(commission_small),-->
<!--        card_achievement_large = values(card_achievement_large),-->
<!--        card_achievement_zhonggong = values(card_achievement_zhonggong),-->
<!--        card_achievement_technician = values(card_achievement_technician),-->
<!--        card_achievement_small = values(card_achievement_small),-->
<!--        card_commission_large = values(card_commission_large),-->
<!--        card_commission_zhonggong = values(card_commission_zhonggong),-->
<!--        card_commission_technician = values(card_commission_technician),-->
<!--        card_commission_small = values(card_commission_small),-->
<!--        technician_one_number = values(technician_one_number),-->
<!--        service_technician_one_staff_id = values(service_technician_one_staff_id),-->
<!--        service_technician_one_staff_name = values(service_technician_one_staff_name),-->
<!--        service_technician_one_identity_card = values(service_technician_one_identity_card),-->
<!--        service_technician_one_achievement_amount = values(service_technician_one_achievement_amount),-->
<!--        service_technician_one_commission_amount = values(service_technician_one_commission_amount),-->
<!--        service_technician_one_ratio = values(service_technician_one_ratio),-->
<!--        payment_amount = values(payment_amount),-->
<!--        settlement_num = values(settlement_num),-->
<!--        settlement_id = values(settlement_id),-->
<!--        state = values(state),-->
<!--        order = values(order),-->
<!--        service_end_date = values(service_end_date),-->
<!--        service_time = values(service_time),-->
<!--        input_id = values(input_id),-->
<!--        input_by = values(input_by),-->
<!--        input_date = values(input_date),-->
<!--        update_id = values(update_id),-->
<!--        update_by = values(update_by),-->
<!--        update_date = values(update_date)-->
<!--    </insert>-->

<!--    &lt;!&ndash;通过主键修改数据&ndash;&gt;-->
<!--    <update id="update">-->
<!--        update service_orders_202204-->
<!--        <set>-->
<!--            <if test="roomId != null">-->
<!--                room_id = #{roomId},-->
<!--            </if>-->
<!--            <if test="roomNum != null and roomNum != ''">-->
<!--                room_num = #{roomNum},-->
<!--            </if>-->
<!--            <if test="roomName != null and roomName != ''">-->
<!--                room_name = #{roomName},-->
<!--            </if>-->
<!--            <if test="roomHandId != null">-->
<!--                room_hand_id = #{roomHandId},-->
<!--            </if>-->
<!--            <if test="serviceStartDate != null">-->
<!--                service_start_date = #{serviceStartDate},-->
<!--            </if>-->
<!--            <if test="cashNumber != null">-->
<!--                cash_number = #{cashNumber},-->
<!--            </if>-->
<!--            <if test="memberId != null">-->
<!--                member_id = #{memberId},-->
<!--            </if>-->
<!--            <if test="memberName != null and memberName != ''">-->
<!--                member_name = #{memberName},-->
<!--            </if>-->
<!--            <if test="mobilePhone != null and mobilePhone != ''">-->
<!--                mobile_phone = #{mobilePhone},-->
<!--            </if>-->
<!--            <if test="memberIdentityCard != null and memberIdentityCard != ''">-->
<!--                member_identity_card = #{memberIdentityCard},-->
<!--            </if>-->
<!--            <if test="card != null and card != ''">-->
<!--                card = #{card},-->
<!--            </if>-->
<!--            <if test="projectId != null">-->
<!--                project_id = #{projectId},-->
<!--            </if>-->
<!--            <if test="projectName != null and projectName != ''">-->
<!--                project_name = #{projectName},-->
<!--            </if>-->
<!--            <if test="storeId != null">-->
<!--                store_id = #{storeId},-->
<!--            </if>-->
<!--            <if test="storeName != null and storeName != ''">-->
<!--                store_name = #{storeName},-->
<!--            </if>-->
<!--            <if test="price != null">-->
<!--                price = #{price},-->
<!--            </if>-->
<!--            <if test="minumumPrice != null">-->
<!--                minumum_price = #{minumumPrice},-->
<!--            </if>-->
<!--            <if test="priceMember != null">-->
<!--                price_member = #{priceMember},-->
<!--            </if>-->
<!--            <if test="minumumPriceMember != null">-->
<!--                minumum_price_member = #{minumumPriceMember},-->
<!--            </if>-->
<!--            <if test="transactionPrice != null">-->
<!--                transaction_price = #{transactionPrice},-->
<!--            </if>-->
<!--            <if test="numberTimes != null">-->
<!--                number_times = #{numberTimes},-->
<!--            </if>-->
<!--            <if test="amount != null">-->
<!--                amount = #{amount},-->
<!--            </if>-->
<!--            <if test="collectionCashAmount != null">-->
<!--                collection_cash_amount = #{collectionCashAmount},-->
<!--            </if>-->
<!--            <if test="collectionIntegralAmount != null">-->
<!--                collection_integral_amount = #{collectionIntegralAmount},-->
<!--            </if>-->
<!--            <if test="integral != null">-->
<!--                integral = #{integral},-->
<!--            </if>-->
<!--            <if test="giveIntegral != null">-->
<!--                give_integral = #{giveIntegral},-->
<!--            </if>-->
<!--            <if test="collectionRechargeAmount != null">-->
<!--                collection_recharge_amount = #{collectionRechargeAmount},-->
<!--            </if>-->
<!--            <if test="collectionGiftAmount != null">-->
<!--                collection_gift_amount = #{collectionGiftAmount},-->
<!--            </if>-->
<!--            <if test="cashAmount != null">-->
<!--                cash_amount = #{cashAmount},-->
<!--            </if>-->
<!--            <if test="achievementLarge != null">-->
<!--                achievement_large = #{achievementLarge},-->
<!--            </if>-->
<!--            <if test="achievementZhonggong != null">-->
<!--                achievement_zhonggong = #{achievementZhonggong},-->
<!--            </if>-->
<!--            <if test="achievementTechnician != null">-->
<!--                achievement_technician = #{achievementTechnician},-->
<!--            </if>-->
<!--            <if test="achievementSmall != null">-->
<!--                achievement_small = #{achievementSmall},-->
<!--            </if>-->
<!--            <if test="commissionLarge != null">-->
<!--                commission_large = #{commissionLarge},-->
<!--            </if>-->
<!--            <if test="commissionZhonggong != null">-->
<!--                commission_zhonggong = #{commissionZhonggong},-->
<!--            </if>-->
<!--            <if test="commissionTechnician != null">-->
<!--                commission_technician = #{commissionTechnician},-->
<!--            </if>-->
<!--            <if test="commissionSmall != null">-->
<!--                commission_small = #{commissionSmall},-->
<!--            </if>-->
<!--            <if test="cardAchievementLarge != null">-->
<!--                card_achievement_large = #{cardAchievementLarge},-->
<!--            </if>-->
<!--            <if test="cardAchievementZhonggong != null">-->
<!--                card_achievement_zhonggong = #{cardAchievementZhonggong},-->
<!--            </if>-->
<!--            <if test="cardAchievementTechnician != null">-->
<!--                card_achievement_technician = #{cardAchievementTechnician},-->
<!--            </if>-->
<!--            <if test="cardAchievementSmall != null">-->
<!--                card_achievement_small = #{cardAchievementSmall},-->
<!--            </if>-->
<!--            <if test="cardCommissionLarge != null">-->
<!--                card_commission_large = #{cardCommissionLarge},-->
<!--            </if>-->
<!--            <if test="cardCommissionZhonggong != null">-->
<!--                card_commission_zhonggong = #{cardCommissionZhonggong},-->
<!--            </if>-->
<!--            <if test="cardCommissionTechnician != null">-->
<!--                card_commission_technician = #{cardCommissionTechnician},-->
<!--            </if>-->
<!--            <if test="cardCommissionSmall != null">-->
<!--                card_commission_small = #{cardCommissionSmall},-->
<!--            </if>-->
<!--            <if test="technicianOneNumber != null and technicianOneNumber != ''">-->
<!--                technician_one_number = #{technicianOneNumber},-->
<!--            </if>-->
<!--            <if test="serviceTechnicianOneStaffId != null">-->
<!--                service_technician_one_staff_id = #{serviceTechnicianOneStaffId},-->
<!--            </if>-->
<!--            <if test="serviceTechnicianOneStaffName != null and serviceTechnicianOneStaffName != ''">-->
<!--                service_technician_one_staff_name = #{serviceTechnicianOneStaffName},-->
<!--            </if>-->
<!--            <if test="serviceTechnicianOneIdentityCard != null and serviceTechnicianOneIdentityCard != ''">-->
<!--                service_technician_one_identity_card = #{serviceTechnicianOneIdentityCard},-->
<!--            </if>-->
<!--            <if test="serviceTechnicianOneAchievementAmount != null">-->
<!--                service_technician_one_achievement_amount = #{serviceTechnicianOneAchievementAmount},-->
<!--            </if>-->
<!--            <if test="serviceTechnicianOneCommissionAmount != null">-->
<!--                service_technician_one_commission_amount = #{serviceTechnicianOneCommissionAmount},-->
<!--            </if>-->
<!--            <if test="serviceTechnicianOneRatio != null">-->
<!--                service_technician_one_ratio = #{serviceTechnicianOneRatio},-->
<!--            </if>-->
<!--            <if test="paymentAmount != null">-->
<!--                payment_amount = #{paymentAmount},-->
<!--            </if>-->
<!--            <if test="settlementNum != null and settlementNum != ''">-->
<!--                settlement_num = #{settlementNum},-->
<!--            </if>-->
<!--            <if test="settlementId != null">-->
<!--                settlement_id = #{settlementId},-->
<!--            </if>-->
<!--            <if test="state != null">-->
<!--                state = #{state},-->
<!--            </if>-->
<!--            <if test="order != null">-->
<!--                order = #{order},-->
<!--            </if>-->
<!--            <if test="serviceEndDate != null">-->
<!--                service_end_date = #{serviceEndDate},-->
<!--            </if>-->
<!--            <if test="serviceTime != null and serviceTime != ''">-->
<!--                service_time = #{serviceTime},-->
<!--            </if>-->
<!--            <if test="inputId != null">-->
<!--                input_id = #{inputId},-->
<!--            </if>-->
<!--            <if test="inputBy != null and inputBy != ''">-->
<!--                input_by = #{inputBy},-->
<!--            </if>-->
<!--            <if test="inputDate != null">-->
<!--                input_date = #{inputDate},-->
<!--            </if>-->
<!--            <if test="updateId != null">-->
<!--                update_id = #{updateId},-->
<!--            </if>-->
<!--            <if test="updateBy != null and updateBy != ''">-->
<!--                update_by = #{updateBy},-->
<!--            </if>-->
<!--            <if test="updateDate != null">-->
<!--                update_date = #{updateDate},-->
<!--            </if>-->
<!--        </set>-->
<!--        where id = #{id}-->
<!--    </update>-->

<!--    &lt;!&ndash;通过主键删除&ndash;&gt;-->
<!--    <delete id="deleteById">-->
<!--        delete from service_orders_202204 where id = #{id}-->
<!--    </delete>-->



</mapper>

