张天森
2022-11-16 7a8e31ceb01c7eb27d90197ec91efdfce4bedb41
flower_city/src/main/resources/mapper/TransactionEventMapper.xml
@@ -48,6 +48,7 @@
        <id     property="transactionAreaUrl"      column="transaction_area_url"      />
        <id     property="transactionAreaName"      column="transaction_area_name"      />
        <id     property="classifyIds"      column="classify_ids"      />
        <id     property="departmentIds"      column="department_ids"      />
    </resultMap>
@@ -102,6 +103,13 @@
            transaction_area_url,
            transaction_area_name,
            classify_ids,
            department_ids,
            (SELECT GROUP_CONCAT(organization_name) FROM automessage_organization_chart WHERE id in (SELECT
                 substring_index(substring_index(department_ids,',', b.help_topic_id + 1), ',', -1) result
             FROM
                 mysql.help_topic b
             where
                     b.help_topic_id &lt; (LENGTH(department_ids) - LENGTH(REPLACE(department_ids, ',', '')) + 1))) as departmentNames,
            (IF((select classify_grade from automessage_classify_administration where automessage_classify_administration.id=automessage_transaction_event.classify_id)='2',
                (select classify_name from automessage_classify_administration where automessage_classify_administration.id=(select parent_id from
                automessage_classify_administration where automessage_classify_administration.id=automessage_transaction_event.classify_id)),
@@ -138,6 +146,13 @@
            associate_names,
            transaction_num,
            browse_num,
            department_ids,
            (SELECT GROUP_CONCAT(organization_name) FROM automessage_organization_chart WHERE id in (SELECT
              substring_index(substring_index(department_ids,',', b.help_topic_id + 1), ',', -1) result
          FROM
              mysql.help_topic b
          where
                  b.help_topic_id &lt; (LENGTH(department_ids) - LENGTH(REPLACE(department_ids, ',', '')) + 1))) as departmentNames,
            create_time,
            update_time
        FROM
@@ -239,6 +254,7 @@
        <if test="transactionAreaUrl != null ">transaction_area_url,</if>
        <if test="transactionAreaName != null ">transaction_area_name,</if>
        <if test="classifyIds != null ">classify_ids,</if>
        <if test="departmentIds != null ">department_ids,</if>
        update_time,
        create_time
        )values(
@@ -281,6 +297,7 @@
        <if test="transactionAreaUrl != null ">#{transactionAreaUrl},</if>
        <if test="transactionAreaName != null ">#{transactionAreaName},</if>
        <if test="classifyIds != null ">#{classifyIds},</if>
        <if test="departmentIds != null ">#{departmentIds},</if>
        sysdate(),
        sysdate()
        )
@@ -328,6 +345,7 @@
            <if test="transactionAreaUrl != null ">transaction_area_url=#{transactionAreaUrl},</if>
            <if test="transactionAreaName != null ">transaction_area_name=#{transactionAreaName},</if>
            <if test="classifyIds != null ">classify_ids=#{classifyIds},</if>
            <if test="departmentIds != null ">department_ids=#{departmentIds},</if>
            update_time=sysdate()
        </set>
        where  id= #{id}
@@ -377,7 +395,7 @@
        <include refid="selectTransactionEventEntityVo"/>
        <where>
            <if test="associateNames != null and associateNames != ''">
                AND (associate_names like concat('%', #{associateNames}, '%') or #{associateNames} like concat('%', associate_names, '%'))
                AND (associate_names like concat('%', #{associateNames}, '%') )
            </if>
            <if test="classifyId != null and classifyId != ''">
                and (classify_id= #{classifyId} or classify_id in (select id FROM automessage_classify_administration where parent_id =#{classifyId} ))
@@ -388,7 +406,9 @@
    </select>
    <select id="sumTransactionNum"  resultMap="TransactionEventEntityResult">
        select sum(transaction_num)sumTransactionNum,count(*) counttransaction   FROM automessage_transaction_event
        select sum(TransactionNum)sumTransactionNum,  count(*) counttransaction from (
        SELECT (select count(id) from automessage_guide_repair_order where state in (3,4) and  a.id=matter_id) TransactionNum
        from automessage_transaction_event a)k
    </select>
    <select id="queryByClassifyIdList"  resultMap="TransactionEventEntityResult">
@@ -437,7 +457,9 @@
                 select  id,matter_name title,concat((select classify_name from  automessage_classify_administration
                                                      where id=(select parent_id from  automessage_classify_administration  where id=automessage_transaction_event.classify_id)),
                                                     '>',(select classify_name from  automessage_classify_administration  where id=automessage_transaction_event.classify_id)) content,
                         browse_num views,2 type from automessage_transaction_event
                         browse_num views,2 type from automessage_transaction_event UNION
                 SELECT id ,name title,concat((select organization_name from automessage_organization_chart where id=automessage_policy_documents.department_id ),'>','政策文件') content,null      views,5 type FROM    automessage_policy_documents where type=2     UNION
                 SELECT id ,name title,concat((select organization_name from automessage_organization_chart where id=automessage_policy_documents.department_id ),'>','法律法规') content,null      views,6 type FROM    automessage_policy_documents where type=1
             ) k
        where  k.title like concat('%',#{keyWord}, '%') or k.content  like concat('%', #{keyWord}, '%')
    </select>