修改xml

This commit is contained in:
liuwu 2024-02-21 11:23:31 +08:00
parent 0f0ce60ef9
commit 6faaa71bf5
2 changed files with 28 additions and 2 deletions

View File

@ -76,6 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="perId != null "> and a.per_id = #{perId}</if> <if test="perId != null "> and a.per_id = #{perId}</if>
<if test="deptId != null "> and a.dept_id = #{deptId}</if> <if test="deptId != null "> and a.dept_id = #{deptId}</if>
<if test="branchId != null "> and a.branch_id = #{branchId}</if> <if test="branchId != null "> and a.branch_id = #{branchId}</if>
<if test="year != null and year != ''"> and DATE_FORMAT(a.finish_date,'%Y') = #{year}</if>
</where> </where>
</select> </select>
@ -221,6 +222,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
finish_date finish_date
<if test="status != null "> and a.status = #{status}</if> <if test="status != null "> and a.status = #{status}</if>
<if test="year != null and year != ''"> and DATE_FORMAT(a.finish_date,'%Y') = #{year}</if>
</select> </select>
<select id="deptTree" parameterType="TAmentPartyAffairs" resultType="map"> <select id="deptTree" parameterType="TAmentPartyAffairs" resultType="map">
@ -296,6 +298,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM FROM
t_ament_party_affairs a t_ament_party_affairs a
where a.degree = 1 where a.degree = 1
<if test="year != null and year != ''">
AND DATE_FORMAT(finish_date, '%Y') = #{year}
</if>
group by a.type,a.shot_name group by a.type,a.shot_name
</select> </select>
@ -352,6 +357,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t_ament_party_affairs t_ament_party_affairs
WHERE WHERE
type = '党务及意识形态' type = '党务及意识形态'
<if test="year != null and year != ''">
AND DATE_FORMAT(finish_date, '%Y') = #{year}
</if>
GROUP BY GROUP BY
shot_name shot_name
</select> </select>
@ -365,6 +373,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t_ament_party_affairs t_ament_party_affairs
WHERE WHERE
type = '党风廉政建设' type = '党风廉政建设'
<if test="year != null and year != ''">
AND DATE_FORMAT(finish_date, '%Y') = #{year}
</if>
GROUP BY GROUP BY
shot_name shot_name
</select> </select>
@ -377,6 +388,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t_ament_party_affairs t_ament_party_affairs
WHERE WHERE
type = '日常考核指标' type = '日常考核指标'
<if test="year != null and year != ''">
AND DATE_FORMAT(finish_date, '%Y') = #{year}
</if>
GROUP BY GROUP BY
shot_name shot_name
</select> </select>
@ -389,6 +403,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t_ament_party_affairs t_ament_party_affairs
WHERE WHERE
type = '季度考核指标' type = '季度考核指标'
<if test="year != null and year != ''">
AND DATE_FORMAT(finish_date, '%Y') = #{year}
</if>
GROUP BY GROUP BY
shot_name shot_name
</select> </select>
@ -403,6 +420,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t_ament_party_affairs a LEFT JOIN sys_dept d on a.dept_id = d.dept_id t_ament_party_affairs a LEFT JOIN sys_dept d on a.dept_id = d.dept_id
WHERE WHERE
a.type IN ( '日常考核指标', '季度考核指标' ) and a.dept_id != 100 a.type IN ( '日常考核指标', '季度考核指标' ) and a.dept_id != 100
<if test="year != null and year != ''">
AND DATE_FORMAT(finish_date, '%Y') = #{year}
</if>
GROUP BY GROUP BY
a.dept_id, a.dept_id,
a.type a.type
@ -417,6 +437,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ROUND(IF( SUM( now_score ), SUM( now_score ), 0 )/ SUM( score )*100) percent ROUND(IF( SUM( now_score ), SUM( now_score ), 0 )/ SUM( score )*100) percent
FROM FROM
t_ament_party_affairs t_ament_party_affairs
WHERE 1=1
<if test="year != null and year != ''">
AND DATE_FORMAT(finish_date, '%Y') = #{year}
</if>
GROUP BY GROUP BY
type type
</select> </select>

View File

@ -42,8 +42,10 @@
GROUP_CONCAT( '{"label":"', trade_type, '","trade":', trade_mony, ',"count":', trade_count, '}' ) json GROUP_CONCAT( '{"label":"', trade_type, '","trade":', trade_mony, ',"count":', trade_count, '}' ) json
FROM FROM
t_ament_trade t_ament_trade
WHERE WHERE 1=1
month_of LIKE CONCAT( '%', DATE_FORMAT( NOW(), '%Y' ), '%' ) <if test="year != null and year != ''">
AND DATE_FORMAT(month_of, '%Y') = #{year}
</if>
GROUP BY GROUP BY
month_of, month_of,
type type