|
@@ -1080,19 +1080,22 @@ namespace GxPress.Repository.Implement
|
|
|
/// <returns></returns>
|
|
|
public async Task<int> GetUserUReadFlowTodoCountAsync(int userId)
|
|
|
{
|
|
|
+ var folderTypeConst = AllTypeConst.Inbox.GetHashCode();
|
|
|
+ var myCheckedConst = AllTypeConst.MyChecked.GetHashCode();
|
|
|
string sql = $@"SELECT
|
|
|
- count(1)
|
|
|
- FROM
|
|
|
- tede_flow_todo
|
|
|
- WHERE
|
|
|
- FlowId IN (SELECT
|
|
|
- SonId
|
|
|
- FROM
|
|
|
- tede_notice
|
|
|
- WHERE
|
|
|
- userId ={userId} AND TypeValue = 15
|
|
|
- AND IsDelete = 0)
|
|
|
- AND Type = 'ApproverCheck' and IsRead=0";
|
|
|
+ count(1)
|
|
|
+ FROM
|
|
|
+ tede_flow_todo a
|
|
|
+ INNER JOIN
|
|
|
+ tede_notice b ON a.FlowId = b.SourceId
|
|
|
+ INNER JOIN
|
|
|
+ tede_middle c ON c.MiddleId = b.Id
|
|
|
+ WHERE
|
|
|
+ 1 = 1 AND b.TypeValue ={myCheckedConst} and c.FolderType={folderTypeConst}
|
|
|
+ AND a.Type = 'ApproverCheck'
|
|
|
+ and c.UserId={userId}
|
|
|
+ AND a.IsDone = 0
|
|
|
+ AND c.IsDelete = 0;";
|
|
|
var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
|
|
|
var database = new Database(databaseType, _connectionString);
|
|
|
var connection = database.GetConnection();
|