| | |
| | | "read_Flag,(case when (isnull(handle_time,'') <> '' and isnull(handle_time,'') < getdate()) then 1 else 0 end) as handle," + |
| | | "handle_time,sender_time,receiving_time from t482101H "; |
| | | sql += " where isnull(handle_time,'') <> '' and isnull(handle_time,'') < getdate()"; |
| | | sql += " and userCode=" + GridUtils.prossSqlParm(userCode) + " and receiver like '%" + email + "%'"; |
| | | sql += " and userCode=" + GridUtils.prossSqlParm(userCode) ;//+ " and receiver like '%" + email + "%'";//不需要带邮箱地址 |
| | | sql += " order by docCode asc \n"; |
| | | sql += " OFFSET (" + page + " - 1) * " + limit + " ROWS FETCH NEXT " + limit + " ROWS ONLY"; |
| | | return jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(t482101HList.class)); |
| | |
| | | public void updateRead(String docCode, boolean status) { |
| | | String sql = " set nocount on \n"; |
| | | try { |
| | | sql += "declare @docCode varchar(200) ='" + docCode + "' \n"; |
| | | sql += "declare @docCode varchar(1000) ='" + docCode + "' \n"; |
| | | sql += "update t482101H set read_flag=" + (status ? 1 : 0) + " where docCode in (select list from GetInStr(@docCode))\n"; |
| | | sql += "select @@ROWCOUNT"; |
| | | jdbcTemplate.queryForObject(sql, Integer.class); |
| | |
| | | try { |
| | | sql += "select count(*) from t482101H "; |
| | | sql += " where userCode=" + GridUtils.prossSqlParm(userCode); |
| | | sql += " and isnull(delete_Flag,0) = 0 ";//未删除的 |
| | | if (mailType < 3) { |
| | | sql += " and mailType=" + mailType;//0:草稿箱 1:收件箱 2:发件箱 |
| | | } |
| | | if (mailType == 3) {//待处理邮件 |
| | | sql += " and isnull(handle_time,'') <> '' and isnull(handle_time,'') < getdate() "; |
| | | } |
| | | if (StringUtils.isNotBlank(email)) { |
| | | if (mailType == 1) { |
| | | sql += " and receiver like '%" + email + "%'"; |
| | | } else if (mailType == 2) { |
| | | sql += " and sender =" + GridUtils.prossSqlParm(email); |
| | | } else if (mailType == 3) { |
| | | sql += " and isnull(handle_time,'') <> '' and isnull(handle_time,'') < getdate() "; |
| | | } |
| | | } |
| | | if (isNoRead) {//0表示未读,1表示已读 |