refactor(mapper): 优化数据权限和SQL查询结构

- 为 CrmMailingApplyMapper 添加数据权限注解
- 为 CrmQuoteInfoMapper 和 CrmQuoteMaterialMapper 添加数据权限控制
- 为 ErpProject 相关的 Mapper 添加数据权限注解
- 将所有动态SQL片段从 ${ew.getCustomSqlSegment} 重构为 <where> 标签
- 修复潜在的SQL注入风险并增强查询安全性
- 为 WmsShippingBillMapper 和 WmsShippingDetailsMapper 添加数据权限支持
dev
zangch@mesnac.com 2 days ago
parent db9bf36d90
commit 8b1f480044

@ -69,6 +69,10 @@ public interface CrmMailingApplyMapper extends BaseMapperPlus<CrmMailingApply, C
* @param queryWrapper
* @return
*/
@DataPermission({
@DataColumn(key = "deptName", value = "t.create_dept"),
@DataColumn(key = "userName", value = "t.create_by")
})
Long countCustomCrmMailingApply(@Param(Constants.WRAPPER) Wrapper<CrmMailingApply> queryWrapper);
/**
@ -78,6 +82,10 @@ public interface CrmMailingApplyMapper extends BaseMapperPlus<CrmMailingApply, C
* @param queryWrapper
* @return
*/
@DataPermission({
@DataColumn(key = "deptName", value = "t.create_dept"),
@DataColumn(key = "userName", value = "t.create_by")
})
Page<CrmMailingApplyVo> selectCustomCrmMailingApplyVoPage(@Param("page") Page<CrmMailingApplyVo> page, @Param(Constants.WRAPPER) Wrapper<CrmMailingApply> queryWrapper);
/**
@ -118,6 +126,10 @@ public interface CrmMailingApplyMapper extends BaseMapperPlus<CrmMailingApply, C
* @param queryWrapper
* @return
*/
@DataPermission({
@DataColumn(key = "deptName", value = "t.create_dept"),
@DataColumn(key = "userName", value = "t.create_by")
})
Boolean existsCrmMailingApply(@Param(Constants.WRAPPER) Wrapper<CrmMailingApply> queryWrapper);

