<?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.goafanti.common.dao.ContractTaskMapper">
  <resultMap id="BaseResultMap" type="com.goafanti.common.model.ContractTask">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Mar 02 15:45:51 CST 2018.
    -->
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="contract_id" jdbcType="VARCHAR" property="contractId" />
    <result column="commodity_id" jdbcType="VARCHAR" property="commodityId" />
    <result column="commodity_name" jdbcType="VARCHAR" property="commodityName" />
    <result column="commodity_quantity" jdbcType="INTEGER" property="commodityQuantity" />
    <result column="commodity_type" jdbcType="INTEGER" property="commodityType" />
    <result column="commodity_mode" jdbcType="VARCHAR" property="commodityMode" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="task_comment" jdbcType="VARCHAR" property="taskComment" />
    <result column="task_status" jdbcType="INTEGER" property="taskStatus" />
    <result column="task_distribution_time" jdbcType="TIMESTAMP" property="taskDistributionTime" />
    <result column="task_allocator" jdbcType="VARCHAR" property="taskAllocator" />
    <result column="task_receiver" jdbcType="VARCHAR" property="taskReceiver" />
    <result column="deleted_sign" jdbcType="INTEGER" property="deletedSign" />
    <result column="publish_status" jdbcType="INTEGER" property="publishStatus" />
    <result column="serial_number" jdbcType="INTEGER" property="serialNumber" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.goafanti.common.model.ContractTask">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Mar 02 15:45:51 CST 2018.
    -->
    <result column="attachment_url" jdbcType="LONGVARCHAR" property="attachmentUrl" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Mar 02 15:45:51 CST 2018.
    -->
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Mar 02 15:45:51 CST 2018.
    -->
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Mar 02 15:45:51 CST 2018.
    -->
    id, contract_id, commodity_id, commodity_name, commodity_quantity, commodity_type, 
    commodity_mode, create_time, task_comment, task_status, task_distribution_time, task_allocator, 
    task_receiver, deleted_sign, serial_number
  </sql>
  <sql id="Blob_Column_List">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Mar 02 15:45:51 CST 2018.
    -->
    attachment_url
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="com.goafanti.common.model.ContractTaskExample" resultMap="ResultMapWithBLOBs">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Mar 02 15:45:51 CST 2018.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from contract_task
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExample" parameterType="com.goafanti.common.model.ContractTaskExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Mar 02 15:45:51 CST 2018.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from contract_task
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Mar 02 15:45:51 CST 2018.
    -->
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from contract_task
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Mar 02 15:45:51 CST 2018.
    -->
    delete from contract_task
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.goafanti.common.model.ContractTaskExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Mar 02 15:45:51 CST 2018.
    -->
    delete from contract_task
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.goafanti.common.model.ContractTask">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Mar 02 15:45:51 CST 2018.
    -->
    insert into contract_task (id, contract_id, commodity_id, 
      commodity_name, commodity_quantity, commodity_type, 
      commodity_mode, create_time, task_comment, 
      task_status, task_distribution_time, task_allocator, 
      task_receiver, deleted_sign, serial_number, 
      attachment_url,publish_status)
    values (#{id,jdbcType=VARCHAR}, #{contractId,jdbcType=VARCHAR}, #{commodityId,jdbcType=VARCHAR}, 
      #{commodityName,jdbcType=VARCHAR}, #{commodityQuantity,jdbcType=INTEGER}, #{commodityType,jdbcType=INTEGER}, 
      #{commodityMode,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{taskComment,jdbcType=VARCHAR}, 
      #{taskStatus,jdbcType=INTEGER}, #{taskDistributionTime,jdbcType=TIMESTAMP}, #{taskAllocator,jdbcType=VARCHAR}, 
      #{taskReceiver,jdbcType=VARCHAR}, #{deletedSign,jdbcType=INTEGER}, #{serialNumber,jdbcType=INTEGER}, 
      #{attachmentUrl,jdbcType=LONGVARCHAR},#{publishStatus,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.goafanti.common.model.ContractTask">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Mar 02 15:45:51 CST 2018.
    -->
    insert into contract_task
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="contractId != null">
        contract_id,
      </if>
      <if test="commodityId != null">
        commodity_id,
      </if>
      <if test="commodityName != null">
        commodity_name,
      </if>
      <if test="commodityQuantity != null">
        commodity_quantity,
      </if>
      <if test="commodityType != null">
        commodity_type,
      </if>
      <if test="commodityMode != null">
        commodity_mode,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="taskComment != null">
        task_comment,
      </if>
      <if test="taskStatus != null">
        task_status,
      </if>
      <if test="taskDistributionTime != null">
        task_distribution_time,
      </if>
      <if test="taskAllocator != null">
        task_allocator,
      </if>
      <if test="taskReceiver != null">
        task_receiver,
      </if>
      <if test="deletedSign != null">
        deleted_sign,
      </if>
      <if test="serialNumber != null">
        serial_number,
      </if>
      <if test="attachmentUrl != null">
        attachment_url,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="contractId != null">
        #{contractId,jdbcType=VARCHAR},
      </if>
      <if test="commodityId != null">
        #{commodityId,jdbcType=VARCHAR},
      </if>
      <if test="commodityName != null">
        #{commodityName,jdbcType=VARCHAR},
      </if>
      <if test="commodityQuantity != null">
        #{commodityQuantity,jdbcType=INTEGER},
      </if>
      <if test="commodityType != null">
        #{commodityType,jdbcType=INTEGER},
      </if>
      <if test="commodityMode != null">
        #{commodityMode,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="taskComment != null">
        #{taskComment,jdbcType=VARCHAR},
      </if>
      <if test="taskStatus != null">
        #{taskStatus,jdbcType=INTEGER},
      </if>
      <if test="taskDistributionTime != null">
        #{taskDistributionTime,jdbcType=TIMESTAMP},
      </if>
      <if test="taskAllocator != null">
        #{taskAllocator,jdbcType=VARCHAR},
      </if>
      <if test="taskReceiver != null">
        #{taskReceiver,jdbcType=VARCHAR},
      </if>
      <if test="deletedSign != null">
        #{deletedSign,jdbcType=INTEGER},
      </if>
      <if test="serialNumber != null">
        #{serialNumber,jdbcType=INTEGER},
      </if>
      <if test="attachmentUrl != null">
        #{attachmentUrl,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.goafanti.common.model.ContractTaskExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Mar 02 15:45:51 CST 2018.
    -->
    select count(*) from contract_task
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Mar 02 15:45:51 CST 2018.
    -->
    update contract_task
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.contractId != null">
        contract_id = #{record.contractId,jdbcType=VARCHAR},
      </if>
      <if test="record.commodityId != null">
        commodity_id = #{record.commodityId,jdbcType=VARCHAR},
      </if>
      <if test="record.commodityName != null">
        commodity_name = #{record.commodityName,jdbcType=VARCHAR},
      </if>
      <if test="record.commodityQuantity != null">
        commodity_quantity = #{record.commodityQuantity,jdbcType=INTEGER},
      </if>
      <if test="record.commodityType != null">
        commodity_type = #{record.commodityType,jdbcType=INTEGER},
      </if>
      <if test="record.commodityMode != null">
        commodity_mode = #{record.commodityMode,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.taskComment != null">
        task_comment = #{record.taskComment,jdbcType=VARCHAR},
      </if>
      <if test="record.taskStatus != null">
        task_status = #{record.taskStatus,jdbcType=INTEGER},
      </if>
      <if test="record.taskDistributionTime != null">
        task_distribution_time = #{record.taskDistributionTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.taskAllocator != null">
        task_allocator = #{record.taskAllocator,jdbcType=VARCHAR},
      </if>
      <if test="record.taskReceiver != null">
        task_receiver = #{record.taskReceiver,jdbcType=VARCHAR},
      </if>
      <if test="record.deletedSign != null">
        deleted_sign = #{record.deletedSign,jdbcType=INTEGER},
      </if>
      <if test="record.serialNumber != null">
        serial_number = #{record.serialNumber,jdbcType=INTEGER},
      </if>
      <if test="record.attachmentUrl != null">
        attachment_url = #{record.attachmentUrl,jdbcType=LONGVARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExampleWithBLOBs" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Mar 02 15:45:51 CST 2018.
    -->
    update contract_task
    set id = #{record.id,jdbcType=VARCHAR},
      contract_id = #{record.contractId,jdbcType=VARCHAR},
      commodity_id = #{record.commodityId,jdbcType=VARCHAR},
      commodity_name = #{record.commodityName,jdbcType=VARCHAR},
      commodity_quantity = #{record.commodityQuantity,jdbcType=INTEGER},
      commodity_type = #{record.commodityType,jdbcType=INTEGER},
      commodity_mode = #{record.commodityMode,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      task_comment = #{record.taskComment,jdbcType=VARCHAR},
      task_status = #{record.taskStatus,jdbcType=INTEGER},
      task_distribution_time = #{record.taskDistributionTime,jdbcType=TIMESTAMP},
      task_allocator = #{record.taskAllocator,jdbcType=VARCHAR},
      task_receiver = #{record.taskReceiver,jdbcType=VARCHAR},
      deleted_sign = #{record.deletedSign,jdbcType=INTEGER},
      serial_number = #{record.serialNumber,jdbcType=INTEGER},
      attachment_url = #{record.attachmentUrl,jdbcType=LONGVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Mar 02 15:45:51 CST 2018.
    -->
    update contract_task
    set id = #{record.id,jdbcType=VARCHAR},
      contract_id = #{record.contractId,jdbcType=VARCHAR},
      commodity_id = #{record.commodityId,jdbcType=VARCHAR},
      commodity_name = #{record.commodityName,jdbcType=VARCHAR},
      commodity_quantity = #{record.commodityQuantity,jdbcType=INTEGER},
      commodity_type = #{record.commodityType,jdbcType=INTEGER},
      commodity_mode = #{record.commodityMode,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      task_comment = #{record.taskComment,jdbcType=VARCHAR},
      task_status = #{record.taskStatus,jdbcType=INTEGER},
      task_distribution_time = #{record.taskDistributionTime,jdbcType=TIMESTAMP},
      task_allocator = #{record.taskAllocator,jdbcType=VARCHAR},
      task_receiver = #{record.taskReceiver,jdbcType=VARCHAR},
      deleted_sign = #{record.deletedSign,jdbcType=INTEGER},
      serial_number = #{record.serialNumber,jdbcType=INTEGER}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.ContractTask">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Mar 02 15:45:51 CST 2018.
    -->
    update contract_task
    <set>
      <if test="contractId != null">
        contract_id = #{contractId,jdbcType=VARCHAR},
      </if>
      <if test="commodityId != null">
        commodity_id = #{commodityId,jdbcType=VARCHAR},
      </if>
      <if test="commodityName != null">
        commodity_name = #{commodityName,jdbcType=VARCHAR},
      </if>
      <if test="commodityQuantity != null">
        commodity_quantity = #{commodityQuantity,jdbcType=INTEGER},
      </if>
      <if test="commodityType != null">
        commodity_type = #{commodityType,jdbcType=INTEGER},
      </if>
      <if test="commodityMode != null">
        commodity_mode = #{commodityMode,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="taskComment != null">
        task_comment = #{taskComment,jdbcType=VARCHAR},
      </if>
      <if test="taskStatus != null">
        task_status = #{taskStatus,jdbcType=INTEGER},
      </if>
      <if test="taskDistributionTime != null">
        task_distribution_time = #{taskDistributionTime,jdbcType=TIMESTAMP},
      </if>
      <if test="taskAllocator != null">
        task_allocator = #{taskAllocator,jdbcType=VARCHAR},
      </if>
      <if test="taskReceiver != null">
        task_receiver = #{taskReceiver,jdbcType=VARCHAR},
      </if>
      <if test="deletedSign != null">
        deleted_sign = #{deletedSign,jdbcType=INTEGER},
      </if>
      <if test="publishStatus != null">
        publish_Status = #{publishStatus,jdbcType=INTEGER},
      </if>
      <if test="serialNumber != null">
        serial_number = #{serialNumber,jdbcType=INTEGER},
      </if>
      <if test="attachmentUrl != null">
        attachment_url = #{attachmentUrl,jdbcType=LONGVARCHAR},
      </if>
      <if test="publishTime != null">
        publish_time = #{publishTime,jdbcType=TIMESTAMP},
      </if>
      <if test="finishTime != null">
        finish_time = #{finishTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.goafanti.common.model.ContractTask">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Mar 02 15:45:51 CST 2018.
    -->
    update contract_task
    set contract_id = #{contractId,jdbcType=VARCHAR},
      commodity_id = #{commodityId,jdbcType=VARCHAR},
      commodity_name = #{commodityName,jdbcType=VARCHAR},
      commodity_quantity = #{commodityQuantity,jdbcType=INTEGER},
      commodity_type = #{commodityType,jdbcType=INTEGER},
      commodity_mode = #{commodityMode,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      task_comment = #{taskComment,jdbcType=VARCHAR},
      task_status = #{taskStatus,jdbcType=INTEGER},
      task_distribution_time = #{taskDistributionTime,jdbcType=TIMESTAMP},
      task_allocator = #{taskAllocator,jdbcType=VARCHAR},
      task_receiver = #{taskReceiver,jdbcType=VARCHAR},
      deleted_sign = #{deletedSign,jdbcType=INTEGER},
      serial_number = #{serialNumber,jdbcType=INTEGER},
      attachment_url = #{attachmentUrl,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.ContractTask">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Mar 02 15:45:51 CST 2018.
    -->
    update contract_task
    set contract_id = #{contractId,jdbcType=VARCHAR},
      commodity_id = #{commodityId,jdbcType=VARCHAR},
      commodity_name = #{commodityName,jdbcType=VARCHAR},
      commodity_quantity = #{commodityQuantity,jdbcType=INTEGER},
      commodity_type = #{commodityType,jdbcType=INTEGER},
      commodity_mode = #{commodityMode,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      task_comment = #{taskComment,jdbcType=VARCHAR},
      task_status = #{taskStatus,jdbcType=INTEGER},
      task_distribution_time = #{taskDistributionTime,jdbcType=TIMESTAMP},
      task_allocator = #{taskAllocator,jdbcType=VARCHAR},
      task_receiver = #{taskReceiver,jdbcType=VARCHAR},
      deleted_sign = #{deletedSign,jdbcType=INTEGER},
      serial_number = #{serialNumber,jdbcType=INTEGER}
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <select id="selectProjectTaskDetail" parameterType="java.lang.String" resultType="com.goafanti.techproject.bo.TaskDetailBo">
		select
			a.id as taskId,
			a.commodity_id as commodityId,
			a.serial_number as taskNo,
			a.task_status as taskStatus,
			date_format(a.task_distribution_time ,'%Y-%m-%d %H:%i:%S') as taskDistributionTime,
			a.task_comment as taskComment,
			a.publish_status as publishStatus,
			b.bname as commodityName ,
			c.cname as categoryName,
			c.id as categoryId,
			d.serial_number as projectNo,
			d.deleted_sign as deletedSign,
			d.order_no as orderNo,
			e.name as taskAllocatorName,
			f.name as taskReceiverName,
			g.nickname as buyerName,
			h.contract_no as contractNo,
			ifnull(h.sign_total_amount,0) as signTotalAmount,
			d.uid,
			i.name as salesmanName,
			j.name as departmentName,
			h.order_remarks as orderRemarks
		from
			contract_task a 
			left join business_project b on a.commodity_id = b.id 
			left join business_category c on b.cid = c.id 
			left join contract d on a.contract_id = d.id 
			left join admin e on a.task_allocator = e.id 
			left join admin f on a.task_receiver = f.id 
			left join user g on d.uid = g.id
			left join t_order h on h.order_no=d.order_no
			left join admin i on h.salesman_id = i.id
			left join department j on i.department_id=j.id
			where 1=1
			and a.id = #{taskId,jdbcType=VARCHAR}
  </select>
  <select id="selectlistContractTask" resultType="com.goafanti.common.model.ContractTask">
 	select id,task_receiver as taskReceiver
		from contract_task
  </select>
  <select id="slectbyOrderNo" resultType="java.lang.String">
 	select task_receiver
    from contract_task a
    left join contract b on a.contract_id=b.id
    inner join t_order c on b.order_no=c.order_no
    where c.order_no= #{orderNo,jdbcType=VARCHAR}
  </select>
  <select id="selectByOrderNoAndUserName" resultType="com.goafanti.techproject.bo.TaskDetailBo">
 	select 
     b.order_no as orderNo,d.nickname as buyerName
    from contract_task a 
    inner join contract b on a.contract_id=b.id
    inner join t_order c on b.order_no=c.order_no
    inner join user d on c.buyer_id =d.id
    where a.id= #{taskId,jdbcType=VARCHAR}
  </select>
</mapper>