Showing
1 changed file
with
33 additions
and
17 deletions
... | @@ -128,23 +128,39 @@ | ... | @@ -128,23 +128,39 @@ |
128 | </update> | 128 | </update> |
129 | 129 | ||
130 | <select id="queryForApplyNo" parameterType="String" resultType="map"> | 130 | <select id="queryForApplyNo" parameterType="String" resultType="map"> |
131 | - select a.return_type RETURNTYPE, b.otc_name OTCNAME, b.otc_code OTCCODE,b.CLIENT_NAME CLIENTNAME, | 131 | +SELECT A.RETURN_TYPE RETURNTYPE, B.OTC_NAME OTCNAME, B.OTC_CODE OTCCODE,B.CLIENT_NAME CLIENTNAME,B.FUND_ACCOUNT CLIENT_ID, |
132 | - A.APPLY_NO APPLYNO,a.return_no RETURNNO,innercirculat_no INNERCIRCULATNO,a.id ID, | 132 | +A.APPLY_NO APPLYNO,A.RETURN_NO RETURNNO,INNERCIRCULAT_NO INNERCIRCULATNO,A.ID ID, |
133 | - case | 133 | +CASE |
134 | - when a.return_type = '0' then | 134 | +WHEN A.RETURN_TYPE = '0' THEN |
135 | - b.back_amount | 135 | +B.BACK_AMOUNT |
136 | - when a.return_type = '1' then | 136 | +WHEN A.RETURN_TYPE = '1' THEN |
137 | - b.approval_count | 137 | +B.APPROVAL_COUNT |
138 | - when a.return_type = '2' then | 138 | +WHEN A.RETURN_TYPE = '2' THEN |
139 | - b.back_amount + b.approval_count | 139 | +B.BACK_AMOUNT + B.APPROVAL_COUNT |
140 | - else | 140 | +ELSE |
141 | - 0 | 141 | +0 |
142 | - end ALLCOUNT | 142 | +END ALLCOUNT |
143 | - from hs_asset.trustapply_return_relation a, | 143 | +FROM HS_ASSET.TRUSTAPPLY_RETURN_RELATION A, |
144 | - hs_asset.trustapply b | 144 | +HS_ASSET.TRUSTAPPLY_20180817_2 B |
145 | - where a.apply_no = b.apply_no(+) | 145 | +WHERE A.APPLY_NO = B.APPLY_NO(+) AND B.OTC_CODE IS NOT NULL |
146 | - and | 146 | +AND A.RETURN_NO = #{value} |
147 | - a.return_no=#{value} | 147 | +UNION |
148 | +SELECT A.RETURN_TYPE RETURNTYPE, B.OTC_NAME OTCNAME, B.OTC_CODE OTCCODE,B.CLIENT_NAME CLIENTNAME,B.FUND_ACCOUNT CLIENT_ID, | ||
149 | +A.APPLY_NO APPLYNO,A.RETURN_NO RETURNNO,INNERCIRCULAT_NO INNERCIRCULATNO,A.ID ID, | ||
150 | +CASE | ||
151 | +WHEN A.RETURN_TYPE = '0' THEN | ||
152 | +B.BACK_AMOUNT | ||
153 | +WHEN A.RETURN_TYPE = '1' THEN | ||
154 | +B.APPROVAL_COUNT | ||
155 | +WHEN A.RETURN_TYPE = '2' THEN | ||
156 | +B.BACK_AMOUNT + B.APPROVAL_COUNT | ||
157 | +ELSE | ||
158 | +0 | ||
159 | +END ALLCOUNT | ||
160 | +FROM HS_ASSET.TRUSTAPPLY_RETURN_RELATION A, | ||
161 | +HS_ASSET.TRUSTAPPLY B | ||
162 | +WHERE A.APPLY_NO = B.APPLY_NO(+) AND B.OTC_CODE IS NOT NULL | ||
163 | +AND A.RETURN_NO = #{value} | ||
148 | </select> | 164 | </select> |
149 | 165 | ||
150 | <update id="updateRelation" parameterType="map" > | 166 | <update id="updateRelation" parameterType="map" > | ... | ... |
-
Please register or login to post a comment