Commit 2d47037c by 宋祥

1.仅查询所在组的数据

parent 52b24166
...@@ -133,6 +133,27 @@ public class UserSessionUtils extends UserSession { ...@@ -133,6 +133,27 @@ public class UserSessionUtils extends UserSession {
} }
/** /**
* 获取登录用户的所有组
*
* @return
*/
public static List<String> getAllGroupCode() {
List<Org> orgs = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isEmpty(orgs)) {
return new ArrayList<>();
}
List<String> prodGroupCodes = new ArrayList<>();
for (Org org : orgs) {
if (OrgTypeEnum.PROD_GROUP.getCode().equals(org.getOrgType())
|| OrgTypeEnum.CUT_GROUP.getCode().equals(org.getOrgType())
|| OrgTypeEnum.SYN_GROUP.getCode().equals(org.getOrgType())) {
prodGroupCodes.add(org.getOrgId());
}
}
return prodGroupCodes;
}
/**
* 获取登录用户所有角色 * 获取登录用户所有角色
* *
* @return * @return
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
Generate time : 2024-05-23 17:55:59
Version : 1.0
schema : hggp
tableName : HGSC007
id BIGINT NOT NULL primarykey,
order_id BIGINT NOT NULL,
order_detail_id BIGINT NOT NULL,
tech_flow_id BIGINT,
tech_flow_name BIGINT,
invent_process_id BIGINT,
process_code VARCHAR,
process_name VARCHAR,
process_order BIGINT,
company_code VARCHAR NOT NULL,
company_name VARCHAR NOT NULL,
dep_code VARCHAR,
dep_name VARCHAR,
proj_code VARCHAR,
proj_name VARCHAR,
task_code VARCHAR,
product_type TINYINT,
product_code VARCHAR,
product_name VARCHAR,
plan_start_date VARCHAR,
plan_end_date VARCHAR,
factory_code VARCHAR,
factory_name VARCHAR,
group_code VARCHAR,
group_name VARCHAR,
complete_date VARCHAR,
quantity TINYINT,
finish_quantity TINYINT,
unfinish_quantity TINYINT,
single_weight DECIMAL,
total_weight DECIMAL,
finish_weight DECIMAL,
unfinish_weight DECIMAL,
account_code VARCHAR NOT NULL,
created_by VARCHAR,
created_name VARCHAR,
created_time VARCHAR,
updated_by VARCHAR,
updated_name VARCHAR,
updated_time VARCHAR
-->
<sqlMap namespace="HGSC007"> <sqlMap namespace="HGSC007">
<sql id="authCondition"> <sql id="authCondition">
<!-- 无权限时使用 --> <!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode"> <isNotEmpty prepend=" AND " property="authDepCode">
A.DEP_CODE = #authDepCode# A.DEP_CODE = #authDepCode#
...@@ -68,9 +23,9 @@ ...@@ -68,9 +23,9 @@
</isNotEmpty> </isNotEmpty>
</isNotEqual> </isNotEqual>
</sql> </sql>
<sql id="condition"> <sql id="condition">
<include refid="authCondition"/> <include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
A.id = #id# A.id = #id#
</isNotEmpty> </isNotEmpty>
...@@ -205,6 +160,13 @@ ...@@ -205,6 +160,13 @@
ifnull(A.complete_date,'') != '' ifnull(A.complete_date,'') != ''
</isEqual> </isEqual>
</sql> </sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="groupCodes">
A.GROUP_CODE IN <iterate close=")" open="(" conjunction="," property="groupCodes">#groupCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="appCondition"> <sql id="appCondition">
<!-- 无权限时使用 --> <!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode"> <isNotEmpty prepend=" AND " property="authDepCode">
...@@ -242,9 +204,8 @@ ...@@ -242,9 +204,8 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" resultClass="com.baosight.hggp.hg.sc.domain.HGSC007">
resultClass="com.baosight.hggp.hg.sc.domain.HGSC007"> SELECT
SELECT
A.id as "id", A.id as "id",
A.mat_id as "matId", <!-- 物料清单ID --> A.mat_id as "matId", <!-- 物料清单ID -->
A.order_id as "orderId", <!-- 生产计划ID --> A.order_id as "orderId", <!-- 生产计划ID -->
...@@ -288,151 +249,27 @@ ...@@ -288,151 +249,27 @@
A.updated_time as "updatedTime", <!-- 更新时间 --> A.updated_time as "updatedTime", <!-- 更新时间 -->
B.LENGTH as "length", <!-- 长 --> B.LENGTH as "length", <!-- 长 -->
B.SPEC as "spec" <!-- 规格 --> B.SPEC as "spec" <!-- 规格 -->
FROM ${hggpSchema}.HGSC007 A LEFT JOIN ${hggpSchema}.HGPZ005 B ON A.product_code = B.INVENT_CODE FROM ${hggpSchema}.HGSC007 A
WHERE 1=1 LEFT JOIN ${hggpSchema}.HGPZ005 B ON A.product_code = B.INVENT_CODE
<include refid="condition" /> WHERE 1=1
<include refid="condition"/>
<dynamic prepend="ORDER BY"> <include refid="customCondition"/>
<isNotEmpty property="orderBy"> <dynamic prepend="ORDER BY">
$orderBy$ <isNotEmpty property="orderBy">
</isNotEmpty> $orderBy$
<isEmpty property="orderBy"> </isNotEmpty>
A.id desc, A.product_type asc, A.product_name, A.process_order desc <isEmpty property="orderBy">
</isEmpty> A.id desc, A.product_type asc, A.product_name, A.process_order desc
</dynamic> </isEmpty>
</dynamic>
</select> </select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC007 A LEFT JOIN ${hggpSchema}.HGPZ005 B ON A.product_code = B.INVENT_CODE WHERE 1=1 SELECT COUNT(*) FROM ${hggpSchema}.HGSC007 A
<include refid="condition" /> LEFT JOIN ${hggpSchema}.HGPZ005 B ON A.product_code = B.INVENT_CODE
</select> WHERE 1=1
<include refid="condition"/>
<!-- </select>
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matId">
mat_id = #matId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orderId">
order_id = #orderId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orderDetailId">
order_detail_id = #orderDetailId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="techFlowId">
tech_flow_id = #techFlowId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="techFlowName">
tech_flow_name = #techFlowName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventProcessId">
invent_process_id = #inventProcessId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processCode">
process_code = #processCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processName">
process_name = #processName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processOrder">
process_order = #processOrder#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depName">
dep_name = #depName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="taskCode">
task_code = #taskCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productType">
product_type = #productType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productCode">
product_code = #productCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productName">
product_name = #productName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planStartDate">
plan_start_date = #planStartDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planEndDate">
plan_end_date = #planEndDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
factory_code = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
factory_name = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
group_code = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
group_name = #groupName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="completeDate">
complete_date = #completeDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="quantity">
quantity = #quantity#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="finishQuantity">
finish_quantity = #finishQuantity#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unfinishQuantity">
unfinish_quantity = #unfinishQuantity#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="singleWeight">
single_weight = #singleWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalWeight">
total_weight = #totalWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="finishWeight">
finish_weight = #finishWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unfinishWeight">
unfinish_weight = #unfinishWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
created_name = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
created_time = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
updated_by = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
updated_name = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
-->
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGSC007 (id, INSERT INTO ${hggpSchema}.HGSC007 (id,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment