<?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="com.dg.core.db.gen.mapper.TransactionEventMapper">
|
|
<resultMap type="com.dg.core.db.gen.entity.TransactionEvent" id="TransactionEventEntityResult">
|
<id property="id" column="id" />
|
<id property="departmentId" column="department_id" />
|
<id property="departmentArea" column="department_area" />
|
<id property="classifyId" column="classify_id" />
|
<id property="matterName" column="matter_name" />
|
<id property="associateIds" column="associate_ids" />
|
<id property="transactionNum" column="transaction_num" />
|
<id property="browseNum" column="browse_num" />
|
<id property="basicInformation" column="basic_information" />
|
<id property="acceptConditions" column="accept_conditions" />
|
<id property="applicationMaterial" column="application_material" />
|
<id property="handlingProcedures" column="handling_procedures" />
|
<id property="rates" column="rates" />
|
<id property="createTime" column="create_time" />
|
<id property="updateTime" column="update_time" />
|
<id property="queryTime" column="query_time" />
|
|
<id property="associateNames" column="associate_names" />
|
<id property="queryTime" column="query_time" />
|
<id property="basicInformationUrl" column="basic_information_url" />
|
<id property="acceptConditionsUrl" column="accept_conditions_url" />
|
<id property="applicationMaterialUrl" column="application_material_url" />
|
<id property="handlingProceduresUrl" column="handling_procedures_url" />
|
<id property="ratesUrl" column="rates_url" />
|
<id property="basicInformationFileName" column="basic_information_file_name" />
|
<id property="acceptConditionsFileName" column="accept_conditions_file_name" />
|
<id property="applicationMaterialFileName" column="application_material_file_name" />
|
<id property="handlingProceduresFileName" column="handling_procedures_file_name" />
|
<id property="ratesFileName" column="rates_file_name" />
|
<id property="operationalGuidelineUrl" column="operational_guideline_url" />
|
<id property="operationalGuidelineVideoUrl" column="operational_guideline_video_url" />
|
|
<id property="setGist" column="set_gist" />
|
<id property="setGistUrl" column="set_gist_url" />
|
<id property="setGistName" column="set_gist_name" />
|
|
<id property="commonProblem" column="common_problem" />
|
<id property="commonProblemUrl" column="common_problem_url" />
|
<id property="commonProblemName" column="common_problem_name" />
|
<id property="operationalGuidelineVideoName" column="operational_guideline_video_name" />
|
<id property="operationalGuidelineName" column="operational_guideline_name" />
|
<id property="transactionArea" column="transaction_area" />
|
<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>
|
|
<sql id="selectTransactionEventEntityVo">
|
SELECT
|
id,
|
department_id,
|
concat(
|
IFNULL((SELECT name FROM automessage_area_code_2022 WHERE automessage_area_code_2022.code=(select city from automessage_organization_chart
|
where automessage_organization_chart.id=department_id)),''),
|
IFNULL((SELECT name FROM automessage_area_code_2022 WHERE automessage_area_code_2022.code=(select district from automessage_organization_chart
|
where automessage_organization_chart.id=department_id)),''),
|
IFNULL((SELECT name FROM automessage_area_code_2022 WHERE automessage_area_code_2022.code=(select village from automessage_organization_chart
|
where automessage_organization_chart.id=department_id)),'')
|
) AS department_area,
|
(select contact_number from automessage_organization_chart where automessage_organization_chart.id=department_id) as contactNumber,
|
classify_id,
|
matter_name,
|
associate_ids,
|
transaction_num,
|
browse_num,
|
basic_information,
|
accept_conditions,
|
application_material,
|
handling_procedures,
|
rates,
|
create_time,
|
update_time,
|
query_time,
|
associate_names,
|
basic_information_url,
|
accept_conditions_url,
|
application_material_url,
|
handling_procedures_url,
|
rates_url,
|
basic_information_file_name,
|
accept_conditions_file_name,
|
application_material_file_name,
|
handling_procedures_file_name,
|
rates_file_name,
|
operational_guideline_url,
|
set_gist,
|
set_gist_url,
|
set_gist_name,
|
common_problem,
|
common_problem_url,
|
common_problem_name,
|
operational_guideline_video_url,
|
operational_guideline_video_name,
|
operational_guideline_name,
|
transaction_area,
|
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 < (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)),
|
(select classify_name from automessage_classify_administration where automessage_classify_administration.id=automessage_transaction_event.classify_id))) as classifyName,
|
(select organization_name from automessage_organization_chart where automessage_organization_chart.id=automessage_transaction_event.department_id) as departmentName,
|
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)
|
) sumClassifyName
|
FROM
|
automessage_transaction_event
|
</sql>
|
|
<sql id="selectTransactionEventList">
|
SELECT
|
id,
|
department_id,
|
concat(
|
IFNULL((SELECT name FROM automessage_area_code_2022 WHERE automessage_area_code_2022.code=(select city from automessage_organization_chart
|
where automessage_organization_chart.id=department_id)),''),
|
IFNULL((SELECT name FROM automessage_area_code_2022 WHERE automessage_area_code_2022.code=(select district from automessage_organization_chart
|
where automessage_organization_chart.id=department_id)),''),
|
IFNULL((SELECT name FROM automessage_area_code_2022 WHERE automessage_area_code_2022.code=(select village from automessage_organization_chart
|
where automessage_organization_chart.id=department_id)),'')
|
) AS department_area,
|
classify_id,
|
(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)),
|
(select classify_name from automessage_classify_administration where automessage_classify_administration.id=automessage_transaction_event.classify_id))) as classifyName,
|
(select organization_name from automessage_organization_chart where automessage_organization_chart.id=automessage_transaction_event.department_id) as departmentName,
|
matter_name,
|
associate_ids,
|
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 < (LENGTH(department_ids) - LENGTH(REPLACE(department_ids, ',', '')) + 1))) as departmentNames,
|
create_time,
|
update_time
|
FROM
|
automessage_transaction_event
|
</sql>
|
|
<select id="selectConfigData" parameterType="string" resultMap="TransactionEventEntityResult">
|
<include refid="selectTransactionEventEntityVo"/>
|
where id=#{Id}
|
</select>
|
|
<select id="selectConfigList" resultMap="TransactionEventEntityResult">
|
<include refid="selectTransactionEventList"/>
|
<where>
|
<if test="keyword != null and keyword != ''">
|
AND (
|
(matter_name like concat('%', #{keyword}, '%')) or
|
(department_id in (SELECT id FROM automessage_organization_chart WHERE organization_name like concat('%', #{keyword}, '%')))
|
or (classify_id in (SELECT id FROM automessage_classify_administration WHERE classify_name like concat('%', #{keyword}, '%')))
|
)
|
|
</if>
|
<if test="classifyGrade != null and classifyGrade != ''">
|
AND (select classify_grade from automessage_classify_administration where automessage_classify_administration.id=classify_id) = #{classifyGrade}
|
</if>
|
<if test="ids != null">
|
and department_id IN
|
<foreach collection="ids" item="param" open="(" close=")" separator=",">
|
#{param}
|
</foreach>
|
</if>
|
</where>
|
order by create_time desc
|
</select>
|
|
<!-- 根据分类筛选数据 -->
|
<select id="selectClassifyList" resultMap="TransactionEventEntityResult">
|
<include refid="selectTransactionEventList"/>
|
<where>
|
<if test="ids != null">
|
and classify_id IN
|
<foreach collection="ids" item="param" open="(" close=")" separator=",">
|
#{param}
|
</foreach>
|
</if>
|
</where>
|
order by create_time desc
|
</select>
|
|
|
|
<select id="selectListByIds" resultMap="TransactionEventEntityResult">
|
<include refid="selectTransactionEventList"/>
|
WHERE id IN
|
<foreach collection="array" item="id" index="index" open="(" close=")" separator=",">
|
#{id}
|
</foreach>
|
order by create_time desc
|
</select>
|
|
<insert id="insertConfig" parameterType="com.dg.core.db.gen.entity.TransactionEvent">
|
insert into automessage_transaction_event (
|
<if test="id != null">id,</if>
|
<if test="departmentId != null and departmentId != '' ">department_id,</if>
|
<if test="departmentArea != null">department_area,</if>
|
<if test="classifyId != null and classifyId != '' ">classify_id,</if>
|
<if test="matterName != null and matterName != '' ">matter_name,</if>
|
<if test="associateIds != null ">associate_ids,</if>
|
<if test="transactionNum != null ">transaction_num,</if>
|
<if test="browseNum != null ">browse_num,</if>
|
<if test="basicInformation != null and basicInformation != '' ">basic_information,</if>
|
<if test="acceptConditions != null and acceptConditions != '' ">accept_conditions,</if>
|
<if test="applicationMaterial != null and applicationMaterial != '' ">application_material,</if>
|
<if test="handlingProcedures != null and handlingProcedures != '' ">handling_procedures,</if>
|
<if test="rates != null and rates != '' ">rates,</if>
|
<if test="associateNames != null ">associate_names,</if>
|
<if test="queryTime != null">query_time,</if>
|
<if test="basicInformationUrl != null and basicInformationUrl != '' ">basic_information_url,</if>
|
<if test="acceptConditionsUrl != null and acceptConditionsUrl != '' ">accept_conditions_url,</if>
|
<if test="applicationMaterialUrl != null and applicationMaterialUrl != '' ">application_material_url,</if>
|
<if test="handlingProceduresUrl != null and handlingProceduresUrl != '' ">handling_procedures_url,</if>
|
<if test="ratesUrl != null and ratesUrl != '' ">rates_url,</if>
|
<if test="basicInformationFileName != null and basicInformationFileName != '' ">basic_information_file_name,</if>
|
<if test="acceptConditionsFileName != null and acceptConditionsFileName != '' ">accept_conditions_file_name,</if>
|
<if test="applicationMaterialFileName != null and applicationMaterialFileName != '' ">application_material_file_name,</if>
|
<if test="handlingProceduresFileName != null and handlingProceduresFileName != '' ">handling_procedures_file_name,</if>
|
<if test="ratesFileName != null and ratesFileName != '' ">rates_file_name,</if>
|
<if test="operationalGuidelineUrl != null and operationalGuidelineUrl != '' ">operational_guideline_url,</if>
|
<if test="operationalGuidelineVideoUrl != null and operationalGuidelineVideoUrl != '' ">operational_guideline_video_url,</if>
|
<if test="setGist != null and setGist != '' ">set_gist,</if>
|
<if test="setGistUrl != null and setGistUrl != '' ">set_gist_url,</if>
|
<if test="setGistName != null and setGistName != '' ">set_gist_name,</if>
|
<if test="commonProblem != null and commonProblem != '' ">common_problem,</if>
|
<if test="commonProblemUrl != null and commonProblemUrl != '' ">common_problem_url,</if>
|
<if test="commonProblemName != null and commonProblemName != '' ">common_problem_name,</if>
|
<if test="operationalGuidelineVideoName != null and operationalGuidelineVideoName != '' ">operational_guideline_video_name,</if>
|
<if test="operationalGuidelineName != null and operationalGuidelineName != '' ">operational_guideline_name,</if>
|
<if test="transactionArea != null ">transaction_area,</if>
|
<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(
|
<if test="id != null">#{id},</if>
|
<if test="departmentId != null and departmentId != '' ">#{departmentId},</if>
|
<if test="departmentArea != null">#{departmentArea},</if>
|
<if test="classifyId != null and classifyId != '' ">#{classifyId},</if>
|
<if test="matterName != null and matterName != '' ">#{matterName},</if>
|
<if test="associateIds != null ">#{associateIds},</if>
|
<if test="transactionNum != null ">#{transactionNum},</if>
|
<if test="browseNum != null ">#{browseNum},</if>
|
<if test="basicInformation != null and basicInformation != '' ">#{basicInformation},</if>
|
<if test="acceptConditions != null and acceptConditions != '' ">#{acceptConditions},</if>
|
<if test="applicationMaterial != null and applicationMaterial != '' ">#{applicationMaterial},</if>
|
<if test="handlingProcedures != null and handlingProcedures != '' ">#{handlingProcedures},</if>
|
<if test="rates != null and rates != '' ">#{rates},</if>
|
<if test="associateNames != null ">#{associateNames},</if>
|
<if test="queryTime != null">#{queryTime},</if>
|
<if test="basicInformationUrl != null and basicInformationUrl != '' ">#{basicInformationUrl},</if>
|
<if test="acceptConditionsUrl != null and acceptConditionsUrl != '' ">#{acceptConditionsUrl},</if>
|
<if test="applicationMaterialUrl != null and applicationMaterialUrl != '' ">#{applicationMaterialUrl},</if>
|
<if test="handlingProceduresUrl != null and handlingProceduresUrl != '' ">#{handlingProceduresUrl},</if>
|
<if test="ratesUrl != null and ratesUrl != '' ">#{ratesUrl},</if>
|
<if test="basicInformationFileName != null and basicInformationFileName != '' ">#{basicInformationFileName},</if>
|
<if test="acceptConditionsFileName != null and acceptConditionsFileName != '' ">#{acceptConditionsFileName},</if>
|
<if test="applicationMaterialFileName != null and applicationMaterialFileName != '' ">#{applicationMaterialFileName},</if>
|
<if test="handlingProceduresFileName != null and handlingProceduresFileName != '' ">#{handlingProceduresFileName},</if>
|
<if test="ratesFileName != null and ratesFileName != '' ">#{ratesFileName},</if>
|
<if test="operationalGuidelineUrl != null and operationalGuidelineUrl != '' ">#{operationalGuidelineUrl},</if>
|
<if test="operationalGuidelineVideoUrl != null and operationalGuidelineVideoUrl != '' ">#{operationalGuidelineVideoUrl},</if>
|
<if test="setGist != null and setGist != '' ">#{setGist},</if>
|
<if test="setGistUrl != null and setGistUrl != '' ">#{setGistUrl},</if>
|
<if test="setGistName != null and setGistName != '' ">#{setGistName},</if>
|
<if test="commonProblem != null and commonProblem != '' ">#{commonProblem},</if>
|
<if test="commonProblemUrl != null and commonProblemUrl != '' ">#{commonProblemUrl},</if>
|
<if test="commonProblemName != null and commonProblemName != '' ">#{commonProblemName},</if>
|
<if test="operationalGuidelineVideoName != null and operationalGuidelineVideoName != '' ">#{operationalGuidelineVideoName},</if>
|
<if test="operationalGuidelineName != null and operationalGuidelineName != '' ">#{operationalGuidelineName},</if>
|
<if test="transactionArea != null ">#{transactionArea},</if>
|
<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()
|
)
|
</insert>
|
|
<update id="updateConfig" parameterType="com.dg.core.db.gen.entity.TransactionEvent">
|
update automessage_transaction_event
|
<set>
|
<if test="id != null">id=#{id},</if>
|
<if test="departmentId != null and departmentId != '' ">department_id=#{departmentId},</if>
|
<if test="departmentArea != null">department_area=#{departmentArea},</if>
|
<if test="classifyId != null and classifyId != '' ">classify_id=#{classifyId},</if>
|
<if test="matterName != null and matterName != '' ">matter_name=#{matterName},</if>
|
<if test="associateIds != null ">associate_ids=#{associateIds},</if>
|
<if test="transactionNum != null ">transaction_num=#{transactionNum},</if>
|
<if test="browseNum != null ">browse_num=#{browseNum},</if>
|
<if test="basicInformation != null">basic_information=#{basicInformation},</if>
|
<if test="acceptConditions != null ">accept_conditions=#{acceptConditions},</if>
|
<if test="applicationMaterial != null ">application_material=#{applicationMaterial},</if>
|
<if test="handlingProcedures != null ">handling_procedures=#{handlingProcedures},</if>
|
<if test="rates != null ">rates=#{rates},</if>
|
<if test="associateNames != null ">associate_names=#{associateNames},</if>
|
<if test="queryTime != null">query_time=#{queryTime},</if>
|
<if test="basicInformationUrl != null">basic_information_url=#{basicInformationUrl},</if>
|
<if test="acceptConditionsUrl != null ">accept_conditions_url=#{acceptConditionsUrl},</if>
|
<if test="applicationMaterialUrl != null ">application_material_url=#{applicationMaterialUrl},</if>
|
<if test="handlingProceduresUrl != null ">handling_procedures_url=#{handlingProceduresUrl},</if>
|
<if test="ratesUrl != null ">rates_url=#{ratesUrl},</if>
|
<if test="basicInformationFileName != null ">basic_information_file_name=#{basicInformationFileName},</if>
|
<if test="acceptConditionsFileName != null ">accept_conditions_file_name=#{acceptConditionsFileName},</if>
|
<if test="applicationMaterialFileName != null ">application_material_file_name=#{applicationMaterialFileName},</if>
|
<if test="handlingProceduresFileName != null ">handling_procedures_file_name=#{handlingProceduresFileName},</if>
|
<if test="ratesFileName != null ">rates_file_name=#{ratesFileName},</if>
|
<if test="operationalGuidelineUrl != null">operational_guideline_url=#{operationalGuidelineUrl},</if>
|
<if test="setGist != null and setGist != '' ">set_gist=#{setGist},</if>
|
<if test="setGistUrl != null and setGistUrl != '' ">set_gist_url=#{setGistUrl},</if>
|
<if test="setGistName != null and setGistName != '' ">set_gist_name=#{setGistName},</if>
|
<if test="commonProblem != null and commonProblem != '' ">common_problem=#{commonProblem},</if>
|
<if test="commonProblemUrl != null and commonProblemUrl != '' ">common_problem_url=#{commonProblemUrl},</if>
|
<if test="commonProblemName != null and commonProblemName != '' ">common_problem_name=#{commonProblemName},</if>
|
<if test="operationalGuidelineVideoUrl != null ">operational_guideline_video_url=#{operationalGuidelineVideoUrl},</if>
|
<if test="operationalGuidelineVideoName != null and operationalGuidelineVideoName != '' ">operational_guideline_video_name=#{operationalGuidelineVideoName},</if>
|
<if test="operationalGuidelineName != null and operationalGuidelineName != '' ">operational_guideline_name=#{operationalGuidelineName},</if>
|
<if test="transactionArea != null ">transaction_area=#{transactionArea},</if>
|
<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}
|
</update>
|
|
<delete id="deleteConfigById" parameterType="string">
|
delete from automessage_transaction_event where id= #{Id}
|
</delete>
|
|
<select id="countNum" resultType="integer">
|
select count(id) from automessage_transaction_event
|
<where>
|
<if test="keyword != null and keyword != ''">
|
AND (matter_name like concat('%', #{keyword}, '%')) or
|
(department_id in (SELECT id FROM automessage_organization_chart WHERE organization_name like concat('%', #{keyword}, '%')))
|
or (classify_id in (SELECT id FROM automessage_classify_administration WHERE classify_name like concat('%', #{keyword}, '%')))
|
or (associate_names like concat('%', #{keyword}, '%'))
|
</if>
|
<if test="classifyGrade != null and classifyGrade != ''">
|
AND (select classify_grade from classify_administration where classify_grade.id=classify_id) = #{classifyGrade}
|
</if>
|
<if test="ids != null">
|
and department_id IN
|
<foreach collection="ids" item="param" open="(" close=")" separator=",">
|
#{param}
|
</foreach>
|
</if>
|
</where>
|
</select>
|
|
|
<select id="queryMatterNameList" resultMap="TransactionEventEntityResult">
|
select id,matter_name from automessage_transaction_event
|
<where>
|
<if test="matterName != null and matterName != ''">
|
AND (matter_name like concat('%', #{matterName}, '%') )
|
</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} ))
|
</if>
|
|
</where>
|
order by create_time desc
|
</select>
|
|
<select id="queryAssociateNamesList" resultMap="TransactionEventEntityResult">
|
select id,matter_name from automessage_transaction_event
|
<where>
|
<if test="associateNames != null and associateNames != ''">
|
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} ))
|
</if>
|
|
</where>
|
order by create_time desc
|
</select>
|
|
<select id="sumTransactionNum" resultMap="TransactionEventEntityResult">
|
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">
|
<include refid="selectTransactionEventEntityVo"/>
|
where (classify_id= #{classifyId} or classify_id in (select id FROM automessage_classify_administration where parent_id =#{classifyId} ))
|
<if test="departmentId!=null">
|
and department_id in (select id from automessage_organization_chart where id=#{departmentId} or parent_id=#{departmentId})
|
</if>
|
order by create_time desc
|
</select>
|
|
<select id="countNumByClassifyIdList" resultType="integer">
|
select count(id) from automessage_transaction_event
|
where (classify_id= #{classifyId} or classify_id in (select id FROM automessage_classify_administration where parent_id =#{classifyId} ))
|
<if test="departmentId!=null">
|
and department_id=#{departmentId}
|
</if>
|
order by create_time desc
|
</select>
|
|
|
<update id="updateConfigByMatterName" parameterType="com.dg.core.db.gen.entity.TransactionEvent">
|
update automessage_transaction_event
|
<set>
|
browse_num=browse_num+1,query_time=sysdate()
|
</set>
|
<where>
|
matter_name like concat('%', #{matterName}, '%')
|
</where>
|
|
</update>
|
|
<select id="countNumByMatterName" resultType="integer">
|
select count(id) from automessage_transaction_event
|
<where>
|
<if test="matterName != null and matterName != ''">
|
AND matter_name like concat('%', #{matterName}, '%')
|
</if>
|
|
</where>
|
</select>
|
|
<select id="selectSearch" resultType="com.dg.core.db.manual.pojo.Search">
|
select id,title,content,views, type FROM(
|
select id,organization_name title,resume content,null views,1 type from automessage_organization_chart where grade=1 UNION
|
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 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>
|
|
<select id="selectSearchList" resultType="com.dg.core.db.manual.pojo.Search">
|
select distinct classify_id, content,type,parentClassifyId from ( 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,
|
classify_id,(select parent_id from automessage_classify_administration where id=automessage_transaction_event.classify_id) parentClassifyId,
|
2 type from automessage_transaction_event) k
|
where k.title like concat('%',#{keyWord}, '%') or k.content like concat('%',#{keyWord}, '%')
|
</select>
|
|
<select id="selectSearchAssociate" resultType="com.dg.core.db.manual.pojo.Search">
|
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 ,3 type from automessage_transaction_event where associate_names like concat('%',#{keyWord}, '%')
|
</select>
|
|
<select id="selectSearchAssociateDistinct" resultType="com.dg.core.db.manual.pojo.Search" >
|
select distinct classify_id,
|
(select ifnull(concat((select classify_name from automessage_classify_administration where c.parent_id=id),'/',classify_name),classify_name) content from automessage_classify_administration c where c.id=t.classify_id) content,
|
3 type from automessage_transaction_event t where associate_names like concat('%',#{keyWord}, '%')
|
</select>
|
|
<select id="selectDataIfExist" resultType="string">
|
select id from automessage_transaction_event
|
where department_id=#{departmentId}
|
and matter_name=#{matterName}
|
</select>
|
|
<select id="selectclassifyId" resultType="string">
|
select id from automessage_transaction_event
|
where classify_id=#{classifyId}
|
</select>
|
|
|
|
</mapper>
|