<commit_before><?xml version="1.0" encoding="UTF-8"?>
<custom-sql>
	<sql id="org.opencps.processmgt.service.persistence.ServiceProcessFinder.searchProcess">	
		<![CDATA[
			SELECT
				opencps_serviceprocess.*
			FROM
				opencps_serviceprocess
			WHERE
				(groupId = ?) 
			AND	
				((lower(opencps_serviceprocess.processName) LIKE ? [$AND_OR_NULL_CHECK$]) OR (lower(opencps_serviceprocess.processNo) LIKE ? [$AND_OR_NULL_CHECK$]))
		]]>
	</sql>
	<sql id="org.opencps.processmgt.service.persistence.ServiceProcessFinder.countProcess">	
		<![CDATA[
			SELECT
				count(*) AS COUNT_VALUE
			FROM
				opencps_serviceprocess
			WHERE
				(groupId = ?) 
			AND	
				((lower(opencps_serviceprocess.processName) LIKE ? [$AND_OR_NULL_CHECK$]) OR (lower(opencps_serviceprocess.processNo) LIKE ? [$AND_OR_NULL_CHECK$]))
		]]>
	</sql>
	
	<sql id="org.opencps.processmgt.service.persistence.ProcessOrderFinder.countProcessOrder">	
		<![CDATA[
			SELECT 
				COUNT(DISTINCT opencps_processorder.processOrderId) AS COUNT_VALUE
			FROM 
				opencps_processorder
			INNER JOIN
				opencps_dossier
			ON
				opencps_processorder.dossierId = opencps_dossier.dossierId
			INNER JOIN
				opencps_serviceinfo 
			ON 
				opencps_processorder.serviceInfoId = opencps_serviceinfo.serviceinfoId
			INNER JOIN
				opencps_processstep
			ON
				opencps_processorder.processStepId = opencps_processstep.processStepId
			AND 
				opencps_processstep.processStepId = ?
			WHERE
				opencps_processorder.processStepId IN 
			(
				SELECT
					opencps_stepallowance.processStepId 
				FROM 
					opencps_stepallowance
                INNER JOIN 
					(
						SELECT 
							role_.roleId 
						FROM role_ 
						INNER JOIN 
							users_roles 
						ON 
							role_.roleId = users_roles.roleId 
						WHERE 
							users_roles.userId = ?
					) AS role
                ON
					opencps_stepallowance.roleId = role.roleId
            )
            OR
				opencps_processorder.assignToUserId = ?
		]]>
	</sql>
	
	<sql id="org.opencps.processmgt.service.persistence.ProcessOrderFinder.searchProcessOrder">	
		<![CDATA[
			SELECT 
				DISTINCT
                opencps_processorder.*, 
				opencps_dossier.serviceConfigId,
				opencps_dossier.subjectId,
				opencps_dossier.subjectName,
				opencps_dossier.receptionNo,
				opencps_serviceinfo.serviceName,
				opencps_processstep.stepName,
				opencps_processstep.sequenceNo,
				opencps_processstep.daysDuration,
				opencps_processstep.referenceDossierPartId
			FROM 
				opencps_processorder
			INNER JOIN
				opencps_dossier
			ON
				opencps_processorder.dossierId = opencps_dossier.dossierId
			INNER JOIN
				opencps_serviceinfo 
			ON 
				opencps_processorder.serviceInfoId = opencps_serviceinfo.serviceinfoId
			INNER JOIN
				opencps_processstep
			ON
				opencps_processorder.processStepId = opencps_processstep.processStepId
			AND 
				opencps_processstep.processStepId = ?
			WHERE
				opencps_processorder.processStepId IN 
			(
				SELECT
					opencps_stepallowance.processStepId 
				FROM 
					opencps_stepallowance
                INNER JOIN 
					(
						SELECT 
							role_.roleId 
						FROM role_ 
						INNER JOIN 
							users_roles 
						ON 
							role_.roleId = users_roles.roleId 
						WHERE 
							users_roles.userId = ?
					) AS role
                ON
					opencps_stepallowance.roleId = role.roleId
            )
            OR
				opencps_processorder.assignToUserId = ?
		]]>
	</sql>
	
	<sql id="org.opencps.processmgt.service.persistence.ProcessOrderFinder.getUserProcessStep">	
		<![CDATA[
			SELECT 
				DISTINCT
                opencps_processstep.processStepId, 
				opencps_processstep.stepName
			FROM 
				opencps_processorder
			INNER JOIN
				opencps_dossier
			ON
				opencps_processorder.dossierId = opencps_dossier.dossierId
			INNER JOIN
				opencps_serviceinfo 
			ON 
				opencps_processorder.serviceInfoId = opencps_serviceinfo.serviceinfoId
			INNER JOIN
				opencps_processstep
			ON
				opencps_processorder.processStepId = opencps_processstep.processStepId
			WHERE
				opencps_processorder.processStepId IN <commit_msg>Update order for list processOrder<commit_after><?xml version="1.0" encoding="UTF-8"?>
<custom-sql>
	<sql id="org.opencps.processmgt.service.persistence.ServiceProcessFinder.searchProcess">	
		<![CDATA[
			SELECT
				opencps_serviceprocess.*
			FROM
				opencps_serviceprocess
			WHERE
				(groupId = ?) 
			AND	
				((lower(opencps_serviceprocess.processName) LIKE ? [$AND_OR_NULL_CHECK$]) OR (lower(opencps_serviceprocess.processNo) LIKE ? [$AND_OR_NULL_CHECK$]))
		]]>
	</sql>
	<sql id="org.opencps.processmgt.service.persistence.ServiceProcessFinder.countProcess">	
		<![CDATA[
			SELECT
				count(*) AS COUNT_VALUE
			FROM
				opencps_serviceprocess
			WHERE
				(groupId = ?) 
			AND	
				((lower(opencps_serviceprocess.processName) LIKE ? [$AND_OR_NULL_CHECK$]) OR (lower(opencps_serviceprocess.processNo) LIKE ? [$AND_OR_NULL_CHECK$]))
		]]>
	</sql>
	
	<!-- <sql id="org.opencps.processmgt.service.persistence.ProcessOrderFinder.countProcessOrder">	
		<![CDATA[
			SELECT 
				COUNT(DISTINCT opencps_processorder.processOrderId) AS COUNT_VALUE
			FROM 
				opencps_processorder
			INNER JOIN
				opencps_dossier
			ON
				opencps_processorder.dossierId = opencps_dossier.dossierId
			INNER JOIN
				opencps_serviceinfo 
			ON 
				opencps_processorder.serviceInfoId = opencps_serviceinfo.serviceinfoId
			INNER JOIN
				opencps_processstep
			ON
				opencps_processorder.processStepId = opencps_processstep.processStepId
			AND 
				opencps_processstep.processStepId = ?
			WHERE
				opencps_processorder.processStepId IN 
			(
				SELECT
					opencps_stepallowance.processStepId 
				FROM 
					opencps_stepallowance
                INNER JOIN 
					(
						SELECT 
							role_.roleId 
						FROM role_ 
						INNER JOIN 
							users_roles 
						ON 
							role_.roleId = users_roles.roleId 
						WHERE 
							users_roles.userId = ?
					) AS role
                ON
					opencps_stepallowance.roleId = role.roleId
            )
            OR
				opencps_processorder.assignToUserId = ?
		]]>
	</sql>
	
	<sql id="org.opencps.processmgt.service.persistence.ProcessOrderFinder.searchProcessOrder">	
		<![CDATA[
			SELECT 
				DISTINCT
                opencps_processorder.*, 
				opencps_dossier.serviceConfigId,
				opencps_dossier.subjectId,
				opencps_dossier.subjectName,
				opencps_dossier.receptionNo,
				opencps_serviceinfo.serviceName,
				opencps_processstep.stepName,
				opencps_processstep.sequenceNo,
				opencps_processstep.daysDuration,
				opencps_processstep.referenceDossierPartId
			FROM 
				opencps_processorder
			INNER JOIN
				opencps_dossier
			ON
				opencps_processorder.dossierId = opencps_dossier.dossierId
			INNER JOIN
				opencps_serviceinfo 
			ON 
				opencps_processorder.serviceInfoId = opencps_serviceinfo.serviceinfoId
			INNER JOIN
				opencps_processstep
			ON
				opencps_processorder.processStepId = opencps_processstep.processStepId
			AND 
				opencps_processstep.processStepId = ?
			WHERE
				opencps_processorder.processStepId IN 
			(
				SELECT
					opencps_stepallowance.processStepId 
				FROM 
					opencps_stepallowance
                INNER JOIN 
					(
						SELECT 
							role_.roleId 
						FROM role_ 
						INNER JOIN 
							users_roles 
						ON 
							role_.roleId = users_roles.roleId 
						WHERE 
							users_roles.userId = ?
					) AS role
                ON
					opencps_stepallowance.roleId = role.roleId
            )
            OR
				opencps_processorder.assignToUserId = ?
		]]>
	</sql> -->
	
	<sql id="org.opencps.processmgt.service.persistence.ProcessOrderFinder.countProcessOrder">	
		<![CDATA[
			SELECT 
				COUNT(DISTINCT opencps_processorder.processOrderId) AS COUNT_VALUE
			FROM 
				opencps_processorder
			INNER JOIN
				opencps_dossier
			ON
				opencps_processorder.dossierId = opencps_dossier.dossierId
			INNER JOIN
				opencps_serviceinfo 
			ON 
				opencps_processorder.serviceInfoId = opencps_serviceinfo.serviceinfoId
			INNER JOIN
				opencps_processstep
			ON
				opencps_processorder.processStepId = opencps_processstep.processStepId
			AND 
				opencps_processstep.processStepId = ?	
			INNER JOIN
			(
				SELECT
					opencps_stepallowance.processStepId,opencps_stepallowance.readOnly
				FROM 
					opencps_stepallowance
                INNER JOIN 
					(
						SELECT 
							role_.roleId 
						FROM role_ 
						INNER JOIN 
							users_roles 
						ON 
							role_.roleId = users_roles.roleId 
						WHERE 
							users_roles.userId = ?
					) AS role
                ON
					opencps_stepallowance.roleId = role.roleId
            ) AS stepallowance
            ON
            	stepallowance.processStepId = opencps_processstep.processStepId
            OR
				opencps_processorder.assignToUserId = ?
		]]>
	</sql>
	
	<sql id="org.opencps.processmgt.service.persistence.ProcessOrderFinder.searchProcessOrder">	
		<![CDATA[
			SELECT 
				DISTINCT
                opencps_processorder.*, 
				opencps_dossier.serviceConfigId,
				opencps_dossier.subjectId,
				opencps_dossier.subjectName,
				opencps_dossier.receptionNo,
				opencps_serviceinfo.serviceName,
				opencps_processstep.stepName,
				opencps_processstep.sequenceNo,
				opencps_processstep.daysDuration,
				opencps_processstep.referenceDossierPartId,
				stepallowance.readOnly
			FROM 
				opencps_processorder
			INNER JOIN
				opencps_dossier
			ON
				opencps_processorder.dossierId = opencps_dossier.dossierId
			INNER JOIN
				opencps_serviceinfo 
			ON 
				opencps_processorder.serviceInfoId = opencps_serviceinfo.serviceinfoId
			INNER JOIN
				opencps_processstep
			ON
				opencps_processorder.processStepId = opencps_processstep.processStepId
			AND 
				opencps_processstep.processStepId = ?	
			INNER JOIN
			(
				SELECT
					opencps_stepallowance.processStepId,opencps_stepallowance.readOnly
				FROM 
					opencps_stepallowance
                INNER JOIN 
					(
						SELECT 
							role_.roleId 
						FROM role_ 
						INNER JOIN 
							users_roles 
						ON 
							role_.roleId = users_roles.roleId 
						WHERE 
							users_roles.userId = ?
					) AS role
                ON
					opencps_stepallowance.roleId = role.roleId
            ) AS stepallowance
            ON
            	stepallowance.processStepId = opencps_processstep.processStepId
            OR
				opencps_processorder.assignToUserId = ?
			ORDER BY opencps_processorder.createDate DESC, opencps_processorder.actionDatetime DESC
		]]>
	</sql>
	
	<sql id="org.opencps.processmgt.service.persistence.ProcessOrderFinder.getUserProcessStep">	
		<![CDATA[
			SELECT 
				DISTINCT
                opencps_processstep.processStepId, 
				opencps_processstep.stepName
			FROM 
				opencps_processorder
			INNER JOIN
				opencps_dossier
			ON
				opencps_processorder.dossierId = opencps_dossier.dossierId
			INNER JOIN
				opencps_serviceinfo 
			ON 
				opencps_processorder.serviceInfoId = opencps_serviceinfo.serviceinfoId
			INNER JOIN
				opencps_processstep
			ON
				opencps_processorder.processStepId = opencps_processstep.processStepId
			WHERE
				opencps_processorder.processStepId IN 
{'fraction_non_alphanumeric': 0.061889834303627406, 'fraction_numerical': 0.0005373936408419167, 'mean_word_length': 2.768477894026325, 'pattern_counts': {'":': 0, '<': 42, '<?xml version=': 2, '>': 40, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2770695', 'n_tokens_mistral': 4997, 'n_tokens_neox': 3782, 'n_words': 538}