| | |
| | | am.measurement_unit, |
| | | am.quantity, |
| | | am.unit_price, |
| | | ( am.quantity * am.unit_price ) AS total_value, |
| | | am.total_value, |
| | | am.accounting_voucher_no, |
| | | am.accounting_subject, |
| | | am.accounting_status, |
| | | am.accounting_amount, |
| | | am.accounting_date, |
| | | am.asset_status, |
| | | od.dept_name AS ownership_dept_name, |
| | | td.dept_name AS ownership_dept_name, |
| | | am.ownership_dept_id, |
| | | am.asset_type_id, |
| | | am.address_type, |
| | | am.address, |
| | | am.use_dept_id, |
| | | am.warehouse_id, |
| | | od2.dept_name AS use_dept_name, |
| | | su.nick_name AS user_name, |
| | | am.user_name, |
| | | aw.warehouse_name, |
| | | td2.dept_name AS use_dept_name, |
| | | su.nick_name AS check_user_name, |
| | | aiti.result_status AS inventory_status, |
| | | aiti.real_dept_name, |
| | | aiti.real_user_name |
| | | aiti.real_user_name, |
| | | aiti.id AS asset_inventory_task_item_id, |
| | | aiti.exception_explain |
| | | FROM |
| | | asset_inventory_task_item aiti |
| | | INNER JOIN |
| | | asset_main am ON aiti.asset_main_id = am.id |
| | | LEFT JOIN |
| | | asset_type at2 ON am.asset_type_id = at.id |
| | | asset_type at2 ON am.asset_type_id = at2.id |
| | | LEFT JOIN |
| | | asset_type at1 ON at1.id = (CASE WHEN at2.level = 2 THEN at2.parent_id ELSE at2.id END) |
| | | LEFT JOIN |
| | | sys_dept od ON am.ownership_dept_id = od.dept_id |
| | | t_dept td ON am.ownership_dept_id = td.id |
| | | LEFT JOIN |
| | | sys_user su ON aiti.user_id = su.user_id |
| | | LEFT JOIN sys_dept od2 ON am.address_type = 0 AND am.use_dept_id = od2.id |
| | | LEFT JOIN |
| | | t_dept td2 ON am.address_type = 0 AND am.use_dept_id = td2.id |
| | | LEFT JOIN |
| | | asset_warehouse aw ON am.address_type = 1 AND am.warehouse_id = aw.id |
| | | WHERE |
| | | aiti.inventory_task_id = #{taskId} |
| | | ORDER BY |
| | |
| | | am.measurement_unit, |
| | | am.quantity, |
| | | am.unit_price, |
| | | ( am.quantity * am.unit_price ) AS total_value, |
| | | am.total_value, |
| | | am.accounting_voucher_no, |
| | | am.accounting_subject, |
| | | am.accounting_status, |
| | | am.accounting_amount, |
| | | am.accounting_date, |
| | | am.asset_status, |
| | | od.dept_name AS ownership_dept_name, |
| | | td.dept_name AS ownership_dept_name, |
| | | am.ownership_dept_id, |
| | | am.asset_type_id, |
| | | am.address_type, |
| | | am.address, |
| | | am.use_dept_id, |
| | | am.warehouse_id, |
| | | od2.dept_name AS use_dept_name, |
| | | su.nick_name AS user_name, |
| | | am.user_name, |
| | | aw.warehouse_name, |
| | | td2.dept_name AS use_dept_name, |
| | | su.nick_name AS check_user_name, |
| | | aiti.result_status AS inventory_status, |
| | | aiti.real_dept_name, |
| | | aiti.real_user_name |
| | | aiti.real_user_name, |
| | | aiti.id AS asset_inventory_task_item_id, |
| | | aiti.exception_explain |
| | | FROM |
| | | asset_inventory_task_item aiti |
| | | INNER JOIN |
| | |
| | | LEFT JOIN |
| | | asset_type at ON am.asset_type_id = at.id |
| | | LEFT JOIN |
| | | sys_dept od ON am.ownership_dept_id = od.dept_id |
| | | t_dept td ON am.ownership_dept_id = td.id |
| | | LEFT JOIN |
| | | sys_user su ON aiti.user_id = su.user_id |
| | | LEFT JOIN sys_dept od2 ON am.address_type = 0 AND am.use_dept_id = od2.id |
| | | LEFT JOIN |
| | | t_dept td2 ON am.address_type = 0 AND am.use_dept_id = td2.id |
| | | LEFT JOIN |
| | | asset_warehouse aw ON am.address_type = 1 AND am.warehouse_id = aw.id |
| | | <where> |
| | | aiti.inventory_task_id = #{query.id} |
| | | <if test="query.keyword != null and query.keyword != ''"> |