| | |
| | | }) |
| | | } |
| | | |
| | | // 控制台打印数据 |
| | | let conLtext = [] |
| | | let _Ltext = data.map((item, lindex) => { |
| | | let vals = [] |
| | | let convals = [] |
| | | btn.columns.forEach((col, cindex) => { |
| | | if (col.import === 'false') return |
| | | |
| | |
| | | } |
| | | |
| | | if (col.type === 'date') { |
| | | vals.push(`case when ${col.Column}='' then '1900-01-01' else dateadd(day,cast('${val}' as int)-2,'1900-01-01') end as ${col.Column}`) |
| | | vals.push(`case when '${val}'='' then '1900-01-01' else dateadd(day,cast('${val}' as int)-2,'1900-01-01') end`) |
| | | } else { |
| | | vals.push(`'${val}' as ${col.Column}`) |
| | | vals.push(`'${val}'`) |
| | | } |
| | | |
| | | if (lindex < 40) { |
| | | if (col.type === 'date') { |
| | | convals.push(`case when '${val}'='' then '1900-01-01' else dateadd(day,cast('${val}' as int)-2,'1900-01-01') end as ${col.Column}`) |
| | | } else { |
| | | convals.push(`'${val}' as ${col.Column}`) |
| | | } |
| | | } |
| | | }) |
| | | |
| | | let _lineIndex = '0000' + (lindex + 1) + '0' |
| | | _lineIndex = _lineIndex.substring(_lineIndex.length - 6) |
| | | |
| | | vals.push(`'${upId + _lineIndex}' as jskey`) |
| | | vals.push(`'${upId + _lineIndex}'`) |
| | | |
| | | if (lindex < 40) { |
| | | convals.push(`'${upId + _lineIndex}' as jskey`) |
| | | conLtext.push(`Select ${convals.join(',')}`) |
| | | } |
| | | |
| | | return `Select ${vals.join(',')}` |
| | | }) |
| | |
| | | |
| | | aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg` |
| | | |
| | | if (window.GLOB.systemType !== 'production' && options.sysType !== 'cloud') { |
| | | // if (window.GLOB.systemType !== 'production' && options.sysType !== 'cloud') { |
| | | if (window.GLOB.systemType !== 'production') { |
| | | let fsql = ` |
| | | ${_sql} |
| | | ${_sqlInsert} |
| | | |
| | | /* excel数据(前40条) */ |
| | | ${_Ltext.slice(0, 40).join(' Union all ')} |
| | | ${conLtext.join(' Union all ')} |
| | | ${_sqlBottom} |
| | | ` |
| | | fsql = fsql.replace(/\n\s{8}/ig, '\n') |
| | |
| | | _sql += ` |
| | | aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg` |
| | | |
| | | if (window.GLOB.systemType !== 'production' && options.sysType !== 'cloud') { |
| | | // if (window.GLOB.systemType !== 'production' && options.sysType !== 'cloud') { |
| | | if (window.GLOB.systemType !== 'production') { |
| | | _sql = _sql.replace(/\n\s{8}/ig, '\n') |
| | | console.log(_sql) |
| | | } |