<?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" />
|
|
</resultMap>
|
|
<sql id="selectTransactionEventEntityVo">
|
SELECT
|
id,
|
department_id,
|
department_area,
|
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,
|
(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,
|
department_area,
|
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,
|
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="matterAndUser != null and matterAndUser != ''">
|
AND associate_names like concat('%', #{matterAndUser}, '%') or matter_name like concat('%', #{matterAndUser}, '%')
|
</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="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 and associateIds != '' ">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 and associateNames != '' ">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>
|
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 and associateIds != '' ">#{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 and associateNames != '' ">#{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>
|
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 and associateIds != '' ">associate_ids=#{associateIds},</if>
|
<if test="transactionNum != null ">transaction_num=#{transactionNum},</if>
|
<if test="browseNum != null ">browse_num=#{browseNum},</if>
|
<if test="basicInformation != null and basicInformation != '' ">basic_information=#{basicInformation},</if>
|
<if test="acceptConditions != null and acceptConditions != '' ">accept_conditions=#{acceptConditions},</if>
|
<if test="applicationMaterial != null and applicationMaterial != '' ">application_material=#{applicationMaterial},</if>
|
<if test="handlingProcedures != null and handlingProcedures != '' ">handling_procedures=#{handlingProcedures},</if>
|
<if test="rates != null and rates != '' ">rates=#{rates},</if>
|
<if test="associateNames != null and associateNames != '' ">associate_names=#{associateNames},</if>
|
<if test="queryTime != null">query_time=#{queryTime},</if>
|
<if test="basicInformationUrl != null and basicInformationUrl != '' ">basic_information_url=#{basicInformationUrl},</if>
|
<if test="acceptConditionsUrl != null and acceptConditionsUrl != '' ">accept_conditions_url=#{acceptConditionsUrl},</if>
|
<if test="applicationMaterialUrl != null and applicationMaterialUrl != '' ">application_material_url=#{applicationMaterialUrl},</if>
|
<if test="handlingProceduresUrl != null and handlingProceduresUrl != '' ">handling_procedures_url=#{handlingProceduresUrl},</if>
|
<if test="ratesUrl != null and ratesUrl != '' ">rates_url=#{ratesUrl},</if>
|
<if test="basicInformationFileName != null and basicInformationFileName != '' ">basic_information_file_name=#{basicInformationFileName},</if>
|
<if test="acceptConditionsFileName != null and acceptConditionsFileName != '' ">accept_conditions_file_name=#{acceptConditionsFileName},</if>
|
<if test="applicationMaterialFileName != null and applicationMaterialFileName != '' ">application_material_file_name=#{applicationMaterialFileName},</if>
|
<if test="handlingProceduresFileName != null and handlingProceduresFileName != '' ">handling_procedures_file_name=#{handlingProceduresFileName},</if>
|
<if test="ratesFileName != null and ratesFileName != '' ">rates_file_name=#{ratesFileName},</if>
|
<if test="operationalGuidelineUrl != null and operationalGuidelineUrl != '' ">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 and operationalGuidelineVideoUrl != '' ">operational_guideline_video_url=#{operationalGuidelineVideoUrl},</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="matterAndUser != null and matterAndUser != ''">
|
AND associate_names like concat('%', #{matterAndUser}, '%') or matter_name like concat('%', #{matterAndUser}, '%')
|
</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">
|
<include refid="selectTransactionEventEntityVo"/>
|
<where>
|
<if test="matterName != null and matterName != ''">
|
AND (matter_name like concat('%', #{matterName}, '%') or #{matterName} like concat('%', matter_name, '%'))
|
</if>
|
|
</where>
|
order by create_time desc
|
</select>
|
|
<select id="sumTransactionNum" resultMap="TransactionEventEntityResult">
|
select sum(transaction_num)sumTransactionNum,count(*) counttransaction FROM automessage_transaction_event
|
</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=#{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 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,
|
transaction_num views,2 type from automessage_transaction_event
|
) 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 id,title,content,views, type FROM(
|
select id,organization_name title,resume content,null views,1 type from automessage_organization_chart UNION
|
select id,classify_name title,null content,null views,4 type from automessage_classify_administration UNION
|
select id,matter_name title,null content,transaction_num views,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,
|
transaction_num views ,3 type from automessage_transaction_event where associate_names like concat('%',#{keyWord}, '%')
|
</select>
|
|
|
<!-- 首页统计 勿动 -->
|
<select id="countStatisticsNum" resultType="integer">
|
select count(id) from automessage_transaction_event
|
<where>
|
<if test="classifyIds != null">
|
and classify_id IN
|
<foreach collection="classifyIds" item="param" open="(" close=")" separator=",">
|
#{param}
|
</foreach>
|
</if>
|
</where>
|
</select>
|
|
|
|
|
</mapper>
|