| | |
| | | p.product_name as productName, |
| | | pm.model, |
| | | pm.unit, |
| | | u.nick_name as createBy |
| | | u.nick_name as createBy, |
| | | sl.sales_contract_no as salesContractNo |
| | | FROM stock_out_record as sor |
| | | LEFT JOIN product_model as pm on sor.product_model_id = pm.id |
| | | LEFT JOIN product as p on pm.product_id = p.id |
| | | LEFT JOIN sys_user as u on sor.create_user = u.user_id |
| | | <!-- 绑定了销售台账的出库带出合同号;sales_ledger_id 本身已随 sor.* 返回 --> |
| | | LEFT JOIN sales_ledger as sl on sl.id = sor.sales_ledger_id |
| | | <where> |
| | | <if test="params.timeStr != null and params.timeStr != ''"> |
| | | and sor.create_time like concat('%',#{params.timeStr},'%') |
| | |
| | | </foreach> |
| | | </select> |
| | | |
| | | <!-- 油品出库可绑定的销售台账下拉。 |
| | | sales_ledger 不在数据权限白名单里,按 create_user/dept_id 过滤会让油库/发货角色选不到销售建的台账, |
| | | 所以加 /*data_scope*/ 跳过数据权限;只读查询,不按 ledger_type 过滤(代储台账也要能绑) --> |
| | | <select id="bindableSalesLedgerPage" resultType="com.ruoyi.sales.pojo.SalesLedger"> |
| | | select /*data_scope*/ id, |
| | | sales_contract_no, |
| | | customer_contract_no, |
| | | project_name, |
| | | entry_date, |
| | | salesman, |
| | | customer_id, |
| | | customer_name, |
| | | ledger_type, |
| | | oil_depot_id, |
| | | oil_depot_name, |
| | | tank_id, |
| | | tank_no, |
| | | approval_status, |
| | | contract_amount |
| | | from sales_ledger |
| | | where 1=1 |
| | | <if test="req.salesContractNo != null and req.salesContractNo != ''"> |
| | | and sales_contract_no like concat('%',#{req.salesContractNo},'%') |
| | | </if> |
| | | <if test="req.customerName != null and req.customerName != ''"> |
| | | and customer_name like concat('%',#{req.customerName},'%') |
| | | </if> |
| | | <if test="req.projectName != null and req.projectName != ''"> |
| | | and project_name like concat('%',#{req.projectName},'%') |
| | | </if> |
| | | order by id desc |
| | | </select> |
| | | |
| | | <select id="listStockOutRecordExportData" resultType="com.ruoyi.stock.execl.StockOutRecordExportData"> |
| | | SELECT |
| | | sor.*, |