<commit_before><?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="cockpit.ige.plugin">

  <resultMap id="igeBusinessCockpitResultMap" type="org.camunda.bpm.cockpit.ige.plugin.db.IGEBusinessPluginDto">
    <result property="processInstanceId" column="processInstanceId" jdbcType="VARCHAR" />
    <result property="processName" column="processName" jdbcType="VARCHAR" />
    <result property="processDefinitionId" column="processDefinitionId" jdbcType="VARCHAR"/>
    <result property="startTime" column="startTime" jdbcType="TIMESTAMP" />
    <result property="incState" column="incState" jdbcType="VARCHAR" />
    <result property="component" column="component" jdbcType="VARCHAR" />
    <result property="runState" column="runState" jdbcType="VARCHAR" />
    <result property="activity" column="activity" jdbcType="VARCHAR" />
    <result property="assignee" column="assignee" jdbcType="VARCHAR" />
  </resultMap>
  
  <select id="igeBusinessCockpitQuery" 
    parameterType="org.camunda.bpm.cockpit.ige.plugin.db.IGEBusinessPluginDto" 
    resultMap="igeBusinessCockpitResultMap">
  select 
  PI.ID_ as processInstanceId,
  PD.NAME_ as processName,
  PI.PROC_DEF_ID_ as processDefinitionId,
  PI.START_TIME_ as startTime,
  INC.INCIDENT_STATE_ as incState,
  DP.name_ as component,
  pi.end_time_ as runState,
  (select TA.ACT_NAME_ from act_hi_actinst TA where EXE.ACT_ID_ = TA.ACT_ID_ and EXE.ID_ = TA.EXECUTION_ID_) as activity,
  (select TA.ASSIGNEE_ from act_hi_actinst TA where EXE.ACT_ID_ = TA.ACT_ID_ and EXE.ID_ = TA.EXECUTION_ID_) as assignee 
  from 
  act_hi_procinst PI
  inner join act_re_procdef PD on PI.proc_def_id_ = pd.id_
  inner join act_re_deployment DP on DP.id_ = pd.deployment_id_
  left outer join act_hi_incident INC on INC.proc_inst_id_ = pi.id_
  inner join act_hi_varinst VAR on PI.id_ = VAR.proc_inst_id_
  left outer join ACT_RU_EXECUTION EXE ON (PI.ID_ = EXE.PROC_INST_ID_ and EXE.ACT_ID_ is not null) 
  where (var.name_ = 'SCHUTZTITELNUMMER' and var.text_ = #{parameter.titleNumber})
  or (var.name_ = 'GESUCHSNUMMER' and var.text_ = #{parameter.requestNumber})
  </select>

</mapper>
<commit_msg>only one inc and order by start time<commit_after><?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="cockpit.ige.plugin">

  <resultMap id="igeBusinessCockpitResultMap" type="org.camunda.bpm.cockpit.ige.plugin.db.IGEBusinessPluginDto">
    <result property="processInstanceId" column="processInstanceId" jdbcType="VARCHAR" />
    <result property="processName" column="processName" jdbcType="VARCHAR" />
    <result property="processDefinitionId" column="processDefinitionId" jdbcType="VARCHAR"/>
    <result property="startTime" column="startTime" jdbcType="TIMESTAMP" />
    <result property="incState" column="incState" jdbcType="VARCHAR" />
    <result property="component" column="component" jdbcType="VARCHAR" />
    <result property="runState" column="runState" jdbcType="VARCHAR" />
    <result property="activity" column="activity" jdbcType="VARCHAR" />
    <result property="assignee" column="assignee" jdbcType="VARCHAR" />
  </resultMap>
  
  <select id="igeBusinessCockpitQuery" 
    parameterType="org.camunda.bpm.cockpit.ige.plugin.db.IGEBusinessPluginDto" 
    resultMap="igeBusinessCockpitResultMap">
  select 
  PI.ID_ as processInstanceId,
  PD.NAME_ as processName,
  PI.PROC_DEF_ID_ as processDefinitionId,
  PI.START_TIME_ as startTime,
  INC.INCIDENT_STATE_ as incState,
  DP.name_ as component,
  pi.end_time_ as runState,
  (select TA.ACT_NAME_ from act_hi_actinst TA where EXE.ACT_ID_ = TA.ACT_ID_ and EXE.ID_ = TA.EXECUTION_ID_) as activity,
  (select TA.ASSIGNEE_ from act_hi_actinst TA where EXE.ACT_ID_ = TA.ACT_ID_ and EXE.ID_ = TA.EXECUTION_ID_) as assignee 
  from 
  act_hi_procinst PI
  inner join act_re_procdef PD on PI.proc_def_id_ = pd.id_
  inner join act_re_deployment DP on DP.id_ = pd.deployment_id_
  left outer join act_hi_incident INC on INC.proc_inst_id_ = pi.id_ and INC.end_time_ is null
  inner join act_hi_varinst VAR on PI.id_ = VAR.proc_inst_id_
  left outer join ACT_RU_EXECUTION EXE ON (PI.ID_ = EXE.PROC_INST_ID_ and EXE.ACT_ID_ is not null) 
  where (var.name_ = 'SCHUTZTITELNUMMER' and var.text_ = #{parameter.titleNumber})
  or (var.name_ = 'GESUCHSNUMMER' and var.text_ = #{parameter.titleNumber})
  order by pi.start_time_ desc
  </select>

</mapper>

{'fraction_non_alphanumeric': 0.11916193801833261, 'fraction_numerical': 0.0026189436927106066, 'mean_word_length': 5.046174142480211, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 2, '>': 37, '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': '7596115', 'n_tokens_mistral': 1702, 'n_tokens_neox': 1621, 'n_words': 341}