<?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.SalesmanMapper">
    <resultMap type="com.ssm.manage.entity.Salesman" id="SalesmanMap">
        <result property="id" column="id" jdbcType="BIGINT"/>
        <result property="staffType" column="staff_type" 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="identityCard" column="identity_card" jdbcType="VARCHAR"/>
        <result property="achievementAmount" column="achievement_amount" jdbcType="NUMERIC"/>
        <result property="commissionAmount" column="commission_amount" jdbcType="NUMERIC"/>
        <result property="orderId" column="order_id" jdbcType="VARCHAR"/>
        <result property="ratio" column="ratio" jdbcType="NUMERIC"/>
        <result property="orderType" column="order_type" jdbcType="INTEGER"/>
        <result property="orderDate" column="order_date" jdbcType="DATE"/>
        <result property="projectId" column="project_id" jdbcType="BIGINT"/>
        <result property="projectNum" column="project_num" jdbcType="VARCHAR"/>
        <result property="money" column="money" jdbcType="DECIMAL"/>
        <result property="orderNum" column="order_num" jdbcType="VARCHAR"/>
        <result property="storeId" column="store_id" jdbcType="BIGINT"/>
        <result property="state" column="state" jdbcType="INTEGER"/>
        <result property="storeNum" column="store_num" jdbcType="VARCHAR"/>
        <result property="storeName" column="store_name" jdbcType="VARCHAR"/>
        <result property="storeIdOrder" column="store_id_order" jdbcType="BIGINT"/>
        <result property="staffId" column="staff_id" jdbcType="BIGINT"/>
        <result property="operatorBy" column="operator_by" jdbcType="VARCHAR"/>
    </resultMap>
    <update id="updateByDocNum">
        update salesman set state = 0,order_date = now() where order_num = #{docNum}
    </update>
    <select id="selectList" resultMap="SalesmanMap" parameterType="collection">
        select staff_type,staff_name,brand_number,ratio,order_id from salesman where order_id in
                                                                    <foreach collection="courseIds" open="(" close=")" separator="," item="item">
                                                                        #{item}
                                                                    </foreach>
    </select>
</mapper>