| | |
| | | |
| | | fields = fields.join(',') |
| | | |
| | | let _insert = '' |
| | | |
| | | if (btn.default !== 'false') { |
| | | _insert = ` |
| | | Insert into ${item.sheet} (${fields},createuserid,createuser,createstaff,bid) |
| | | Select ${fields},@userid@,@username,@fullname,@BID@ From @${item.sheet} |
| | | ` |
| | | } |
| | | |
| | | if (btn.scripts && btn.scripts.length > 0) { |
| | | btn.scripts.forEach(script => { |
| | | if (script.status === 'false') return |
| | | |
| | | _insert += ` |
| | | ${script.sql} |
| | | ` |
| | | }) |
| | | } |
| | | |
| | | _sql = `declare @${item.sheet} table (${declarefields.join(',')},jskey nvarchar(50) ) |
| | | Declare @UserName nvarchar(50),@FullName nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000) |
| | | |
| | |
| | | |
| | | Insert into @${item.sheet} (${fields},jskey) |
| | | ${_Ltext} |
| | | |
| | | Insert into ${item.sheet} (${fields},createuserid,createuser,createstaff,bid) |
| | | Select ${fields},@userid@,@username,@fullname,@BID@ From @${item.sheet} |
| | | |
| | | ${_insert} |
| | | Delete @${item.sheet} |
| | | |
| | | aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg` |
| | |
| | | config.search.forEach(item => { |
| | | if (item.field) { |
| | | let type = '' |
| | | let _f = item.field |
| | | |
| | | if (item.type.match(/date/ig)) { |
| | | type = 'datetime=null' |
| | |
| | | type = 'nvarchar(50)=\'\'' |
| | | } |
| | | |
| | | if (_fields.has(item.field)) { |
| | | _f = _f + '1' |
| | | } |
| | | |
| | | _fields.set(item.field, true) |
| | | formParam = formParam + `mchr13k@${_f} ${type},` |
| | | item.field.split(',').forEach(cell => { |
| | | let _f = cell |
| | | if (_fields.has(cell)) { |
| | | _f = _f + '1' |
| | | } |
| | | |
| | | _fields.set(cell, true) |
| | | formParam = formParam + `mchr13k@${_f} ${type},` |
| | | }) |
| | | } |
| | | }) |
| | | } |