Merge remote-tracking branch 'origin/lixuetao' into lixuetao
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
<?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.adc.da.report.dao.mysql.LabelDao">
|
||||
|
||||
<select id="getMaxNum" parameterType="string" resultType="int">
|
||||
select max(t.orderNum) from TS_LABEL t where type=#{type}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,250 +0,0 @@
|
||||
<?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.adc.da.report.dao.mysql.ReportDao">
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="BaseColumnList">
|
||||
id, name, keycontent, maincontent, department, year, fileId, confidentialLevel, privacyLevel,
|
||||
createUserId, createDate, updateDate, del_flag,secrecy_last
|
||||
</sql>
|
||||
|
||||
<sql id="BaseColumnValue">
|
||||
#{Vo.id},#{Vo.name},#{Vo.keycontent},#{Vo.maincontent},#{Vo.department},#{Vo.year},#{Vo.fileId},
|
||||
#{Vo.confidentialLevel},#{Vo.privacyLevel},
|
||||
#{Vo.createUserId},
|
||||
#{Vo.createDate},#{Vo.updateDate},#{Vo.del_flag},
|
||||
#{Vo.secrecyLast}
|
||||
</sql>
|
||||
|
||||
<insert id="saveReportAct">
|
||||
insert into TT_REPORT_MANAGE (<include refid="BaseColumnList"/>)
|
||||
value (
|
||||
#{Vo.dataId},#{Vo.name},#{Vo.keyContent},#{Vo.mainContent},#{Vo.department},#{Vo.year},#{Vo.fileId},
|
||||
#{Vo.confidentialLevel},#{Vo.privacyLevel},
|
||||
#{Vo.createUserId},
|
||||
#{Vo.createDate},#{Vo.updateDate},#{Vo.delFlag},
|
||||
#{Vo.secrecyLast})
|
||||
</insert>
|
||||
|
||||
<select id="getReportDateList" parameterType="string" resultType="string">
|
||||
select distinct year from TT_REPORT_MANAGE t1
|
||||
left join TR_REPORT_USER t2 on t1.id=t2.reportId
|
||||
where del_flag='0'
|
||||
<if test="usid !='' and usid !=null">
|
||||
and t2.userId=#{usid}
|
||||
</if>
|
||||
ORDER BY year DESC
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getAddReportPage" resultType="com.adc.da.report.vo.ReportVo">
|
||||
|
||||
SELECT
|
||||
eo.id,
|
||||
eo.NAME,
|
||||
eo.keycontent,
|
||||
eo.maincontent,
|
||||
eo.DEPARTMENT,
|
||||
eo.YEAR,
|
||||
eo.fileid,
|
||||
eo.confidentialLevel,
|
||||
eo.privacyLevel,
|
||||
pa.report_id,
|
||||
pa.user_id
|
||||
FROM
|
||||
TT_REPORT_MANAGE eo
|
||||
LEFT JOIN tr_report_user ru ON eo.id = ru.reportId
|
||||
LEFT JOIN power_apply pa ON pa.report_id = eo.id
|
||||
WHERE
|
||||
eo.DEL_FLAG = 0
|
||||
<if test="pageVO.usid !='' and pageVO.usid != null">
|
||||
AND eo.id NOT IN ( SELECT ru.reportId FROM tr_report_user ru WHERE ru.userId = #{pageVO.usid} )
|
||||
AND eo.id NOT IN ( SELECT tt.report_id FROM power_apply tt WHERE tt.user_id = #{pageVO.usid} )
|
||||
AND eo.id NOT IN (SELECT tt.report_id FROM power_apply_act tt LEFT JOIN bus_process_name pro on tt.prc_id = pro.PRC_ID WHERE tt.user_id = #{pageVO.usid} and
|
||||
del_flag != 1 and pro.SUBMIT_STATUS = 1)
|
||||
</if>
|
||||
<if test="pageVO.name !='' and pageVO.name != null">
|
||||
and name like CONCAT(CONCAT('%',#{pageVO.name}),'%')
|
||||
</if>
|
||||
<!--年份搜索-->
|
||||
<if test="pageVO.year != null and pageVO.year.size() > 0">
|
||||
and year in
|
||||
<foreach collection="pageVO.year" item="year" open="(" separator="," close=")">
|
||||
#{year}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="pageVO.ids != null and pageVO.ids.size() > 0">
|
||||
and eo.id in
|
||||
<foreach collection="pageVO.ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY
|
||||
eo.id
|
||||
ORDER BY
|
||||
eo.updateDate DESC
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<select id="page" resultType="com.adc.da.report.vo.ReportVo">
|
||||
|
||||
SELECT
|
||||
eo.id,
|
||||
eo.NAME,
|
||||
eo.keycontent,
|
||||
eo.maincontent,
|
||||
eo.DEPARTMENT,
|
||||
eo.YEAR,
|
||||
eo.fileid,
|
||||
eo.confidentialLevel,
|
||||
eo.privacyLevel,
|
||||
pa.report_id,
|
||||
pa.user_id,
|
||||
pa.power
|
||||
FROM
|
||||
TT_REPORT_MANAGE eo
|
||||
INNER JOIN ts_report_label AS trl ON eo.id = trl.report_id
|
||||
LEFT JOIN tr_report_user ru ON eo.id = ru.reportId
|
||||
LEFT JOIN power_apply pa ON pa.report_id = eo.id
|
||||
WHERE
|
||||
eo.DEL_FLAG = 0
|
||||
<if test="pageVO.usid !='' and pageVO.usid != null">
|
||||
and (ru.userId = #{pageVO.usid}
|
||||
or eo.id in (
|
||||
SELECT tt.report_id from power_apply tt WHERE tt.user_id = #{pageVO.usid})
|
||||
)
|
||||
</if>
|
||||
<if test="pageVO.name !='' and pageVO.name != null">
|
||||
and name like CONCAT(CONCAT('%',#{pageVO.name}),'%')
|
||||
</if>
|
||||
<if test="pageVO.keyContent !='' and pageVO.keyContent != null">
|
||||
and keycontent like CONCAT(CONCAT('%',#{pageVO.keyContent}),'%')
|
||||
</if>
|
||||
<!--年份搜索-->
|
||||
<if test="pageVO.year != null and pageVO.year.size() > 0">
|
||||
and year in
|
||||
<foreach collection="pageVO.year" item="year" open="(" separator="," close=")">
|
||||
#{year}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="pageVO.ids != null and pageVO.ids.size() > 0">
|
||||
and eo.id in
|
||||
<foreach collection="pageVO.ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<!--id搜索-->
|
||||
<if test="idSet !=null and idSet.size() > 0">
|
||||
and eo.id in
|
||||
<foreach collection="idSet" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY
|
||||
eo.id
|
||||
ORDER BY
|
||||
eo.updateDate DESC
|
||||
|
||||
</select>
|
||||
|
||||
<select id="reportManagerPage" parameterType="com.adc.da.report.vo.ReportQueryVo" resultType="com.adc.da.report.vo.ReportVo">
|
||||
SELECT DISTINCT
|
||||
trl.report_id AS id,
|
||||
t.year,
|
||||
t.name,
|
||||
t.keycontent,
|
||||
t.fileId,
|
||||
t.createDate,
|
||||
t.department,
|
||||
t.maincontent,
|
||||
t.confidentialLevel,
|
||||
t.privacyLevel
|
||||
FROM `tt_report_manage` AS t
|
||||
INNER JOIN ts_report_label AS trl ON t.id = trl.report_id
|
||||
WHERE t.del_flag = 0
|
||||
<!--报表名称搜索-->
|
||||
<if test="Vo.name != null and Vo.name != ''">
|
||||
and t.name like CONCAT(CONCAT('%',#{Vo.name}),'%')
|
||||
</if>
|
||||
|
||||
<!--年份搜索-->
|
||||
<if test="Vo.year != null and Vo.year.size() > 0">
|
||||
and t.year in
|
||||
<foreach collection="Vo.year" item="year" open="(" separator="," close=")">
|
||||
#{year}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<!--id搜索-->
|
||||
<if test="idSet !=null and idSet.size() > 0">
|
||||
and t.id in
|
||||
<foreach collection="idSet" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<!--id搜索-->
|
||||
<if test="Vo.ids !=null and Vo.ids.size() > 0">
|
||||
and t.id in
|
||||
<foreach collection="Vo.ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<!--用户搜索-->
|
||||
<if test="Vo.usid != null and Vo.usid != ''">
|
||||
and t.createUserId=#{Vo.usid}
|
||||
</if>
|
||||
|
||||
ORDER BY updateDate desc
|
||||
</select>
|
||||
<select id="isAct" resultType="java.lang.String">
|
||||
SELECT rep.name FROM power_apply_act tt
|
||||
LEFT JOIN bus_process_name pro on tt.prc_id = pro.PRC_ID
|
||||
LEFT JOIN tt_report_manage rep on tt.report_id = rep.id
|
||||
WHERE tt.user_id = #{Vo.usid} and tt.del_flag != 1 and
|
||||
pro.SUBMIT_STATUS = 1
|
||||
and tt.report_id in
|
||||
<foreach collection="Vo.ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
GROUP BY rep.id;
|
||||
</select>
|
||||
|
||||
<select id="selectByidAndName" resultType="java.lang.Long">
|
||||
select count(1) from tt_report_manage rep
|
||||
<where>
|
||||
rep.Name = #{Vo.name}
|
||||
and rep.del_flag = 0
|
||||
<if test="Vo.id != null and Vo.id != ''">
|
||||
and rep.id != #{Vo.id}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="reportDetail" resultType="com.adc.da.report.vo.ReportDetailVo">
|
||||
SELECT
|
||||
rm.id AS id,
|
||||
rm.name AS `name`,
|
||||
rm.createUserId AS createUserId,
|
||||
u.USNAME AS uploaderName,
|
||||
rm.keycontent AS keycontent,
|
||||
rm.maincontent AS maincontent,
|
||||
rm.department AS departmentName,
|
||||
rm.`year` AS `year`,
|
||||
rm.fileId AS fileId,
|
||||
rm.confidentialLevel AS confidentialLevel,
|
||||
rm.privacyLevel AS privacyLevel
|
||||
FROM `tt_report_manage` AS rm
|
||||
INNER JOIN ts_user AS u ON u.USID = rm.createUserId
|
||||
WHERE rm.id = #{reportId}
|
||||
AND rm.del_flag = 0
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user