xinyb
10 天以前 658898d28cded745ca15ee0a89e3025358356259
src/com/yc/crm/mail/service/MailFolderImpl.java
@@ -21,26 +21,30 @@
public class MailFolderImpl extends BaseService implements MailFolderIfc {
    @Transactional(rollbackFor = Exception.class)
    @Override
    public void saveFolder(T482107Entity folder) {
    public String saveFolder(T482107Entity folder) {
        String sql = "set nocount on\n";
        try {
            sql += "declare @rowId varchar(40),@parentRowId varchar(40) =" + GridUtils.prossSqlParm(folder.getParentRowId()) + "\n";
            sql += "exec getXXXX @rowId output \n";//获取一个rowId
            sql += "insert into t482107(companyId,companyName,folder_name,userCode,userName,sort_id,create_time,update_time,rowId,treeControl,parentRowId) " +
                    "values (" + GridUtils.prossSqlParm(folder.getCompanyId()) + "," + GridUtils.prossSqlParm(folder.getCompanyName()) + "," +
                    GridUtils.prossSqlParm(folder.getFolderName()) + "," + GridUtils.prossSqlParm(folder.getUserCode()) + "," +
                    GridUtils.prossSqlParm(folder.getUserName()) + "," + folder.getSortId() + ",getdate(),getdate()," +
                    GridUtils.prossSqlParm(folder.getRowId()) + "," + GridUtils.prossSqlParm(folder.getTreeControl()) + "," + GridUtils.prossSqlParm(folder.getParentRowId()) + ")";
            jdbcTemplate.update(sql);
                    GridUtils.prossSqlParm(folder.getUserName()) + "," + folder.getSortId() + ",getdate(),getdate(),@rowId," +
                    GridUtils.prossSqlParm(folder.getTreeControl()) + ",@parentRowId)";
            sql += "select @rowId as rowId";
            return jdbcTemplate.queryForObject(sql, String.class);
        } catch (Exception e) {
            throw e;
        }
    }
    @Transactional(rollbackFor = Exception.class)
    @Override
    public Integer updateFolder(T482107Entity folder) {
        String sql = "set nocount on\n";
        try {
            sql += "update t482107 set folder_name=" + GridUtils.prossSqlParm(folder.getFolderName()) +
                    ",sort_id=" + folder.getSortId() + ",update_time=getdate() " + ",rowId=" + GridUtils.prossSqlParm(folder.getRowId()) +
                    ",sort_id=" + folder.getSortId() + ",update_time=getdate() " + //",rowId=" + GridUtils.prossSqlParm(folder.getRowId()) +
                    ",treeControl=" + GridUtils.prossSqlParm(folder.getTreeControl()) + ",parentRowId=" + GridUtils.prossSqlParm(folder.getParentRowId()) +
                    "where folder_id=" + folder.getFolderId() + " and userCode=" + GridUtils.prossSqlParm(folder.getUserCode()) + "\n";
            sql += "select @@ROWCOUNT";
@@ -49,6 +53,7 @@
            throw e;
        }
    }
    @Transactional(rollbackFor = Exception.class)
    @Override
    public Integer deleteFolder(String userCode, Integer folderId) {