| | |
| | | |
| | | @Override |
| | | public List<NoticeDTO> selectCount() { |
| | | List<Notice> notices = noticeMapper.selectList(Wrappers.lambdaQuery(Notice.class).groupBy(Notice::getType)); |
| | | // 只查 type 一列并按其分组(原写法 selectList+groupBy 会带出全部列,在 ONLY_FULL_GROUP_BY 下报 1055) |
| | | List<Notice> notices = noticeMapper.selectList(Wrappers.lambdaQuery(Notice.class).select(Notice::getType).groupBy(Notice::getType)); |
| | | List<NoticeDTO> result = new ArrayList<>(); |
| | | for (Notice notice : notices) { |
| | | NoticeDTO notice1 = new NoticeDTO(); |
| | |
| | | import com.deepoove.poi.config.Configure; |
| | | import com.ruoyi.common.enums.StockInQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockOutQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.HackLoopTableRenderPolicy; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.procurementrecord.service.ProcurementRecordService; |
| | |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.net.URLEncoder; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | |
| | | InputStream inputStream = this.getClass().getResourceAsStream("/static/report-template.docx"); |
| | | Configure configure = Configure.builder() |
| | | .bind("paramList", new HackLoopTableRenderPolicy()) |
| | | //日期默认按Date.toString()渲染(如Sun Sep 27 00:00:00 CST 2026),这里统一格式化为yyyy-MM-dd |
| | | .addPreRenderDataCastor((policy, data) -> data instanceof Date |
| | | ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, (Date) data) : data) |
| | | .build(); |
| | | String finalInspectType = inspectType; |
| | | XWPFTemplate template = XWPFTemplate.compile(inputStream, configure).render( |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <?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.ruoyi.account.mapper.AccountExpenseMapper"> |
| | | <select id="accountExpenseListPage" resultType="com.ruoyi.account.pojo.AccountExpense"> |
| | |
| | | <if test="accountExpense.expenseMethod != null and accountExpense.expenseMethod != '' "> |
| | | AND expense_method = #{accountExpense.expenseMethod} |
| | | </if> |
| | | ORDER BY expense_date DESC, id DESC |
| | | </select> |
| | | <select id="accountExpenseExport" resultType="com.ruoyi.account.pojo.AccountExpense"> |
| | | SELECT |
| | |
| | | <if test="dateQueryDto.entryDateEnd != null and dateQueryDto.entryDateEnd != '' "> |
| | | AND expense_date <= DATE_FORMAT(#{dateQueryDto.entryDateEnd},'%Y-%m-%d') |
| | | </if> |
| | | group by expense_type |
| | | group by expense_type, sdd.dict_label |
| | | </select> |
| | | |
| | | <select id="report1" resultType="java.math.BigDecimal"> |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <?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.ruoyi.account.mapper.AccountIncomeMapper"> |
| | | |
| | |
| | | <if test="accountIncome.incomeMethod != null and accountIncome.incomeMethod != '' "> |
| | | AND income_method = #{accountIncome.incomeMethod} |
| | | </if> |
| | | ORDER BY income_date DESC, id DESC |
| | | </select> |
| | | <select id="accountIncomeExport" resultType="com.ruoyi.account.pojo.AccountIncome"> |
| | | SELECT |
| | |
| | | <if test="dateQueryDto.entryDateEnd != null and dateQueryDto.entryDateEnd != '' "> |
| | | AND income_date <= DATE_FORMAT(#{dateQueryDto.entryDateEnd},'%Y-%m-%d') |
| | | </if> |
| | | group by income_type |
| | | group by income_type, sdd.dict_label |
| | | </select> |
| | | <select id="report1" resultType="java.math.BigDecimal"> |
| | | SELECT |
| | |
| | | and rm.return_no like concat('%',#{ew.returnManagementNo},'%') |
| | | </if> |
| | | </where> |
| | | ORDER BY srao.id DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <if test="req.approveType != null "> |
| | | and approve_type = #{req.approveType} |
| | | </if> |
| | | ORDER BY approve_time DESC, approve_id DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | and type = #{knowledgeBase.type} |
| | | </if> |
| | | </where> |
| | | |
| | | ORDER BY create_time DESC, id DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | and type = #{notificationManagement.type} |
| | | </if> |
| | | </where> |
| | | ORDER BY create_time DESC, id DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | AND T1.is_white = #{supplierManageDto.isWhite} |
| | | </if> |
| | | </where> |
| | | ORDER BY T1.maintain_time DESC, T1.id DESC |
| | | </select> |
| | | |
| | | <select id="supplierExportList" resultType="com.ruoyi.basic.excel.SupplierManageExcelDto"> |
| | |
| | | and n.status = #{ew.status} |
| | | </if> |
| | | </where> |
| | | ORDER BY n.create_time DESC, n.id DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | and rrm.category = #{ew.category} |
| | | </if> |
| | | </where> |
| | | ORDER BY rrm.effective_time DESC, rrm.id DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | |
| | | <select id="listPage" resultType="com.ruoyi.collaborativeApproval.dto.SealApplicationManagementDTO"> |
| | | select sam.*, su.user_name as create_user_name, d.dept_name as department, |
| | | select sam.*, su.user_name as create_user_name, |
| | | (select d.dept_name from sys_user_dept sud join sys_dept d on d.dept_id = sud.dept_id |
| | | where sud.user_id = su.user_id order by sud.dept_id desc limit 1) as department, |
| | | su1.nick_name as approveUserName |
| | | from seal_application_management sam |
| | | left join sys_user su on sam.create_user = su.user_id |
| | | left join sys_user su1 on sam.approve_user_id = su1.user_id |
| | | left join sys_user_dept sud on su.user_id = sud.user_id |
| | | left join sys_dept d on sud.dept_id = d.dept_id |
| | | <where> |
| | | <if test="ew.applicationNum != null and ew.applicationNum != ''"> |
| | | and sam.application_num like concat('%',#{ew.applicationNum},'%') |
| | |
| | | sjlr.staff_no, |
| | | sjlr.staff_name, |
| | | sjlr.sex, |
| | | sjlr.post_job, |
| | | (SELECT p.post_name FROM sys_post p WHERE p.post_id = sjlr.sys_post_id LIMIT 1) AS post_job, |
| | | sjlr.adress, |
| | | sjlr.profession, |
| | | sjlr.identity_card, |
| | |
| | | <if test="staffContactsPersonalDTO.staffName != null and staffContactsPersonalDTO.staffName != ''"> |
| | | and sjlr.staff_name like concat('%',#{staffContactsPersonalDTO.staffName},'%') |
| | | </if> |
| | | |
| | | ORDER BY scp.create_time DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | and ddr.status = #{deviceDefectRecordDto.status} |
| | | </if> |
| | | </where> |
| | | |
| | | ORDER BY ddr.id DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | and dm.maintenance_actually_time < date_add(str_to_date(#{deviceMaintenanceDto.maintenanceActuallyTime}, '%Y-%m-%d'), interval 1 day) |
| | | </if> |
| | | </where> |
| | | ORDER BY dm.id DESC |
| | | </select> |
| | | <select id="detailById" resultType="com.ruoyi.device.dto.DeviceMaintenanceDto"> |
| | | select dm.id, |
| | |
| | | and dr.maintenance_time like concat('%',#{deviceRepairDto.maintenanceTimeStr},'%') |
| | | </if> |
| | | </where> |
| | | ORDER BY dr.id DESC |
| | | </select> |
| | | <select id="detailById" resultType="com.ruoyi.device.dto.DeviceRepairDto"> |
| | | select dr.id, |
| | |
| | | <if test="req.name != null and req.name != ''"> |
| | | and `name` like concat('%',#{req.name},'%') |
| | | </if> |
| | | ORDER BY run_date DESC, id DESC |
| | | </select> |
| | | <select id="listPageByTrend" resultType="com.ruoyi.equipmentenergyconsumption.pojo.EquipmentEnergyConsumption"> |
| | | SELECT |
| | |
| | | <if test="req.name != null and req.name != ''"> |
| | | and `name` like concat('%',#{req.name},'%') |
| | | </if> |
| | | GROUP BY |
| | | `code` |
| | | ORDER BY |
| | | update_time DESC; |
| | | update_time DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | and t1.adopted_date is null and t1.issue_date < current_date() |
| | | </if> |
| | | </where> |
| | | ORDER BY t1.Issue_date DESC, t1.id DESC |
| | | </select> |
| | | <select id="list" resultType="com.ruoyi.lavorissue.pojo.LaborIssue"> |
| | | select |
| | |
| | | and sp.name like concat('%',#{spareParts.name},'%') |
| | | </if> |
| | | </where> |
| | | ORDER BY id DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | and op.status = #{req.status} |
| | | </if> |
| | | </where> |
| | | ORDER BY op.start_date DESC, op.project_id DESC |
| | | </select> |
| | | <select id="selectByIds" resultType="com.ruoyi.oA.dto.OaProjectDto"> |
| | | select op.*,su.nick_name as managerName from oa_project op |
| | |
| | | and status = #{req.status} |
| | | </if> |
| | | </where> |
| | | ORDER BY apply_time DESC, id DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | <mapper namespace="com.ruoyi.procurementrecord.mapper.CustomStorageMapper"> |
| | | |
| | | <select id="listPageCopyByCustom" resultType="com.ruoyi.procurementrecord.pojo.CustomStorage"> |
| | | select t1.*, |
| | | select ANY_VALUE(t1.id) as id, |
| | | t1.product_category, |
| | | t1.specification_model, |
| | | t1.tax_inclusive_unit_price, |
| | | ANY_VALUE(t1.item_type) as item_type, |
| | | ANY_VALUE(t1.inbound_date) as inbound_date, |
| | | ANY_VALUE(t1.inbound_batches) as inbound_batches, |
| | | ANY_VALUE(t1.supplier_name) as supplier_name, |
| | | ANY_VALUE(t1.unit) as unit, |
| | | ANY_VALUE(t1.tax_inclusive_total_price) as tax_inclusive_total_price, |
| | | ANY_VALUE(t1.tax_rate) as tax_rate, |
| | | ANY_VALUE(t1.tax_exclusive_total_price) as tax_exclusive_total_price, |
| | | ANY_VALUE(t1.create_by) as create_by, |
| | | ANY_VALUE(t1.create_time) as create_time, |
| | | ANY_VALUE(t1.update_time) as update_time, |
| | | ANY_VALUE(t1.create_user) as create_user, |
| | | ANY_VALUE(t1.update_user) as update_user, |
| | | ANY_VALUE(t1.tenant_id) as tenant_id, |
| | | ANY_VALUE(t1.code) as code, |
| | | sum(t1.inbound_num) as inboundNum, |
| | | sum(t1.inbound_num) as inboundNum0, |
| | | sum(t1.tax_inclusive_total_price) as taxInclusiveTotalPrice, |
| | |
| | | </where> |
| | | group by t1.product_category, t1.specification_model, t1.tax_inclusive_unit_price |
| | | HAVING availableStock > 0 |
| | | order by t1.inbound_date desc |
| | | order by ANY_VALUE(t1.inbound_date) desc |
| | | </select> |
| | | </mapper> |
| | |
| | | and supplier_name like concat('%',#{req.supplierName},'%') |
| | | </if> |
| | | </where> |
| | | ORDER BY id DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | <select id="listProcurementBySalesLedgerId" resultType="com.ruoyi.procurementrecord.dto.ProcurementDto"> |
| | | select |
| | | t1.supplier_name, |
| | | ANY_VALUE(t1.supplier_name) as supplier_name, |
| | | t2.product_category, |
| | | t2.id, |
| | | t3.id as recordId, |
| | | ANY_VALUE(t3.id) as recordId, |
| | | t2.specification_model, |
| | | t2.unit, |
| | | t2.quantity, |
| | |
| | | t2.tax_inclusive_unit_price, |
| | | t2.tax_inclusive_total_price, |
| | | t2.tax_exclusive_total_price, |
| | | t3.inbound_num as quantityStock |
| | | ANY_VALUE(t3.inbound_num) as quantityStock |
| | | from purchase_ledger t1 |
| | | left join sales_ledger_product t2 on t1.id = t2.sales_ledger_id and slp.type = 2 |
| | | left join sales_ledger_product t2 on t1.id = t2.sales_ledger_id and t2.type = 2 |
| | | left join procurement_record_storage t3 on t2.id = t3.sales_ledger_product_id |
| | | where t1.purchase_contract_number = #{req.purchaseContractNumber} |
| | | <if test="req.id != null and req.id != ''"> |
| | |
| | | <select id="listPageCopy" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDtoCopy"> |
| | | select |
| | | t3.supplier_name, |
| | | t3.purchase_contract_number, |
| | | ANY_VALUE(t3.purchase_contract_number) as purchase_contract_number, |
| | | t2.product_category, |
| | | t1.id, |
| | | t1.sales_ledger_product_id, |
| | | t1.create_user, |
| | | ANY_VALUE(t1.id) as id, |
| | | ANY_VALUE(t1.sales_ledger_product_id) as sales_ledger_product_id, |
| | | ANY_VALUE(t1.create_user) as create_user, |
| | | t2.specification_model, |
| | | t2.unit, |
| | | t2.min_stock, |
| | | t2.tax_rate, |
| | | t2.tax_inclusive_unit_price, |
| | | t2.tax_inclusive_total_price, |
| | | t2.tax_exclusive_total_price, |
| | | t1.inbound_batches, |
| | | ANY_VALUE(t2.unit) as unit, |
| | | ANY_VALUE(t2.min_stock) as min_stock, |
| | | ANY_VALUE(t2.tax_rate) as tax_rate, |
| | | ANY_VALUE(t2.tax_inclusive_unit_price) as tax_inclusive_unit_price, |
| | | ANY_VALUE(t2.tax_inclusive_total_price) as tax_inclusive_total_price, |
| | | ANY_VALUE(t2.tax_exclusive_total_price) as tax_exclusive_total_price, |
| | | ANY_VALUE(t1.inbound_batches) as inbound_batches, |
| | | t1.unit_price as unitPrice, |
| | | sum(t1.total_price) as totalPrice, |
| | | sum(t1.inbound_num) as inboundNum, |
| | | sum(t1.inbound_num) as inboundNum0, |
| | | t1.inbound_num as totalInboundNum, |
| | | t1.create_time, |
| | | t1.update_time, |
| | | t1.create_by, |
| | | t2.warn_num |
| | | ANY_VALUE(t1.inbound_num) as totalInboundNum, |
| | | ANY_VALUE(t1.create_time) as create_time, |
| | | ANY_VALUE(t1.update_time) as update_time, |
| | | ANY_VALUE(t1.create_by) as create_by, |
| | | ANY_VALUE(t2.warn_num) as warn_num |
| | | from procurement_record_storage t1 |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 2 |
| | | left join purchase_ledger t3 on t3.id = t2.sales_ledger_id |
| | |
| | | <select id="listCopy" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDtoCopy"> |
| | | select |
| | | t3.supplier_name, |
| | | t3.purchase_contract_number, |
| | | ANY_VALUE(t3.purchase_contract_number) as purchase_contract_number, |
| | | t2.product_category, |
| | | t1.id, |
| | | t1.sales_ledger_product_id, |
| | | t1.create_user, |
| | | t2.specification_model, |
| | | t2.unit, |
| | | t2.tax_rate, |
| | | t2.tax_inclusive_unit_price, |
| | | t2.tax_inclusive_total_price, |
| | | t2.tax_exclusive_total_price, |
| | | t1.inbound_batches, |
| | | t1.inbound_num, |
| | | t1.inbound_num as inboundNum0, |
| | | t1.create_time, |
| | | t1.update_time, |
| | | t1.create_time as cTime, |
| | | t1.update_time as uTime, |
| | | t1.create_by |
| | | ANY_VALUE(t1.id) as id, |
| | | ANY_VALUE(t1.sales_ledger_product_id) as sales_ledger_product_id, |
| | | ANY_VALUE(t1.create_user) as create_user, |
| | | ANY_VALUE(t2.specification_model) as specification_model, |
| | | ANY_VALUE(t2.unit) as unit, |
| | | ANY_VALUE(t2.tax_rate) as tax_rate, |
| | | ANY_VALUE(t2.tax_inclusive_unit_price) as tax_inclusive_unit_price, |
| | | ANY_VALUE(t2.tax_inclusive_total_price) as tax_inclusive_total_price, |
| | | ANY_VALUE(t2.tax_exclusive_total_price) as tax_exclusive_total_price, |
| | | ANY_VALUE(t1.inbound_batches) as inbound_batches, |
| | | ANY_VALUE(t1.inbound_num) as inbound_num, |
| | | ANY_VALUE(t1.inbound_num) as inboundNum0, |
| | | ANY_VALUE(t1.create_time) as create_time, |
| | | ANY_VALUE(t1.update_time) as update_time, |
| | | ANY_VALUE(t1.create_time) as cTime, |
| | | ANY_VALUE(t1.update_time) as uTime, |
| | | ANY_VALUE(t1.create_by) as create_by |
| | | from procurement_record_storage t1 |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 2 |
| | | left join purchase_ledger t3 on t3.id = t2.sales_ledger_id |
| | |
| | | </select> |
| | | <select id="listCopyOne" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDtoCopy"> |
| | | select |
| | | t3.customer_contract_no, |
| | | t3.sales_contract_no, |
| | | ANY_VALUE(t3.customer_contract_no) as customer_contract_no, |
| | | ANY_VALUE(t3.sales_contract_no) as sales_contract_no, |
| | | t3.customer_name, |
| | | t2.product_category, |
| | | t1.id, |
| | | t1.sales_ledger_product_id, |
| | | t1.create_user, |
| | | t2.specification_model, |
| | | t2.unit, |
| | | t2.tax_rate, |
| | | t2.tax_inclusive_unit_price, |
| | | t2.tax_inclusive_total_price, |
| | | t2.tax_exclusive_total_price, |
| | | t1.inbound_batches, |
| | | t1.inbound_num, |
| | | t1.inbound_num as inboundNum0, |
| | | t1.create_time, |
| | | t1.update_time, |
| | | t1.create_time as cTime, |
| | | t1.update_time as uTime, |
| | | t1.create_by |
| | | ANY_VALUE(t1.id) as id, |
| | | ANY_VALUE(t1.sales_ledger_product_id) as sales_ledger_product_id, |
| | | ANY_VALUE(t1.create_user) as create_user, |
| | | ANY_VALUE(t2.specification_model) as specification_model, |
| | | ANY_VALUE(t2.unit) as unit, |
| | | ANY_VALUE(t2.tax_rate) as tax_rate, |
| | | ANY_VALUE(t2.tax_inclusive_unit_price) as tax_inclusive_unit_price, |
| | | ANY_VALUE(t2.tax_inclusive_total_price) as tax_inclusive_total_price, |
| | | ANY_VALUE(t2.tax_exclusive_total_price) as tax_exclusive_total_price, |
| | | ANY_VALUE(t1.inbound_batches) as inbound_batches, |
| | | ANY_VALUE(t1.inbound_num) as inbound_num, |
| | | ANY_VALUE(t1.inbound_num) as inboundNum0, |
| | | ANY_VALUE(t1.create_time) as create_time, |
| | | ANY_VALUE(t1.update_time) as update_time, |
| | | ANY_VALUE(t1.create_time) as cTime, |
| | | ANY_VALUE(t1.update_time) as uTime, |
| | | ANY_VALUE(t1.create_by) as create_by |
| | | from procurement_record_storage t1 |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 1 |
| | | left join sales_ledger t3 on t3.id = t2.sales_ledger_id |
| | |
| | | and sl.sales_contract_no like concat('%',#{req.salesContractNo},'%') |
| | | </if> |
| | | </where> |
| | | ORDER BY rm.make_time DESC, rm.id DESC |
| | | </select> |
| | | <select id="getReturnManagementDtoById" resultType="com.ruoyi.procurementrecord.dto.ReturnManagementDto"> |
| | | select rm.*, |
| | |
| | | and po.create_time between #{c.startTime} and #{c.endTime} |
| | | </if> |
| | | </where> |
| | | ORDER BY po.create_time DESC, po.id DESC |
| | | </select> |
| | | <select id="listProcessRoute" resultType="com.ruoyi.production.pojo.ProcessRoute"> |
| | | select pr.* |
| | |
| | | <if test="c.productOrderId != null and c.productOrderId != ''"> |
| | | and pwo.product_order_id = #{c.productOrderId} |
| | | </if> |
| | | ORDER BY pwo.create_time DESC, pwo.id DESC |
| | | </select> |
| | | <select id="getProductWorkOrderFlowCard" resultType="com.ruoyi.production.dto.ProductWorkOrderDto"> |
| | | SELECT |
| | |
| | | and ppm.id = #{c.productMainId} |
| | | </if> |
| | | </where> |
| | | order by ppi.id |
| | | order by ppi.id DESC |
| | | </select> |
| | | |
| | | <delete id="deleteByProductMainIds" parameterType="java.util.List"> |
| | |
| | | and ppm.status = #{c.status} |
| | | </if> |
| | | </where> |
| | | order by ppm.id |
| | | order by ppm.id DESC |
| | | |
| | | </select> |
| | | <select id="getOrderByMainId" resultType="com.ruoyi.production.pojo.ProductOrder"> |
| | |
| | | and ppm.id = #{c.productMainId} |
| | | </if> |
| | | </where> |
| | | order by ppo.id |
| | | order by ppo.id DESC |
| | | </select> |
| | | |
| | | <delete id="deleteByProductMainIds" parameterType="java.util.List"> |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | <?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.ruoyi.production.mapper.SalesLedgerProductionAccountingMapper"> |
| | | |
| | |
| | | FROM |
| | | sales_ledger_production_accounting t4 |
| | | LEFT JOIN sales_ledger T1 ON T1.id = t4.sales_ledger_id |
| | | left join sales_ledger_product t3 on t4.sales_ledger_product_id = t3.id and slp.type = 1 |
| | | left join sales_ledger_product t3 on t4.sales_ledger_product_id = t3.id and t3.type = 1 |
| | | <where> |
| | | t3.type = 1 |
| | | <if test="salesLedgerDto.schedulingUserName != null and salesLedgerDto.schedulingUserName != '' "> |
| | |
| | | </if> |
| | | |
| | | </where> |
| | | GROUP BY slpa.scheduling_user_name |
| | | GROUP BY slpa.scheduling_user_id, slpa.scheduling_user_name |
| | | |
| | | </select> |
| | | |
| | |
| | | left join product_process pp on pp.name = slpa.process |
| | | where slpa.scheduling_user_id = #{ew.userId} |
| | | and slpa.scheduling_date like concat(#{ew.date}, '%') |
| | | group by slpa.scheduling_user_id |
| | | group by slpa.scheduling_user_id, pp.type |
| | | |
| | | </select> |
| | | |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | <?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.ruoyi.production.mapper.SalesLedgerSchedulingMapper"> |
| | | |
| | |
| | | LEFT join sales_ledger_scheduling t3 on T1.id = t3.sales_ledger_id |
| | | where T1.id is not null and T2.type = 1 |
| | | GROUP BY T2.id |
| | | ORDER BY T2.id DESC |
| | | </select> |
| | | <select id="listPageProcess" resultType="com.ruoyi.production.dto.SalesLedgerSchedulingProcessDto"> |
| | | SELECT |
| | |
| | | FROM |
| | | sales_ledger_scheduling T2 |
| | | LEFT JOIN sales_ledger T1 ON T1.id = T2.sales_ledger_id |
| | | left join sales_ledger_product t3 on T2.sales_ledger_product_id = t3.id and slp.type = 1 |
| | | left join sales_ledger_product t3 on T2.sales_ledger_product_id = t3.id and t3.type = 1 |
| | | <where> |
| | | t3.type = 1 |
| | | <if test="salesLedgerDto.status != null and salesLedgerDto.status != '' "> |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | <?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.ruoyi.production.mapper.SalesLedgerWorkMapper"> |
| | | |
| | |
| | | FROM |
| | | sales_ledger_work t4 |
| | | LEFT JOIN sales_ledger T1 ON T1.id = t4.sales_ledger_id |
| | | left join sales_ledger_product t3 on t4.sales_ledger_product_id = t3.id and slp.type = 1 |
| | | left join sales_ledger_product t3 on t4.sales_ledger_product_id = t3.id and t3.type = 1 |
| | | left join sales_ledger_scheduling t2 on t4.sales_ledger_scheduling_id = t2.id |
| | | <where> |
| | | t3.type = 1 |
| | |
| | | or pl.purchase_contract_number LIKE CONCAT('%', #{supplierNameOrContractNo}, '%') |
| | | </if> |
| | | </where> |
| | | ORDER BY pr.payment_date DESC, pr.id DESC |
| | | </select> |
| | | |
| | | <select id="selectPaymentRegistrationById" parameterType="Long" resultMap="PaymentRegistrationDtoResult"> |
| | |
| | | FROM payment_registration |
| | | WHERE supplier_id = #{supplierId} |
| | | ) T1 |
| | | ORDER BY T1.happenTime ASC |
| | | ORDER BY T1.happenTime DESC |
| | | |
| | | </select> |
| | | |
| | |
| | | T1.supplier_name LIKE CONCAT ('%',#{req.supplierName},'%') |
| | | </if> |
| | | </where> |
| | | GROUP BY T1.supplier_name |
| | | GROUP BY T1.supplier_id, T1.supplier_name |
| | | ORDER BY invoiceAmount DESC |
| | | </select> |
| | | |
| | | <select id="supplierNameListPageDetails" resultType="com.ruoyi.purchase.dto.PaymentRegistrationDto"> |
| | | SELECT |
| | | T1.supplier_id, |
| | | T1.supplier_name, |
| | | ANY_VALUE(T1.supplier_id) AS supplier_id, |
| | | ANY_VALUE(T1.supplier_name) AS supplier_name, |
| | | SUM(contract_amount) AS invoiceAmount, |
| | | IFNULL( SUM(T2.current_payment_amount) , 0 ) AS paymentAmount, |
| | | IFNULL((IFNULL(SUM(contract_amount),0) - IFNULL(SUM(T2.current_payment_amount),0)),0) AS payableAmount, |
| | |
| | | <if test="c.purchaseContractNumber != null and c.purchaseContractNumber != ''"> |
| | | and tr.purchase_contract_number like concat('%',#{c.purchaseContractNumber},'%') |
| | | </if> |
| | | ORDER BY tr.issue_date DESC, pr.id DESC |
| | | </select> |
| | | <select id="getProductRecordById" resultType="com.ruoyi.purchase.dto.ProductRecordDto"> |
| | | SELECT |
| | |
| | | <if test="params.no != null and params.no != '' "> |
| | | AND pro.no LIKE CONCAT('%',#{params.no},'%') |
| | | </if> |
| | | ORDER BY pro.prepared_at DESC, pro.id DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | <if test="qualityUnqualified.entryDateEnd != null and qualityUnqualified.entryDateEnd != '' "> |
| | | AND check_time <= DATE_FORMAT(#{qualityUnqualified.entryDateEnd},'%Y-%m-%d') |
| | | </if> |
| | | ORDER BY qu.check_time DESC, qu.id DESC |
| | | </select> |
| | | <select id="qualityUnqualifiedExport" resultType="com.ruoyi.quality.pojo.QualityUnqualified"> |
| | | SELECT |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <?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"> |
| | |
| | | AND DATE_FORMAT(T1.invoice_date,'%Y-%m-%d') = DATE_FORMAT(#{invoiceLedgerDto.invoiceDate},'%Y-%m-%d') |
| | | </if> |
| | | </where> |
| | | ORDER BY T1.invoice_date DESC, T1.id DESC |
| | | </select> |
| | | |
| | | <select id="invoiceLedgerList" resultType="com.ruoyi.sales.dto.InvoiceLedgerDto"> |
| | |
| | | AND DATE_FORMAT(T1.invoice_date,'%Y-%m-%d') = DATE_FORMAT(#{invoiceLedgerDto.invoiceDate},'%Y-%m-%d') |
| | | </if> |
| | | </where> |
| | | ORDER BY T1.invoice_date DESC, T1.id DESC |
| | | </select> |
| | | |
| | | <select id="invoiceLedgerInfo" resultType="com.ruoyi.sales.dto.InvoiceLedgerDto"> |
| | |
| | | T1.customer_name LIKE CONCAT ('%',#{invoiceLedgerDto.searchText},'%') |
| | | </if> |
| | | </where> |
| | | GROUP BY T1.customer_name |
| | | GROUP BY T1.customer_id, T1.customer_name |
| | | </select> |
| | | |
| | | <select id="invoiceLedgerProductInfo" resultType="com.ruoyi.sales.dto.InvoiceRegistrationProductDto"> |
| | |
| | | GROUP BY |
| | | invoice_registration_id |
| | | ) T4 ON T1.id = T4.invoice_registration_id |
| | | ORDER BY T1.id DESC |
| | | </select> |
| | | |
| | | <select id="invoiceRegisAndProductExcelDtoList" resultType="com.ruoyi.sales.excel.InvoiceRegisAndProductExcelDto"> |
| | |
| | | JOIN sales_ledger T2 ON T1.sales_ledger_id = T2.id |
| | | JOIN customer T3 ON T1.customer_id = T3.id |
| | | JOIN invoice_registration_product T4 ON T1.id = T4.invoice_registration_id |
| | | ORDER BY T1.id ASC |
| | | ORDER BY T1.id DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <?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"> |
| | |
| | | AND T4.customer_id = #{receiptPaymentDto.customerId} |
| | | </if> |
| | | </where> |
| | | ORDER BY T1.create_time ASC |
| | | ORDER BY T1.create_time DESC |
| | | </select> |
| | | |
| | | <select id="receiptPaymentInfo" resultType="com.ruoyi.sales.dto.ReceiptPaymentDto"> |
| | |
| | | FROM invoice_ledger_file |
| | | GROUP BY invoice_ledger_id |
| | | ) T4 ON T4.invoice_ledger_id = T1.id |
| | | LEFT JOIN sales_ledger_product T5 ON T2.sales_ledger_product_id = T5.id and slp.type = 1 |
| | | LEFT JOIN sales_ledger_product T5 ON T2.sales_ledger_product_id = T5.id and T5.type = 1 |
| | | LEFT JOIN ( |
| | | SELECT |
| | | SUM(receipt_payment_amount) AS receipt_payment_amount_total, |
| | |
| | | LEFT JOIN invoice_ledger T2 ON T1.invoice_ledger_id = T2.id |
| | | WHERE |
| | | T2.invoice_registration_product_id = #{invoiceRegistrationProductId} |
| | | ORDER BY T1.receipt_payment_date DESC |
| | | </select> |
| | | <select id="bindInvoiceNoRegListAll" resultType="com.ruoyi.sales.dto.ReceiptPaymentDto"> |
| | | SELECT |
| | |
| | | GROUP_CONCAT( name ORDER BY id ASC SEPARATOR ' | ') AS invoiceFileName |
| | | FROM invoice_ledger_file GROUP BY invoice_ledger_id |
| | | ) T4 ON T4.invoice_ledger_id = T1.id |
| | | LEFT JOIN sales_ledger_product T5 ON T2.sales_ledger_product_id = T5.id and slp.type = 1 |
| | | LEFT JOIN sales_ledger_product T5 ON T2.sales_ledger_product_id = T5.id and T5.type = 1 |
| | | LEFT JOIN ( |
| | | SELECT SUM(receipt_payment_amount) AS receipt_payment_amount_total,invoice_ledger_id FROM receipt_payment GROUP |
| | | BY invoice_ledger_id |
| | |
| | | GROUP_CONCAT( name ORDER BY id ASC SEPARATOR ' | ') AS invoiceFileName |
| | | FROM invoice_ledger_file GROUP BY invoice_ledger_id |
| | | ) T4 ON T4.invoice_ledger_id = T1.id |
| | | LEFT JOIN sales_ledger_product T5 ON T2.sales_ledger_product_id = T5.id and slp.type = 1 |
| | | LEFT JOIN sales_ledger_product T5 ON T2.sales_ledger_product_id = T5.id and T5.type = 1 |
| | | LEFT JOIN ( |
| | | SELECT SUM(receipt_payment_amount) AS receipt_payment_amount_total,invoice_ledger_id FROM receipt_payment GROUP |
| | | BY invoice_ledger_id |
| | |
| | | T1.customer_name LIKE CONCAT('%',#{salesLedgerDto.customerName},'%') |
| | | </if> |
| | | </where> |
| | | ORDER BY T1.entry_date DESC, T1.id DESC |
| | | </select> |
| | | |
| | | <select id="selectSalesLedgerListPage" resultType="com.ruoyi.sales.pojo.SalesLedger"> |
| | |
| | | and sl.customer_name like concat('%',#{ew.customerName},'%') |
| | | </if> |
| | | </where> |
| | | ORDER BY sl.entry_date DESC, sl.id DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | resultType="com.ruoyi.purchase.dto.ProcurementBusinessSummaryDto"> |
| | | SELECT |
| | | slp.product_category AS productCategory, |
| | | slp.specification_model AS specificationModel, |
| | | sl.supplier_name AS supplierName, |
| | | ANY_VALUE(slp.specification_model) AS specificationModel, |
| | | ANY_VALUE(sl.supplier_name) AS supplierName, |
| | | SUM(slp.quantity) AS purchaseNum, |
| | | SUM(slp.tax_inclusive_total_price) AS purchaseAmount, |
| | | COUNT(DISTINCT slp.sales_ledger_id) AS purchaseTimes, |
| | |
| | | <if test="salesQuotationDto.status != null and salesQuotationDto.status != '' "> |
| | | AND t1.status = #{salesQuotationDto.status} |
| | | </if> |
| | | ORDER BY t1.quotation_date DESC, t1.id DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | <mapper namespace="com.ruoyi.sales.mapper.ShipmentApprovalMapper"> |
| | | |
| | | <select id="listPage" resultType="com.ruoyi.sales.pojo.ShipmentApproval"> |
| | | SELECT *, |
| | | SELECT sa.*, |
| | | slp.product_category, slp.specification_model, slp.unit, slp.quantity, slp.min_stock, |
| | | slp.tax_rate, slp.tax_inclusive_unit_price, slp.tax_inclusive_total_price, slp.tax_exclusive_total_price, |
| | | slp.invoice_type, slp.type, |
| | | si.shipping_car_number, |
| | | si.shipping_date, |
| | | T2.nick_name AS entry_person_name |
| | | FROM shipment_approval sa |
| | | LEFT JOIN shipping_info si ON sa.shipping_info_id = si.id |
| | |
| | | AND sl.sales_contract_no LIKE CONCAT('%',#{req.salesContractNo},'%') |
| | | </if> |
| | | </where> |
| | | ORDER BY sa.id DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | sl.customer_name |
| | | FROM shipping_info s |
| | | LEFT JOIN sales_ledger sl ON s.sales_ledger_id = sl.id |
| | | ORDER BY s.shipping_date DESC, s.id DESC |
| | | </select> |
| | | <select id="getReturnManagementDtoById" resultType="com.ruoyi.sales.dto.SalesLedgerProductDto"> |
| | | SELECT |
| | |
| | | and personal_attendance_records.date >= #{params.date} |
| | | and personal_attendance_records.date < DATE_ADD(DATE(#{params.date}), INTERVAL 1 DAY) |
| | | </if> |
| | | ORDER BY personal_attendance_records.id DESC |
| | | </select> |
| | | |
| | | <!-- 查询指定日期没有考勤记录的在职员工(在指定时间之前入职的) --> |
| | |
| | | <if test="staffContract.staffOnJobId != null"> |
| | | AND soj.id = #{staffContract.staffOnJobId} |
| | | </if> |
| | | ORDER BY sc.contract_start_time DESC, sc.id DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | <if test="c.staffName != null and c.staffName != '' "> |
| | | AND soj.staff_name LIKE CONCAT('%',#{c.staffName},'%') |
| | | </if> |
| | | ORDER BY staff_leave.id DESC |
| | | </select> |
| | | <select id="staffLeaveList" resultType="com.ruoyi.staff.dto.StaffLeaveDto"> |
| | | SELECT |
| | |
| | | <if test="staffOnJob.entryDateEnd != null and staffOnJob.entryDateEnd != '' "> |
| | | AND contract_expire_time <= DATE_FORMAT(#{staffOnJob.entryDateEnd},'%Y-%m-%d') |
| | | </if> |
| | | ORDER BY staff_on_job.sign_date DESC, staff_on_job.id DESC |
| | | </select> |
| | | <select id="staffOnJobList" resultType="com.ruoyi.staff.dto.StaffOnJobDto"> |
| | | SELECT |
| | |
| | | <if test="documentationBorrowManagement.entryDateEnd != null and documentationBorrowManagement.entryDateEnd != ''"> |
| | | and borrow_date <= DATE_FORMAT(#{documentationBorrowManagement.entryDateEnd},'%Y-%m-%d') |
| | | </if> |
| | | ORDER BY borrow_date DESC, id DESC |
| | | </select> |
| | | <select id="export" resultType="com.ruoyi.warehouse.dto.DocumentationBorrowManagementDto"> |
| | | select dbm.*,doc.doc_name |
| | |
| | | <if test="documentation.id != null"> |
| | | and doc.id = #{documentation.id} |
| | | </if> |
| | | ORDER BY id DESC |
| | | </select> |
| | | <select id="listByDocumentClassificationId" resultType="com.ruoyi.warehouse.dto.DocumentationDto"> |
| | | SELECT |
| | |
| | | <if test="documentationReturnManagement.entryDateEnd != null and documentationReturnManagement.entryDateEnd != ''"> |
| | | and return_date <= DATE_FORMAT(#{documentationReturnManagement.entryDateEnd},'%Y-%m-%d') |
| | | </if> |
| | | ORDER BY return_date DESC, id DESC |
| | | </select> |
| | | |
| | | <select id="exportrevent" resultType="com.ruoyi.warehouse.dto.ReturnExportDto"> |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <?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.ruoyi.warehouse.mapper.WarehouseGoodsShelvesMapper"> |
| | |
| | | <where> |
| | | 1=1 |
| | | <if test="warehouseGoodsShelves.goodsShelvesName != null and warehouseGoodsShelves.goodsShelvesName != ''"> |
| | | and wgs.goods_shelves_name like concat('%',#{warehouseGoodsShelves.goodsShelvesName},'%') |
| | | and wgs.name like concat('%',#{warehouseGoodsShelves.goodsShelvesName},'%') |
| | | </if> |
| | | <if test="warehouseGoodsShelves.warehouseId != null"> |
| | | and wgs.warehouse_id = #{warehouseGoodsShelves.warehouseId} |
| | |
| | | <where> |
| | | 1=1 |
| | | <if test="warehouseGoodsShelves.goodsShelvesName != null and warehouseGoodsShelves.goodsShelvesName != ''"> |
| | | and goods_shelves_name like concat('%',#{warehouseGoodsShelves.goodsShelvesName},'%') |
| | | and wgs.name like concat('%',#{warehouseGoodsShelves.goodsShelvesName},'%') |
| | | </if> |
| | | <if test="warehouseGoodsShelves.warehouseId != null"> |
| | | and warehouse_id = #{warehouseGoodsShelves.warehouseId} |
| | |
| | | and t2.device_name like concat('%',#{req.deviceName},'%') |
| | | </if> |
| | | </where> |
| | | ORDER BY t1.id DESC |
| | | </select> |
| | | </mapper> |