|
@@ -37,7 +37,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
37
|
37
|
<result property="modifyDocument" column="modify_document" />
|
38
|
38
|
<result property="finalDocument" column="final_document" />
|
39
|
39
|
<result property="amount" column="amount" />
|
40
|
|
- <result property="content" column="content" />
|
41
|
40
|
<association property="reportUser" javaType="SysUser" resultMap="ReportUserResult" />
|
42
|
41
|
<association property="zhUser" javaType="SysUser" resultMap="ZhUserResult" />
|
43
|
42
|
<association property="jsUser" javaType="SysUser" resultMap="JsUserResult" />
|
|
@@ -98,8 +97,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
98
|
97
|
|
99
|
98
|
<sql id="selectCmcSettleVo">
|
100
|
99
|
select distinct s.settle_id, s.project_id, p.project_number, p.project_name, p.undertaking_dept, s.xm_name, s.workload_report, s.reporter, u.nick_name as report_nick_name, s.report_time, s.settle_comment, s.zh_user_id, u1.nick_name as zh_nick_name,
|
101
|
|
- s.zh_time, s.zh_comment, s.js_user_id, u2.nick_name as js_nick_name, s.js_time, s.js_comment, s.jy_user_id, u3.nick_name as jy_nick_name, s.jy_time, s.jy_comment,
|
102
|
|
- s.manager_user_id, u4.nick_name as manager_nick_name, s.manager_time, s.manager_comment, s.gm_user_id, u5.nick_name as gm_nick_name, s.gm_time, s.gm_comment, ss.amount,
|
|
100
|
+ s.zh_time, s.zh_comment, s.js_user_id, u2.nick_name as js_nick_name, s.js_time, s.js_comment, s.jy_user_id, u3.nick_name as jy_nick_name, s.jy_time, s.jy_comment,
|
|
101
|
+ s.manager_user_id, u4.nick_name as manager_nick_name, s.manager_time, s.manager_comment, s.gm_user_id, u5.nick_name as gm_nick_name, s.gm_time, s.gm_comment,
|
103
|
102
|
s.dsz_user_id, u6.nick_name as dsz_nick_name, s.dsz_time, s.dsz_comment, s.settle_document, s.modify_document, s.final_document, s.report_dept, d.dept_name from cmc_settle as s
|
104
|
103
|
left join sys_user as u on u.user_id = s.reporter
|
105
|
104
|
left join sys_user as u1 on u1.user_id = s.zh_user_id
|
|
@@ -146,7 +145,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
146
|
145
|
group by s.settle_id
|
147
|
146
|
order by s.report_time desc
|
148
|
147
|
</select>
|
149
|
|
-
|
|
148
|
+
|
|
149
|
+ <select id="selectCmcSettleStatisticList" parameterType="CmcSettle" resultMap="CmcSettleResult">
|
|
150
|
+ select t0.settle_id, t0.project_id, t0.project_number, t0.project_name, t0.xm_name, t0.gm_time, (t2.amount - t0.amount) as amount from
|
|
151
|
+ (select distinct s.settle_id, s.project_id, p.project_number, p.project_name, s.xm_name, ss.table_number, s.gm_time, sum(ss.amount) as amount from cmc_settle as s
|
|
152
|
+ left join cmc_project as p on p.project_id = s.project_id
|
|
153
|
+ left join cmc_settle_summary as ss on ss.settle_id = s.settle_id
|
|
154
|
+ where ss.table_number = '0' group by s.settle_id) as t0 left join
|
|
155
|
+ (select distinct s.settle_id, sum(ss.amount) as amount from cmc_settle as s
|
|
156
|
+ left join cmc_project as p on p.project_id = s.project_id
|
|
157
|
+ left join cmc_settle_summary as ss on ss.settle_id = s.settle_id
|
|
158
|
+ where ss.table_number = '2' group by s.settle_id) as t2 on t0.settle_id = t2.settle_id
|
|
159
|
+ <where>
|
|
160
|
+ <if test="projectId != null"> and t0.project_id = #{projectId}</if>
|
|
161
|
+ <if test="projectNumber != null and projectNumber != ''"> and t0.project_number like concat('%', #{projectNumber}, '%')</if>
|
|
162
|
+ <if test="xmName != null"> and t0.xm_name = #{xmName}</if>
|
|
163
|
+ <if test="gmTime != null"> and YEAR(t0.gm_time) = YEAR(#{gmTime})</if>
|
|
164
|
+ </where>
|
|
165
|
+ </select>
|
|
166
|
+
|
150
|
167
|
<select id="selectCmcSettleBySettleId" parameterType="String" resultMap="CmcSettleResult">
|
151
|
168
|
<include refid="selectCmcSettleVo"/>
|
152
|
169
|
where s.settle_id = #{settleId}
|