f_ID as ID, f_book_number as book_number, f_target_name as target_name, f_order_type as order_type, f_type as type, f_relation_id as relation_id, f_should_send as should_send, f_actual_send as actual_send, f_warehouse_entry_flag as warehouse_entry_flag, f_del_flag as del_flag, f_create_by as create_by, f_create_name as create_name, f_create_time as create_time, f_update_by as update_by, f_update_name as update_name, f_update_time as update_time, f_create_corp_name as create_corp_name, f_create_corp_id as create_corp_id, f_create_dept_name as create_dept_name, f_create_dept_id as create_dept_id
select
f_ID as ID, f_book_number as book_number, f_target_name as target_name, f_order_type as order_type, f_type as type, f_relation_id as relation_id, f_should_send as should_send, f_actual_send as actual_send, f_warehouse_entry_flag as warehouse_entry_flag, f_del_flag as del_flag, f_create_by as create_by, f_create_name as create_name, f_create_time as create_time, f_update_by as update_by, f_update_name as update_name, f_update_time as update_time, f_create_corp_name as create_corp_name, f_create_corp_id as create_corp_id, f_create_dept_name as create_dept_name, f_create_dept_id as create_dept_id from t_book_go_where
and f_ID = #{params.id}
and f_book_number = #{params.bookNumber}
and f_target_name = #{params.targetName}
and f_should_send = #{params.shouldSend}
and f_actual_send = #{params.actualSend}
and f_warehouse_entry_flag = #{params.warehouseEntryFlag}
and f_del_flag = #{params.delFlag}
and create_by = #{params.createBy}
and f_create_name = #{params.createName}
and f_create_time = #{params.createTime}
and f_update_by = #{params.updateBy}
and f_update_name = #{params.updateName}
and f_update_time = #{params.updateTime}
and f_create_corp_name = #{params.createCorpName}
and f_create_corp_id = #{params.createCorpId}
and f_create_dept_name = #{params.createDeptName}
and f_create_dept_id = #{params.createDeptId}
and f_create_time >= #{params.createTimes[0]}
and f_create_time <= #{params.createTimes[1]}
and f_update_time >= #{params.updateTimes[0]}
and f_update_time <= #{params.updateTimes[1]}
select f_target_name as target_name,sum(f_should_send) should_send,sum(f_actual_send) actual_send
from t_book_go_where
where f_book_number = #{bookNumber}
and f_warehouse_entry_flag = '0'
and f_del_flag = '0'
and f_type = '0'
and f_create_corp_id=#{corpId}
group by f_target_name
select
from t_book_go_where
where f_relation_id = #{id}
and f_book_number = #{bookNumber}
and f_warehouse_entry_flag = '1'
and f_del_flag = '0'
and f_type = '1'