Commit d6a8468e by wangqi

group by 修改

parent c0537059
...@@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="bz != null and bz != ''"> and a.bz = #{bz}</if> <if test="bz != null and bz != ''"> and a.bz = #{bz}</if>
</where> </where>
group by a.id group by a.id, a.bfzmc, a.lxr, a.nd, a.lrr, s.nick_name, a.lrsj, a.xgr, a.xgsj, a.bz
</select> </select>
<select id="selectSjBfzwhById" parameterType="Long" resultMap="SjBfzwhResult"> <select id="selectSjBfzwhById" parameterType="Long" resultMap="SjBfzwhResult">
......
...@@ -164,7 +164,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -164,7 +164,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fymc != null and fymc != ''"> and b.fymc like concat('%', #{fymc}, '%')</if> <if test="fymc != null and fymc != ''"> and b.fymc like concat('%', #{fymc}, '%')</if>
<if test="fyrq != null and fyrq != ''"> and a.fyrq = #{fyrq}</if> <if test="fyrq != null and fyrq != ''"> and a.fyrq = #{fyrq}</if>
${params.dataScope} ${params.dataScope}
group by b.id order by a.sprq desc group by a.id,a.dept_id,d.dept_name,a.fyrq,a.fyje,b.id,b.fymc,b.fylx,b.fyje,b.fyms
order by a.sprq desc
</select> </select>
<select id="getFygzById" resultMap="SjFybpResult"> <select id="getFygzById" resultMap="SjFybpResult">
select a.id zb_id,a.dept_id,d.dept_name,a.fyrq,a.fyje fyzje,b.id,b.fymc,b.fylx,b.fyje,b.fyms,IFNULL(sum(c.syje),0) ysyje from sj_fybp_zb a select a.id zb_id,a.dept_id,d.dept_name,a.fyrq,a.fyje fyzje,b.id,b.fymc,b.fylx,b.fyje,b.fyms,IFNULL(sum(c.syje),0) ysyje from sj_fybp_zb a
...@@ -173,7 +174,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -173,7 +174,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join sys_dept d on a.dept_id=d.dept_id left join sys_dept d on a.dept_id=d.dept_id
where 1=1 where 1=1
and b.id=#{id} and b.id=#{id}
group by b.id group by a.id,a.dept_id,d.dept_name,a.fyrq,a.fyje,b.id,b.fymc,b.fylx,b.fyje,b.fyms
</select> </select>
<select id="tjtbByfylx" resultType="com.qianhe.domain.Vo.SjfybpVo"> <select id="tjtbByfylx" resultType="com.qianhe.domain.Vo.SjfybpVo">
select select
...@@ -190,7 +191,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -190,7 +191,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fylx != null and fylx != ''"> and b.fylx = #{fylx}</if> <if test="fylx != null and fylx != ''"> and b.fylx = #{fylx}</if>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
group by b.fylx group by b.fylx,e.dict_label
</select> </select>
<select id="tjtbByDept" resultType="com.qianhe.domain.Vo.SjfybpVo"> <select id="tjtbByDept" resultType="com.qianhe.domain.Vo.SjfybpVo">
select select
...@@ -206,7 +207,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -206,7 +207,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fylx != null and fylx != ''"> and b.fylx = #{fylx}</if> <if test="fylx != null and fylx != ''"> and b.fylx = #{fylx}</if>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
group by a.dept_id group by a.dept_id,d.dept_name
</select> </select>
<select id="selectSjFybpCtList" resultMap="SjFybpResult"> <select id="selectSjFybpCtList" resultMap="SjFybpResult">
select select
......
...@@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="bz != null and bz != ''"> and a.bz = #{bz}</if> <if test="bz != null and bz != ''"> and a.bz = #{bz}</if>
</where> </where>
group by a.id group by a.id, a.bfzmc, a.lxr, a.nd, a.lrr, s.nick_name, a.lrsj, a.xgr, a.xgsj, a.bz,p.dept_name,c.dept_name
</select> </select>
<select id="selectSjGfjsBfzwhById" parameterType="Long" resultMap="SjGfjsBfzwhResult"> <select id="selectSjGfjsBfzwhById" parameterType="Long" resultMap="SjGfjsBfzwhResult">
......
...@@ -129,14 +129,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -129,14 +129,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="tjBysfsc" resultType="com.qianhe.domain.Vo.SjLhscVo"> <select id="tjBysfsc" resultType="com.qianhe.domain.Vo.SjLhscVo">
select d.dept_id,d.dept_name,IFNULL(a.zt, '未提交') zt from sys_dept d left join select d.dept_id,d.dept_name,IFNULL(a.zt, '未提交') zt from sys_dept d left join
( (
select d.dept_id, d.dept_name, IFNULL(zt, '未提交') zt select d.dept_id, d.dept_name, IFNULL(lh.zt, '未提交') zt
from sys_dept d from sys_dept d
left join sj_lhsc lh on d.dept_id = lh.dept_id left join sj_lhsc lh on d.dept_id = lh.dept_id
where d.dwjb =#{dwjb} where d.dwjb =#{dwjb}
<if test="deptId != null and deptId != ''"> and (lh.dept_id = #{deptId} or find_in_set(#{deptId},d.ancestors))</if> <if test="deptId != null and deptId != ''"> and (lh.dept_id = #{deptId} or find_in_set(#{deptId},d.ancestors))</if>
<if test="startJd !=null and startJd !=''"> and DATE_FORMAT(hyrq,'%Y-%m')>=#{startJd} </if> <if test="startJd !=null and startJd !=''"> and DATE_FORMAT(hyrq,'%Y-%m')>=#{startJd} </if>
<if test="endJd !=null and endJd !=''"> and DATE_FORMAT(hyrq,'%Y-%m')&lt;=#{endJd} </if> <if test="endJd !=null and endJd !=''"> and DATE_FORMAT(hyrq,'%Y-%m')&lt;=#{endJd} </if>
group by d.dept_id group by d.dept_id,d.dept_name,lh.zt
) a on d.dept_id=a.dept_id ) a on d.dept_id=a.dept_id
where d.dwjb = #{dwjb} where d.dwjb = #{dwjb}
<if test="deptId != null and deptId != ''"> and (d.dept_id = #{deptId} or find_in_set(#{deptId},d.ancestors))</if> <if test="deptId != null and deptId != ''"> and (d.dept_id = #{deptId} or find_in_set(#{deptId},d.ancestors))</if>
...@@ -157,7 +157,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -157,7 +157,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="startJd !=null and startJd !=''"> and DATE_FORMAT(hyrq,'%Y-%m')>=#{startJd} </if> <if test="startJd !=null and startJd !=''"> and DATE_FORMAT(hyrq,'%Y-%m')>=#{startJd} </if>
<if test="endJd !=null and endJd !=''"> and DATE_FORMAT(hyrq,'%Y-%m')&lt;=#{endJd} </if> <if test="endJd !=null and endJd !=''"> and DATE_FORMAT(hyrq,'%Y-%m')&lt;=#{endJd} </if>
group by d.dept_id) a group by d.dept_id ,d.dept_name) a
on d.dept_id=a.dept_id on d.dept_id=a.dept_id
where d.dwjb =#{dwjb} where d.dwjb =#{dwjb}
<if test="deptId != null and deptId != ''"> and (d.dept_id = #{deptId} or find_in_set(#{deptId},d.ancestors))</if> <if test="deptId != null and deptId != ''"> and (d.dept_id = #{deptId} or find_in_set(#{deptId},d.ancestors))</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment