<?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.zfire.jiasm.syncdata.dao.mapper.OperatingLogOrderInstallMapper">

    <select id="getOperatingLog" parameterType="com.zfire.jiasm.syncdata.parameter.OperatingLog" resultType="com.zfire.jiasm.syncdata.plus.entity.ItfTblAzAssignFkmxUpload">
        select a.order_base_id as worker_order_no,UNIX_TIMESTAMP(a.create_time) as fa_order_install_operating_log_id,
               a.fkid,'guangfo' as created_by,a.create_time as created_date,'guangfo' as last_modified_by,
               a.type as fklb,a.type as fkjg,a.content as fknr,a.websit_number as fkren,a.operator as fkrenmc,
               a.create_time as fksj,a.pgguid,a.create_time as cjdt
        from order_install_operating_log a
        where a.order_base_id = #{request.orderNo} and a.id  = #{request.id};
    </select>

    <update id="upLogfkid" parameterType="com.zfire.jiasm.syncdata.parameter.OperatingLog">
        update order_install_operating_log
        set fkid =  #{request.fkid}
        where id = #{request.id} and (fkid is null or fkid = '')
    </update>

    <update id="upLogpgguid" parameterType="com.zfire.jiasm.syncdata.parameter.OperatingLog">
        update order_install_operating_log
        set pgguid =  #{request.pgguid}
        where order_base_id = #{request.orderNo} and (pgguid is null or pgguid = '' or pgguid = '0')
    </update>


</mapper>