@ -1,17 +1,18 @@
package org.dromara.oa.erp.mapper;
import java.util.List;
import java.util.Collection;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import org.apache.ibatis.annotations.Param;
import org.dromara.oa.erp.domain.ErpProjectChange;
import org.dromara.oa.erp.domain.vo.ErpProjectChangeVo;
import org.dromara.common.mybatis.annotation.DataColumn;
import org.dromara.common.mybatis.annotation.DataPermission;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.oa.erp.domain.ErpProjectChange;
import org.dromara.oa.erp.domain.vo.ErpProjectChangeVo;
import java.util.Collection;
import java.util.List;
/**
* Mapper
@ -68,6 +69,10 @@ public interface ErpProjectChangeMapper extends BaseMapperPlus<ErpProjectChange,
* @param queryWrapper
* @return
*/
@DataPermission({
@DataColumn(key = "deptName", value = "t.create_dept"),
@DataColumn(key = "userName", value = "t.create_by")
})
Long countCustomErpProjectChange(@Param(Constants.WRAPPER) Wrapper<ErpProjectChange> queryWrapper);
/**
@ -77,6 +82,10 @@ public interface ErpProjectChangeMapper extends BaseMapperPlus<ErpProjectChange,
* @param queryWrapper
* @return
*/
@DataPermission({
@DataColumn(key = "deptName", value = "t.create_dept"),
@DataColumn(key = "userName", value = "t.create_by")
})
Page<ErpProjectChangeVo> selectCustomErpProjectChangeVoPage(@Param("page") Page<ErpProjectChangeVo> page, @Param(Constants.WRAPPER) Wrapper<ErpProjectChange> queryWrapper);
/**
@ -117,6 +126,10 @@ public interface ErpProjectChangeMapper extends BaseMapperPlus<ErpProjectChange,
* @param queryWrapper
* @return
*/
@DataPermission({
@DataColumn(key = "deptName", value = "t.create_dept"),
@DataColumn(key = "userName", value = "t.create_by")
})
Boolean existsErpProjectChange(@Param(Constants.WRAPPER) Wrapper<ErpProjectChange> queryWrapper);
/**

@ -14,7 +14,11 @@
t.create_time, t.update_by, t.update_time
from crm_mailing_apply t
left join sys_dept d on t.dept_id = d.dept_id
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 根据ID查询详情 -->
@ -42,14 +46,22 @@
<!-- 统计查询 -->
<select id="countCustomCrmMailingApply" resultType="java.lang.Long">
select count(1) from crm_mailing_apply t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 分页查询(带自定义条件) -->
<select id="selectCustomCrmMailingApplyVoPage" resultMap="CrmMailingApplyResult">
select t.mailing_apply_id, t.mailing_apply_code, t.tenant_id, t.application_date, t.handler_id, t.handler_name, t.dept_id, t.province, t.weight, t.mailing_type, t.mailing_fee, t.express_no, t.item_info, t.project_id, t.project_code, t.project_name, t.oss_id, t.mailing_apply_status, t.flow_status, t.logistics_status, t.mailing_time, t.sign_time, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
from crm_mailing_apply t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 批量插入 -->
@ -272,7 +284,11 @@
<!-- 根据自定义条件删除 -->
<delete id="deleteCustomCrmMailingApply">
delete from crm_mailing_apply t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</delete>
<!-- 根据ID列表批量删除 -->
@ -287,7 +303,11 @@
<!-- 检查是否存在 -->
<select id="existsCrmMailingApply" resultType="java.lang.Boolean">
select count(1) > 0 from crm_mailing_apply t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>

@ -24,7 +24,11 @@
left join crm_customer_contact cc on t.customer_contact_id = cc.contact_id
left join crm_customer_info ci on ci.customer_id = cc.customer_id
left join crm_supplier_info s on s.supplier_id = t.supplier_contact_id
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 根据ID查询详情 -->
@ -50,14 +54,22 @@
<!-- 统计查询 -->
<select id="countCustomCrmQuoteInfo" resultType="java.lang.Long">
select count(1) from crm_quote_info t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 分页查询(带自定义条件) -->
<select id="selectCustomCrmQuoteInfoVoPage" resultMap="CrmQuoteInfoResult">
select quote_id, tenant_id, quote_code, quote_name, quote_round, quote_category, quote_type, business_direction, quote_dept_id, quote_date, valid_from, valid_days, valid_to, delivery_period, delivery_method, payment_method, currency_type, tax_included_info, tax_rate, total_price, total_before_tax, total_tax, total_including_tax, customer_contact_id, customer_contact_name, customer_contact_phone, customer_contact_email, supplier_contact_id, supplier_contact_name, supplier_contact_phone, supplier_contact_email, project_id, template_id, oss_id, quote_status, flow_status, remark, del_flag, create_dept, create_by, create_time, update_by, update_time
from crm_quote_info t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 批量插入 -->
@ -378,7 +390,11 @@
<!-- 根据自定义条件删除 -->
<delete id="deleteCustomCrmQuoteInfo">
delete from crm_quote_info
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</delete>
<!-- 根据ID列表批量删除 -->
@ -393,7 +409,11 @@
<!-- 检查是否存在 -->
<select id="existsCrmQuoteInfo" resultType="java.lang.Boolean">
select count(1) > 0 from crm_quote_info t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>

@ -12,7 +12,11 @@
t.including_price, t.subtotal, t.remark, t.active_flag, t.del_flag, t.create_dept, t.create_by,
t.create_time, t.update_by, t.update_time
from crm_quote_material t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 根据ID查询详情 -->
@ -41,7 +45,11 @@
<!-- 统计查询 -->
<select id="countCustomCrmQuoteMaterial" resultType="java.lang.Long">
select count(1) from crm_quote_material t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 分页查询(带自定义条件) -->
@ -51,7 +59,11 @@
t.including_price, t.subtotal, t.remark, t.active_flag, t.del_flag, t.create_dept, t.create_by,
t.create_time, t.update_by, t.update_time
from crm_quote_material t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 批量插入 -->
@ -239,7 +251,11 @@
<!-- 根据自定义条件删除 -->
<delete id="deleteCustomCrmQuoteMaterial">
delete from crm_quote_material
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</delete>
<!-- 根据ID列表批量删除 -->
@ -254,7 +270,11 @@
<!-- 检查是否存在 -->
<select id="existsCrmQuoteMaterial" resultType="java.lang.Boolean">
select count(1) > 0 from crm_quote_material t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>

@ -30,7 +30,11 @@
left join sys_user u1 on t.manager_id = u1.user_id
left join sys_user u3 on t.charge_id = u3.user_id
left join sys_user u4 on t.deputy_id = u4.user_id
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 根据ID查询详情 -->
@ -63,7 +67,11 @@
<!-- 统计查询 -->
<select id="countCustomErpProjectAcceptance" resultType="java.lang.Long">
select count(1) from erp_project_acceptance t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 分页查询(带自定义条件) -->
@ -75,7 +83,11 @@
left join sys_user u1 on t.manager_id = u1.user_id
left join sys_user u3 on t.charge_id = u3.user_id
left join sys_user u4 on t.deputy_id = u4.user_id
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 批量插入 -->
@ -221,7 +233,11 @@
<!-- 根据自定义条件删除 -->
<delete id="deleteCustomErpProjectAcceptance">
delete from erp_project_acceptance
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</delete>
<!-- 根据ID列表批量删除 -->
@ -236,7 +252,11 @@
<!-- 检查是否存在 -->
<select id="existsErpProjectAcceptance" resultType="java.lang.Boolean">
select count(1) > 0 from erp_project_acceptance t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>

@ -8,7 +8,11 @@
<select id="selectCustomErpProjectChangeBudgetVoList" resultMap="ErpProjectChangeBudgetResult">
select change_budget_id, project_change_id, budget_detail_id, subject_name, budget_before, budget_after, amount_used, adjustment_reason, sort_order, remark, del_flag, create_dept, create_by, create_time, update_by, update_time from erp_project_change_budget t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 根据ID查询详情 -->
@ -31,14 +35,22 @@
<!-- 统计查询 -->
<select id="countCustomErpProjectChangeBudget" resultType="java.lang.Long">
select count(1) from erp_project_change_budget t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 分页查询(带自定义条件) -->
<select id="selectCustomErpProjectChangeBudgetVoPage" resultMap="ErpProjectChangeBudgetResult">
select change_budget_id, project_change_id, budget_detail_id, subject_name, budget_before, budget_after, amount_used, adjustment_reason, sort_order, remark, del_flag, create_dept, create_by, create_time, update_by, update_time
from erp_project_change_budget t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 批量插入 -->
@ -170,7 +182,11 @@
<!-- 根据自定义条件删除 -->
<delete id="deleteCustomErpProjectChangeBudget">
delete from erp_project_change_budget
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</delete>
<!-- 根据ID列表批量删除 -->
@ -185,7 +201,11 @@
<!-- 检查是否存在 -->
<select id="existsErpProjectChangeBudget" resultType="java.lang.Boolean">
select count(1) > 0 from erp_project_change_budget t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>

@ -21,7 +21,11 @@
left join sys_user u2 on t.dept_head_id = u2.user_id
left join sys_user u3 on t.responsible_vp_id = u3.user_id
left join sys_user u4 on t.create_by = u4.user_id
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 根据ID查询详情 -->
@ -56,14 +60,22 @@
<!-- 统计查询 -->
<select id="countCustomErpProjectChange" resultType="java.lang.Long">
select count(1) from erp_project_change t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 分页查询(带自定义条件) -->
<select id="selectCustomErpProjectChangeVoPage" resultMap="ErpProjectChangeResult">
select project_change_id, project_change_code, tenant_id, project_id, project_code, project_name, project_category, change_type, change_number, project_manager_id, project_manager_name, dept_head_id, dept_head_name, responsible_vp_id, responsible_vp_name, apply_change_date, contract_amount, contract_net_amount, current_status, change_reason, follow_up_work, project_change_status, flow_status, remark, active_flag, del_flag, create_dept, create_by, create_time, update_by, update_time
from erp_project_change t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 批量插入 -->
@ -300,7 +312,11 @@
<!-- 根据自定义条件删除 -->
<delete id="deleteCustomErpProjectChange">
delete from erp_project_change
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</delete>
<!-- 根据ID列表批量删除 -->
@ -315,7 +331,11 @@
<!-- 检查是否存在 -->
<select id="existsErpProjectChange" resultType="java.lang.Boolean">
select count(1) > 0 from erp_project_change t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 根据项目ID准备项目变更信息带出项目信息和用户名称 -->

@ -8,7 +8,11 @@
<select id="selectCustomErpProjectChangeProgressVoList" resultMap="ErpProjectChangeProgressResult">
select change_progress_id, project_change_id, plan_stage_id, milestone_name, original_start, original_end, changed_start, changed_end, completion_degree, sort_order, remark, del_flag, create_dept, create_by, create_time, update_by, update_time from erp_project_change_progress t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 根据ID查询详情 -->
@ -31,14 +35,22 @@
<!-- 统计查询 -->
<select id="countCustomErpProjectChangeProgress" resultType="java.lang.Long">
select count(1) from erp_project_change_progress t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 分页查询(带自定义条件) -->
<select id="selectCustomErpProjectChangeProgressVoPage" resultMap="ErpProjectChangeProgressResult">
select change_progress_id, project_change_id, plan_stage_id, milestone_name, original_start, original_end, changed_start, changed_end, completion_degree, sort_order, remark, del_flag, create_dept, create_by, create_time, update_by, update_time
from erp_project_change_progress t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 批量插入 -->
@ -177,7 +189,11 @@
<!-- 根据自定义条件删除 -->
<delete id="deleteCustomErpProjectChangeProgress">
delete from erp_project_change_progress
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</delete>
<!-- 根据ID列表批量删除 -->
@ -192,7 +208,11 @@
<!-- 检查是否存在 -->
<select id="existsErpProjectChangeProgress" resultType="java.lang.Boolean">
select count(1) > 0 from erp_project_change_progress t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 查询进度变更明细(连表查询项目阶段信息) -->

@ -41,7 +41,11 @@
left join sys_user u2 on t.charge_id = u2.user_id
left join sys_user u3 on t.create_by = u3.user_id
left join erp_contract_info c on t.contract_id = c.contract_id
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 根据ID查询详情 -->
@ -124,7 +128,11 @@
<!-- 统计查询 -->
<select id="countCustomErpProjectPlan" resultType="java.lang.Long">
select count(1) from erp_project_plan t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 分页查询(带自定义条件) -->
@ -161,7 +169,11 @@
left join sys_dept d1 on u1.dept_id = d1.dept_id
left join sys_user u2 on t.charge_id = u2.user_id
left join erp_contract_info c on t.contract_id = c.contract_id
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 批量插入 -->
@ -321,7 +333,11 @@
<!-- 根据自定义条件删除 -->
<delete id="deleteCustomErpProjectPlan">
delete from erp_project_plan
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</delete>
<!-- 根据ID列表批量删除 -->
@ -336,7 +352,11 @@
<!-- 检查是否存在 -->
<select id="existsErpProjectPlan" resultType="java.lang.Boolean">
select count(1) > 0 from erp_project_plan t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>

@ -8,7 +8,11 @@
<select id="selectCustomErpProjectPlanStageVoList" resultMap="ErpProjectPlanStageResult">
select plan_stage_id, tenant_id, project_id, project_plan_id, project_phases, plan_start_time, plan_end_time, collection_stage, repayment_rate, repayment_amount, repayment_time, delay_day, receivable_date, reasons_explanation, schedule_remark, real_start_time, real_end_time, sort_order, remark, active_flag, del_flag, create_dept, create_by, create_time, update_by, update_time from erp_project_plan_stage t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 根据ID查询详情 -->
@ -31,14 +35,22 @@
<!-- 统计查询 -->
<select id="countCustomErpProjectPlanStage" resultType="java.lang.Long">
select count(1) from erp_project_plan_stage t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 分页查询(带自定义条件) -->
<select id="selectCustomErpProjectPlanStageVoPage" resultMap="ErpProjectPlanStageResult">
select plan_stage_id, tenant_id, project_id, project_plan_id, project_phases, plan_start_time, plan_end_time, collection_stage, repayment_rate, repayment_amount, repayment_time, delay_day, receivable_date, reasons_explanation, schedule_remark, real_start_time, real_end_time, sort_order, remark, active_flag, del_flag, create_dept, create_by, create_time, update_by, update_time
from erp_project_plan_stage t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 批量插入 -->
@ -240,7 +252,11 @@
<!-- 根据自定义条件删除 -->
<delete id="deleteCustomErpProjectPlanStage">
delete from erp_project_plan_stage
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</delete>
<!-- 根据ID列表批量删除 -->
@ -255,7 +271,11 @@
<!-- 检查是否存在 -->
<select id="existsErpProjectPlanStage" resultType="java.lang.Boolean">
select count(1) > 0 from erp_project_plan_stage t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>

@ -31,7 +31,11 @@
left join sys_user u1 on t.manager_id = u1.user_id
left join sys_user u3 on t.charge_id = u3.user_id
left join sys_user u4 on t.deputy_id = u4.user_id
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 根据ID查询详情 -->
@ -64,7 +68,11 @@
<!-- 统计查询 -->
<select id="countCustomErpProjectReceiving" resultType="java.lang.Long">
select count(1) from erp_project_receiving t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 分页查询(带自定义条件) -->
@ -76,7 +84,11 @@
left join sys_user u1 on t.manager_id = u1.user_id
left join sys_user u3 on t.charge_id = u3.user_id
left join sys_user u4 on t.deputy_id = u4.user_id
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 批量插入 -->
@ -229,7 +241,11 @@
<!-- 根据自定义条件删除 -->
<delete id="deleteCustomErpProjectReceiving">
delete from erp_project_receiving
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</delete>
<!-- 根据ID列表批量删除 -->
@ -244,7 +260,11 @@
<!-- 检查是否存在 -->
<select id="existsErpProjectReceiving" resultType="java.lang.Boolean">
select count(1) > 0 from erp_project_receiving t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>

@ -16,7 +16,11 @@
t.supplier, t.supplier_id, t.contact_user, t.contact_number, t.receiver_name, t.receiver_phone, t.logistics_company, t.tracking_no, t.logistics_phone, t.directions, t.plan_arrival_time, t.shipping_time, t.received_time, t.completed_time, t.out_stock_bill_status, t.flow_status, t.shipping_status, t.warehouse_id, t.warehouse_name, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
from wms_shipping_bill t
left join erp_contract_info c on t.contract_id = c.contract_id
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 根据ID查询详情联查合同获取SAP订单号 -->
@ -57,7 +61,11 @@
<!-- 统计查询 -->
<select id="countCustomWmsShippingBill" resultType="java.lang.Long">
select count(1) from wms_shipping_bill t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 分页查询带自定义条件联查合同获取SAP订单号 -->
@ -65,7 +73,11 @@
select t.shipping_bill_id, t.tenant_id, t.shipping_code, t.shipping_type, t.shipping_mode, t.bind_type, t.project_id, t.project_code, t.project_name, t.customer_id, t.customer_contact_id, t.customer_name, t.shipping_address, t.inventory_amount, t.source_bill_type, t.source_bill_id, t.source_bill_code, t.contract_id, t.contract_code, t.contract_name, c.order_contract_code as orderContractCode, t.supplier, t.supplier_id, t.contact_user, t.contact_number, t.receiver_name, t.receiver_phone, t.logistics_company, t.tracking_no, t.logistics_phone, t.directions, t.plan_arrival_time, t.shipping_time, t.received_time, t.completed_time, t.out_stock_bill_status, t.flow_status, t.shipping_status, t.warehouse_id, t.warehouse_name, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
from wms_shipping_bill t
left join erp_contract_info c on t.contract_id = c.contract_id
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 批量插入 -->
@ -407,7 +419,11 @@
<!-- 根据自定义条件删除 -->
<delete id="deleteCustomWmsShippingBill">
delete from wms_shipping_bill t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</delete>
<!-- 根据ID列表批量删除 -->
@ -422,7 +438,11 @@
<!-- 检查是否存在 -->
<select id="existsWmsShippingBill" resultType="java.lang.Boolean">
select count(1) > 0 from wms_shipping_bill t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>

@ -8,7 +8,11 @@
<select id="selectCustomWmsShippingDetailsVoList" resultMap="WmsShippingDetailsResult">
select t.shipping_details_id, t.tenant_id, t.shipping_bill_id, t.material_source_type, t.erp_material_id, t.wms_material_id, t.source_detail_type, t.source_detail_id, t.warehouse_id, t.materiel_id, t.material_code, t.material_name, t.materiel_specification, t.batch_number, t.unit_price, t.shipping_stock_amount, t.unit_id, t.unit_name, t.total_price, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time from wms_shipping_details t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 根据ID查询详情 -->
@ -31,14 +35,22 @@
<!-- 统计查询 -->
<select id="countCustomWmsShippingDetails" resultType="java.lang.Long">
select count(1) from wms_shipping_details t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 分页查询(带自定义条件) -->
<select id="selectCustomWmsShippingDetailsVoPage" resultMap="WmsShippingDetailsResult">
select t.shipping_details_id, t.tenant_id, t.shipping_bill_id, t.material_source_type, t.erp_material_id, t.wms_material_id, t.source_detail_type, t.source_detail_id, t.warehouse_id, t.materiel_id, t.material_code, t.material_name, t.materiel_specification, t.batch_number, t.unit_price, t.shipping_stock_amount, t.unit_id, t.unit_name, t.total_price, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
from wms_shipping_details t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
<!-- 批量插入 -->
@ -240,7 +252,11 @@
<!-- 根据自定义条件删除 -->
<delete id="deleteCustomWmsShippingDetails">
delete from wms_shipping_details t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</delete>
<!-- 根据ID列表批量删除 -->
@ -255,7 +271,11 @@
<!-- 检查是否存在 -->
<select id="existsWmsShippingDetails" resultType="java.lang.Boolean">
select count(1) > 0 from wms_shipping_details t
${ew.getCustomSqlSegment}
<where>
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>

Loading…
Cancel
Save