<?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.hzya.frame.u9c.salereceiver.dao.impl.VU9cSalereceiverEntityDaoImpl">

    <resultMap id="get-VU9cSalereceiverEntity-result" type="com.hzya.frame.u9c.salereceiver.entity.VU9cSalereceiverEntity" >
        <result property="orgId" column="org_id" jdbcType="VARCHAR"/>
        <result property="id" column="ID" jdbcType="VARCHAR"/>
        <result property="orgCode" column="org_code" jdbcType="VARCHAR"/>
        <result property="billCode" column="bill_code" jdbcType="VARCHAR"/>
        <result property="custCode" column="cust_code" jdbcType="VARCHAR"/>
        <result property="custName" column="cust_name" jdbcType="VARCHAR"/>
        <result property="custAddsCode" column="cust_adds_code" jdbcType="VARCHAR"/>
        <result property="custAddsName" column="cust_adds_name" jdbcType="VARCHAR"/>
        <result property="accountPursuantCode" column="account_pursuant_code" jdbcType="VARCHAR"/>
        <result property="accountPursuantName" column="account_pursuant_name" jdbcType="VARCHAR"/>
        <result property="curCode" column="cur_code" jdbcType="VARCHAR"/>
        <result property="cur" column="cur" jdbcType="VARCHAR"/>
        <result property="accountDate" column="account_date" jdbcType="VARCHAR"/>
        <result property="accountPeriodName" column="account_period_name" jdbcType="VARCHAR"/>
        <result property="accountPeriodCode" column="account_period_code" jdbcType="VARCHAR"/>
        <result property="billTypeCode" column="bill_type_code" jdbcType="VARCHAR"/>
        <result property="billTypeName" column="bill_type_name" jdbcType="VARCHAR"/>
        <result property="sourceBillCode" column="source_bill_code" jdbcType="VARCHAR"/>
        <result property="sourceBillType" column="source_bill_type" jdbcType="VARCHAR"/>
        <result property="price" column="price" jdbcType="VARCHAR"/>
        <result property="state" column="state" jdbcType="VARCHAR"/>
        <result property="crmId" column="crm_id" jdbcType="VARCHAR"/>
        <result property="saleId" column="sale_id" jdbcType="VARCHAR"/>
        <result property="operatorsId" column="operators_id" jdbcType="VARCHAR"/>
        <result property="soId" column="soId" jdbcType="VARCHAR"/>
        <result property="updateTime" column="update_time" jdbcType="VARCHAR"/>
    </resultMap>
    <!-- 查询的字段-->
    <sql id = "VU9cSalereceiverEntity_Base_Column_List">
        org_id
       ,ID 
        ,org_code
        ,bill_code
        ,cust_code
        ,cust_name 
        ,cust_adds_code 
        ,cust_adds_name 
        ,account_pursuant_code 
        ,account_pursuant_name 
        ,cur_code 
        ,cur 
        ,account_date 
        ,account_period_name 
        ,account_period_code 
        ,bill_type_code 
        ,bill_type_name 
        ,source_bill_code 
        ,source_bill_type 
        ,price 
        ,state 
        ,crm_id 
        ,sale_id 
        ,soId

        ,operators_id
     </sql>
 <!-- 查询 采用==查询 -->
 <select id="VU9cSalereceiverEntity_list_base" resultMap="get-VU9cSalereceiverEntity-result" parameterType = "com.hzya.frame.u9c.salereceiver.entity.VU9cSalereceiverEntity">
    select

    *
    from v_u9c_salereceiver
     where (crm_id ='' or crm_id is null  or  update_time > #{updateTime} )
</select>

<!--通过主键修改方法-->
<update id="VU9cSalereceiverEntity_update" parameterType = "com.hzya.frame.u9c.salereceiver.entity.VU9cSalereceiverEntity" >
    update AR_ARBillHead  set
        <trim suffix="" suffixOverrides=",">
            <if test="dataId != null and dataId != ''"> DescFlexField_PrivateDescSeg1 = #{dataId},</if>
        </trim>
    where  id = #{id}
</update>
    <!-- 查询 采用==查询 -->
    <select id="VU9cSalereceiverEntity_list_base_for_delete" resultMap="get-VU9cSalereceiverEntity-result" parameterType = "com.hzya.frame.u9c.salereceiver.entity.VU9cSalereceiverEntity">
     select
        *
        from AR_ARBillHead_for_delete where (state is null or state ='')  and crm_id !=''
</select>

    <!--通过主键修改方法-->
    <update id="VU9cSalereceiverEntity_update_for_delete" parameterType = "com.hzya.frame.u9c.salereceiver.entity.VU9cSalereceiverEntity" >
        update AR_ARBillHead_for_delete set state = #{state}
        where  id = #{id}
    </update>

</mapper>

