| | |
| | | // INSERT INTO s_paas_api_log (appkey,api_name,api_count,menuname,createuserid,createuser,createstaff,cdefine1,cdefine2) |
| | | // SELECT @appkey@,'sPC_Get_TableData',1,@menuname@,@UserID@,@username@,@fullname@,@SessionUid@,@LoginUID@ |
| | | let sql = '' |
| | | let e_sql = `select ${_columns.map(col => col.field).join(',')} from (select ${_columns.map(col => /date/ig.test(col.datatype) ? `'1949-10-01' as ${col.field}` : `'0' as ${col.field}`).join(',')}) a where ${item.setting.primaryKey || 'ID'} != '0'` |
| | | if (DateCount) { |
| | | e_sql += ` |
| | | select 0 as total |
| | | ` |
| | | } |
| | | |
| | | if (item.setting.transact === 'true' && !/BEGIN\s+TRY\s+begin\s+TRAN/.test(_customScript)) { |
| | | sql = `/* ${item.setting.$name} */ |
| | |
| | | SELECT obj_name='@mk_obj_name@',prm_field='',str_field='', |
| | | arr_field='${arr_field}',tabid='${tabid}',parid='${parid}',sub_name='${sub_name}',sub_field='${sub_field}' |
| | | ` |
| | | |
| | | let e_sql = `select ${_columns.map(col => col.field).join(',')} from (select ${_columns.map(col => /date/ig.test(col.datatype) ? `'1949-10-01' as ${col.field}` : `'0' as ${col.field}`).join(',')}) a where ${item.setting.primaryKey || 'ID'} != '0'` |
| | | if (DateCount) { |
| | | e_sql += ` |
| | | select 0 as total |
| | | ` |
| | | } |
| | | |
| | | _tailScript = `${_tailScript} |
| | | select @ErrorCode as ErrorCode,@retmsg as retmsg |
| | |
| | | arr_field='${arr_field}',tabid='${tabid}',parid='${parid}',sub_name='${sub_name}',sub_field='${sub_field}' |
| | | ` |
| | | |
| | | let tail = 'aaa:' |
| | | if (/\sgoto\s+aaa([^0-9a-z_]|$)/ig.test(_customScript) && !/BEGIN\s+TRY\s+begin\s+TRAN/.test(_customScript)) { |
| | | tail = `if 1=2 |
| | | begin |
| | | aaa: |
| | | ${e_sql} |
| | | end` |
| | | } |
| | | |
| | | _tailScript = `${_tailScript} |
| | | aaa: |
| | | ${tail} |
| | | select @ErrorCode as ErrorCode,@retmsg as retmsg |
| | | ` |
| | | } |