<?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.reptileclient.jlifeapp.dao.hm.JxWorkerOrderMapper">
  <resultMap id="BaseResultMap" type="com.reptileclient.jlifeapp.entity.hm.JxWorkerOrder">
    <!--@mbg.generated-->
    <!--@Table jx_worker_order-->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="jx_order_no" jdbcType="VARCHAR" property="jxOrderNo" />
    <result column="hm_pay_orderNo" jdbcType="VARCHAR" property="hmPayOrderno" />
    <result column="service_model" jdbcType="INTEGER" property="serviceModel" />
    <result column="hm_shop_code" jdbcType="VARCHAR" property="hmShopCode" />
    <result column="hm_shop_name" jdbcType="VARCHAR" property="hmShopName" />
    <result column="item_name" jdbcType="VARCHAR" property="itemName" />
    <result column="customer_name" jdbcType="VARCHAR" property="customerName" />
    <result column="customer_phone" jdbcType="VARCHAR" property="customerPhone" />
    <result column="customer_mask_phone" jdbcType="VARCHAR" property="customerMaskPhone" />
    <result column="customer_addr" jdbcType="VARCHAR" property="customerAddr" />
    <result column="customer_source" jdbcType="INTEGER" property="customerSource" />
    <result column="status" jdbcType="INTEGER" property="status" />
    <result column="hm_status" jdbcType="INTEGER" property="hmStatus" />
    <result column="write_time" jdbcType="TIMESTAMP" property="writeTime" />
    <result column="pay_time" jdbcType="TIMESTAMP" property="payTime" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, jx_order_no, hm_pay_orderNo, service_model, hm_shop_code, hm_shop_name, item_name,
    customer_name, customer_phone, customer_mask_phone, customer_addr, customer_source,
    `status`, hm_status, write_time, pay_time
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <include refid="Base_Column_List" />
    from jx_worker_order
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    <!--@mbg.generated-->
    delete from jx_worker_order
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.reptileclient.jlifeapp.entity.hm.JxWorkerOrder" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into jx_worker_order (jx_order_no, hm_pay_orderNo, service_model,
      hm_shop_code, hm_shop_name, item_name,
      customer_name, customer_phone, customer_mask_phone,
      customer_addr, customer_source, `status`,
      hm_status, write_time, pay_time
      )
    values (#{jxOrderNo,jdbcType=VARCHAR}, #{hmPayOrderno,jdbcType=VARCHAR}, #{serviceModel,jdbcType=INTEGER},
      #{hmShopCode,jdbcType=VARCHAR}, #{hmShopName,jdbcType=VARCHAR}, #{itemName,jdbcType=VARCHAR},
      #{customerName,jdbcType=VARCHAR}, #{customerPhone,jdbcType=VARCHAR}, #{customerMaskPhone,jdbcType=VARCHAR},
      #{customerAddr,jdbcType=VARCHAR}, #{customerSource,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
      #{hmStatus,jdbcType=INTEGER}, #{writeTime,jdbcType=TIMESTAMP}, #{payTime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.reptileclient.jlifeapp.entity.hm.JxWorkerOrder" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into jx_worker_order
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="jxOrderNo != null">
        jx_order_no,
      </if>
      <if test="hmPayOrderno != null">
        hm_pay_orderNo,
      </if>
      <if test="serviceModel != null">
        service_model,
      </if>
      <if test="hmShopCode != null">
        hm_shop_code,
      </if>
      <if test="hmShopName != null">
        hm_shop_name,
      </if>
      <if test="itemName != null">
        item_name,
      </if>
      <if test="customerName != null">
        customer_name,
      </if>
      <if test="customerPhone != null">
        customer_phone,
      </if>
      <if test="customerMaskPhone != null">
        customer_mask_phone,
      </if>
      <if test="customerAddr != null">
        customer_addr,
      </if>
      <if test="customerSource != null">
        customer_source,
      </if>
      <if test="status != null">
        `status`,
      </if>
      <if test="hmStatus != null">
        hm_status,
      </if>
      <if test="writeTime != null">
        write_time,
      </if>
      <if test="payTime != null">
        pay_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="jxOrderNo != null">
        #{jxOrderNo,jdbcType=VARCHAR},
      </if>
      <if test="hmPayOrderno != null">
        #{hmPayOrderno,jdbcType=VARCHAR},
      </if>
      <if test="serviceModel != null">
        #{serviceModel,jdbcType=INTEGER},
      </if>
      <if test="hmShopCode != null">
        #{hmShopCode,jdbcType=VARCHAR},
      </if>
      <if test="hmShopName != null">
        #{hmShopName,jdbcType=VARCHAR},
      </if>
      <if test="itemName != null">
        #{itemName,jdbcType=VARCHAR},
      </if>
      <if test="customerName != null">
        #{customerName,jdbcType=VARCHAR},
      </if>
      <if test="customerPhone != null">
        #{customerPhone,jdbcType=VARCHAR},
      </if>
      <if test="customerMaskPhone != null">
        #{customerMaskPhone,jdbcType=VARCHAR},
      </if>
      <if test="customerAddr != null">
        #{customerAddr,jdbcType=VARCHAR},
      </if>
      <if test="customerSource != null">
        #{customerSource,jdbcType=INTEGER},
      </if>
      <if test="status != null">
        #{status,jdbcType=INTEGER},
      </if>
      <if test="hmStatus != null">
        #{hmStatus,jdbcType=INTEGER},
      </if>
      <if test="writeTime != null">
        #{writeTime,jdbcType=TIMESTAMP},
      </if>
      <if test="payTime != null">
        #{payTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.reptileclient.jlifeapp.entity.hm.JxWorkerOrder">
    <!--@mbg.generated-->
    update jx_worker_order
    <set>
      <if test="jxOrderNo != null">
        jx_order_no = #{jxOrderNo,jdbcType=VARCHAR},
      </if>
      <if test="hmPayOrderno != null">
        hm_pay_orderNo = #{hmPayOrderno,jdbcType=VARCHAR},
      </if>
      <if test="serviceModel != null">
        service_model = #{serviceModel,jdbcType=INTEGER},
      </if>
      <if test="hmShopCode != null">
        hm_shop_code = #{hmShopCode,jdbcType=VARCHAR},
      </if>
      <if test="hmShopName != null">
        hm_shop_name = #{hmShopName,jdbcType=VARCHAR},
      </if>
      <if test="itemName != null">
        item_name = #{itemName,jdbcType=VARCHAR},
      </if>
      <if test="customerName != null">
        customer_name = #{customerName,jdbcType=VARCHAR},
      </if>
      <if test="customerPhone != null">
        customer_phone = #{customerPhone,jdbcType=VARCHAR},
      </if>
      <if test="customerMaskPhone != null">
        customer_mask_phone = #{customerMaskPhone,jdbcType=VARCHAR},
      </if>
      <if test="customerAddr != null">
        customer_addr = #{customerAddr,jdbcType=VARCHAR},
      </if>
      <if test="customerSource != null">
        customer_source = #{customerSource,jdbcType=INTEGER},
      </if>
      <if test="status != null">
        `status` = #{status,jdbcType=INTEGER},
      </if>
      <if test="hmStatus != null">
        hm_status = #{hmStatus,jdbcType=INTEGER},
      </if>
      <if test="writeTime != null">
        write_time = #{writeTime,jdbcType=TIMESTAMP},
      </if>
      <if test="payTime != null">
        pay_time = #{payTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.reptileclient.jlifeapp.entity.hm.JxWorkerOrder">
    <!--@mbg.generated-->
    update jlife_worker.jx_worker_order
    set jx_order_no = #{jxOrderNo,jdbcType=VARCHAR},
      hm_pay_orderNo = #{hmPayOrderno,jdbcType=VARCHAR},
      service_model = #{serviceModel,jdbcType=INTEGER},
      hm_shop_code = #{hmShopCode,jdbcType=VARCHAR},
      hm_shop_name = #{hmShopName,jdbcType=VARCHAR},
      item_name = #{itemName,jdbcType=VARCHAR},
      customer_name = #{customerName,jdbcType=VARCHAR},
      customer_phone = #{customerPhone,jdbcType=VARCHAR},
      customer_mask_phone = #{customerMaskPhone,jdbcType=VARCHAR},
      customer_addr = #{customerAddr,jdbcType=VARCHAR},
      customer_source = #{customerSource,jdbcType=INTEGER},
      `status` = #{status,jdbcType=INTEGER},
      hm_status = #{hmStatus,jdbcType=INTEGER},
      write_time = #{writeTime,jdbcType=TIMESTAMP},
      pay_time = #{payTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateBatch" parameterType="java.util.List">
    <!--@mbg.generated-->
    update jlife_worker.jx_worker_order
    <trim prefix="set" suffixOverrides=",">
      <trim prefix="jx_order_no = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=INTEGER} then #{item.jxOrderNo,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="hm_pay_orderNo = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=INTEGER} then #{item.hmPayOrderno,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="service_model = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=INTEGER} then #{item.serviceModel,jdbcType=INTEGER}
        </foreach>
      </trim>
      <trim prefix="hm_shop_code = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=INTEGER} then #{item.hmShopCode,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="hm_shop_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=INTEGER} then #{item.hmShopName,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="item_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=INTEGER} then #{item.itemName,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="customer_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=INTEGER} then #{item.customerName,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="customer_phone = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=INTEGER} then #{item.customerPhone,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="customer_mask_phone = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=INTEGER} then #{item.customerMaskPhone,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="customer_addr = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=INTEGER} then #{item.customerAddr,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="customer_source = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=INTEGER} then #{item.customerSource,jdbcType=INTEGER}
        </foreach>
      </trim>
      <trim prefix="`status` = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=INTEGER} then #{item.status,jdbcType=INTEGER}
        </foreach>
      </trim>
      <trim prefix="hm_status = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=INTEGER} then #{item.hmStatus,jdbcType=INTEGER}
        </foreach>
      </trim>
      <trim prefix="write_time = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=INTEGER} then #{item.writeTime,jdbcType=TIMESTAMP}
        </foreach>
      </trim>
      <trim prefix="pay_time = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=INTEGER} then #{item.payTime,jdbcType=TIMESTAMP}
        </foreach>
      </trim>
    </trim>
    where id in
    <foreach close=")" collection="list" item="item" open="(" separator=", ">
      #{item.id,jdbcType=INTEGER}
    </foreach>
  </update>
  <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into jlife_worker.jx_worker_order
    (jx_order_no, hm_pay_orderNo, service_model, hm_shop_code, hm_shop_name, item_name,
      customer_name, customer_phone, customer_mask_phone, customer_addr, customer_source,
      `status`, hm_status, write_time, pay_time)
    values
    <foreach collection="list" item="item" separator=",">
      (#{item.jxOrderNo,jdbcType=VARCHAR}, #{item.hmPayOrderno,jdbcType=VARCHAR}, #{item.serviceModel,jdbcType=INTEGER},
        #{item.hmShopCode,jdbcType=VARCHAR}, #{item.hmShopName,jdbcType=VARCHAR}, #{item.itemName,jdbcType=VARCHAR},
        #{item.customerName,jdbcType=VARCHAR}, #{item.customerPhone,jdbcType=VARCHAR},
        #{item.customerMaskPhone,jdbcType=VARCHAR}, #{item.customerAddr,jdbcType=VARCHAR},
        #{item.customerSource,jdbcType=INTEGER}, #{item.status,jdbcType=INTEGER}, #{item.hmStatus,jdbcType=INTEGER},
        #{item.writeTime,jdbcType=TIMESTAMP}, #{item.payTime,jdbcType=TIMESTAMP})
    </foreach>
  </insert>
  <insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.reptileclient.jlifeapp.entity.hm.JxWorkerOrder" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into jx_worker_order
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      jx_order_no,
      hm_pay_orderNo,
      service_model,
      hm_shop_code,
      hm_shop_name,
      item_name,
      customer_name,
      customer_phone,
      customer_mask_phone,
      customer_addr,
      customer_source,
      `status`,
      hm_status,
      write_time,
      pay_time,
    </trim>
    values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      #{jxOrderNo,jdbcType=VARCHAR},
      #{hmPayOrderno,jdbcType=VARCHAR},
      #{serviceModel,jdbcType=INTEGER},
      #{hmShopCode,jdbcType=VARCHAR},
      #{hmShopName,jdbcType=VARCHAR},
      #{itemName,jdbcType=VARCHAR},
      #{customerName,jdbcType=VARCHAR},
      #{customerPhone,jdbcType=VARCHAR},
      #{customerMaskPhone,jdbcType=VARCHAR},
      #{customerAddr,jdbcType=VARCHAR},
      #{customerSource,jdbcType=INTEGER},
      #{status,jdbcType=INTEGER},
      #{hmStatus,jdbcType=INTEGER},
      #{writeTime,jdbcType=TIMESTAMP},
      #{payTime,jdbcType=TIMESTAMP},
    </trim>
    on duplicate key update
    <trim suffixOverrides=",">
      <if test="id != null">
        id = #{id,jdbcType=INTEGER},
      </if>
      jx_order_no = #{jxOrderNo,jdbcType=VARCHAR},
      hm_pay_orderNo = #{hmPayOrderno,jdbcType=VARCHAR},
      service_model = #{serviceModel,jdbcType=INTEGER},
      hm_shop_code = #{hmShopCode,jdbcType=VARCHAR},
      hm_shop_name = #{hmShopName,jdbcType=VARCHAR},
      item_name = #{itemName,jdbcType=VARCHAR},
      customer_name = #{customerName,jdbcType=VARCHAR},
      customer_phone = #{customerPhone,jdbcType=VARCHAR},
      customer_mask_phone = #{customerMaskPhone,jdbcType=VARCHAR},
      customer_addr = #{customerAddr,jdbcType=VARCHAR},
      customer_source = #{customerSource,jdbcType=INTEGER},
      `status` = #{status,jdbcType=INTEGER},
      hm_status = #{hmStatus,jdbcType=INTEGER},
      write_time = #{writeTime,jdbcType=TIMESTAMP},
      pay_time = #{payTime,jdbcType=TIMESTAMP},
    </trim>
  </insert>
  <insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.reptileclient.jlifeapp.entity.hm.JxWorkerOrder" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into jx_worker_order
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="jxOrderNo != null">
        jx_order_no,
      </if>
      <if test="hmPayOrderno != null">
        hm_pay_orderNo,
      </if>
      <if test="serviceModel != null">
        service_model,
      </if>
      <if test="hmShopCode != null">
        hm_shop_code,
      </if>
      <if test="hmShopName != null">
        hm_shop_name,
      </if>
      <if test="itemName != null">
        item_name,
      </if>
      <if test="customerName != null">
        customer_name,
      </if>
      <if test="customerPhone != null">
        customer_phone,
      </if>
      <if test="customerMaskPhone != null">
        customer_mask_phone,
      </if>
      <if test="customerAddr != null">
        customer_addr,
      </if>
      <if test="customerSource != null">
        customer_source,
      </if>
      <if test="status != null">
        `status`,
      </if>
      <if test="hmStatus != null">
        hm_status,
      </if>
      <if test="writeTime != null">
        write_time,
      </if>
      <if test="payTime != null">
        pay_time,
      </if>
    </trim>
    values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="jxOrderNo != null">
        #{jxOrderNo,jdbcType=VARCHAR},
      </if>
      <if test="hmPayOrderno != null">
        #{hmPayOrderno,jdbcType=VARCHAR},
      </if>
      <if test="serviceModel != null">
        #{serviceModel,jdbcType=INTEGER},
      </if>
      <if test="hmShopCode != null">
        #{hmShopCode,jdbcType=VARCHAR},
      </if>
      <if test="hmShopName != null">
        #{hmShopName,jdbcType=VARCHAR},
      </if>
      <if test="itemName != null">
        #{itemName,jdbcType=VARCHAR},
      </if>
      <if test="customerName != null">
        #{customerName,jdbcType=VARCHAR},
      </if>
      <if test="customerPhone != null">
        #{customerPhone,jdbcType=VARCHAR},
      </if>
      <if test="customerMaskPhone != null">
        #{customerMaskPhone,jdbcType=VARCHAR},
      </if>
      <if test="customerAddr != null">
        #{customerAddr,jdbcType=VARCHAR},
      </if>
      <if test="customerSource != null">
        #{customerSource,jdbcType=INTEGER},
      </if>
      <if test="status != null">
        #{status,jdbcType=INTEGER},
      </if>
      <if test="hmStatus != null">
        #{hmStatus,jdbcType=INTEGER},
      </if>
      <if test="writeTime != null">
        #{writeTime,jdbcType=TIMESTAMP},
      </if>
      <if test="payTime != null">
        #{payTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
    on duplicate key update
    <trim suffixOverrides=",">
      <if test="id != null">
        id = #{id,jdbcType=INTEGER},
      </if>
      <if test="jxOrderNo != null">
        jx_order_no = #{jxOrderNo,jdbcType=VARCHAR},
      </if>
      <if test="hmPayOrderno != null">
        hm_pay_orderNo = #{hmPayOrderno,jdbcType=VARCHAR},
      </if>
      <if test="serviceModel != null">
        service_model = #{serviceModel,jdbcType=INTEGER},
      </if>
      <if test="hmShopCode != null">
        hm_shop_code = #{hmShopCode,jdbcType=VARCHAR},
      </if>
      <if test="hmShopName != null">
        hm_shop_name = #{hmShopName,jdbcType=VARCHAR},
      </if>
      <if test="itemName != null">
        item_name = #{itemName,jdbcType=VARCHAR},
      </if>
      <if test="customerName != null">
        customer_name = #{customerName,jdbcType=VARCHAR},
      </if>
      <if test="customerPhone != null">
        customer_phone = #{customerPhone,jdbcType=VARCHAR},
      </if>
      <if test="customerMaskPhone != null">
        customer_mask_phone = #{customerMaskPhone,jdbcType=VARCHAR},
      </if>
      <if test="customerAddr != null">
        customer_addr = #{customerAddr,jdbcType=VARCHAR},
      </if>
      <if test="customerSource != null">
        customer_source = #{customerSource,jdbcType=INTEGER},
      </if>
      <if test="status != null">
        `status` = #{status,jdbcType=INTEGER},
      </if>
      <if test="hmStatus != null">
        hm_status = #{hmStatus,jdbcType=INTEGER},
      </if>
      <if test="writeTime != null">
        write_time = #{writeTime,jdbcType=TIMESTAMP},
      </if>
      <if test="payTime != null">
        pay_time = #{payTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
</mapper>
