| | |
| | | @Override |
| | | public List<PayInfo> queryListByCltCode(String dbId) { |
| | | try { |
| | | String sql = "select a.DocCode,a.CltCode,a.cltName,a.DocType,a.DocDate,a.ReceivMoney,b.MatName, b.Price, b.TotalMoney, b.ItemMemo,b.Digit,b.FYbeginday,b.FYendday\n" + |
| | | "from dbo.t120301H a join t120301D b on a.DocCode=b.doccode and isnull(a.DocStatus,0)=100 and isnull(a.ReceivMoney,0)- isnull(a.ShouKuanAmount,0) > 0 \n" + |
| | | "join t110203 c on a.CltCode=c.cltCode \n" + |
| | | "where c.dbid=" + dbId + " order by a.DocDate desc"; |
| | | String sql = "set nocount on \n" + |
| | | " select a.DocCode,a.CltCode,a.cltName,a.DocType,a.DocDate,a.ReceivMoney,b.MatName, b.Price, b.TotalMoney, b.ItemMemo,b.Digit,b.FYbeginday,b.FYendday, " + |
| | | " case when exists(select 1 from t150101d d join t150101log e on d.doccode = e.RefDoccode where a.doccode = d.SODoccode and isnull(e.ThirdOrderNo,'') <> '' ) then 1 else 0 end as isPaid \n"+ |
| | | " from dbo.t120301H a join t120301D b on a.DocCode=b.doccode and isnull(a.DocStatus,0)=100 and isnull(a.ReceivMoney,0)- isnull(a.ShouKuanAmount,0) > 0 \n" + |
| | | " join t110203 c on a.CltCode=c.cltCode \n" + |
| | | " where c.dbid=" + dbId + " order by a.DocDate desc"; |
| | | return ReceiptUtils.getList_T(super.jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(PayItem.class))); |
| | | } catch (Exception e) { |
| | | throw e; |
| | |
| | | @Override |
| | | public Integer queryDbIdByCltCode(String cltCode) { |
| | | try { |
| | | String sql = "select dbId from t110203 where cltCode='" + cltCode + "'"; |
| | | String sql = "set nocount on \n" + |
| | | " select dbId from t110203 where cltCode='" + cltCode + "'"; |
| | | return super.jdbcTemplate.queryForObject(sql, Integer.class); |
| | | } catch (Exception e) { |
| | | return 0; |
| | |
| | | @Override |
| | | public String queryCltCodeByDbId(String dbId) { |
| | | try { |
| | | String sql = "select cltCode from t110203 where dbId=" + dbId; |
| | | String sql = "set nocount on \n" + |
| | | " select cltCode from t110203 where dbId=" + dbId; |
| | | return super.jdbcTemplate.queryForObject(sql, String.class); |
| | | } catch (Exception e) { |
| | | return ""; |