| | |
| | | fieldlen: _fieldlen, |
| | | key: cell.field, |
| | | required: cell.required === 'true' ? 'required' : '', |
| | | writein: cell.required !== 'false', |
| | | writein: cell.writein !== 'false', |
| | | value: cell.initval || '' |
| | | } |
| | | |
| | |
| | | ` |
| | | } |
| | | |
| | | if (_initcolumnfields.length > 0) { |
| | | _sql += `select ${_initcolumnfields.join(',')} from ${setting.dataresource} where ${primaryKey}=@ID@ |
| | | ` |
| | | } |
| | | // if (_initcolumnfields.length > 0) { |
| | | // _sql += `select ${_initcolumnfields.join(',')} from (${setting.dataresource})tb where ${primaryKey}=@ID@ |
| | | // ` |
| | | // } |
| | | |
| | | // 去除禁用的验证 |
| | | if (verify.contrasts) { |
| | |
| | | receiptKeys.push('bid') |
| | | } |
| | | |
| | | let _insertsql = '' |
| | | let _updatesql = '' |
| | | // 添加、修改、逻辑删除、物理删除 |
| | | if (_actionType === 'insert') { |
| | | if (_actionType === 'insert' || _actionType === 'insertOrUpdate') { |
| | | let keys = [] |
| | | let values = [] |
| | | |
| | |
| | | |
| | | keys = keys.join(',') |
| | | values = values.join(',') |
| | | _sql += ` |
| | | _insertsql = ` |
| | | /* 默认sql */ |
| | | insert into ${btn.sql} (${keys}) select ${values};` |
| | | } else if (_actionType === 'update') { |
| | | } |
| | | |
| | | if (_actionType === 'update' || _actionType === 'audit' || _actionType === 'insertOrUpdate') { |
| | | let _form = [] |
| | | let _arr = [] |
| | | |
| | |
| | | } |
| | | |
| | | _form = _form.join(',') |
| | | _sql += ` |
| | | _updatesql = ` |
| | | /* 默认sql */ |
| | | update ${btn.sql} set ${_form} where ${primaryKey}=@${primaryKey}@;` |
| | | } |
| | | |
| | | if (_actionType === 'insert') { |
| | | _sql += _insertsql |
| | | } else if (_actionType === 'update' || _actionType === 'audit') { |
| | | _sql += _updatesql |
| | | } else if (_actionType === 'insertOrUpdate') { |
| | | _sql += ` |
| | | select @tbid='' |
| | | select @tbid='X' from ${btn.sql} where ${primaryKey}=@ID@ |
| | | if @tbid='' |
| | | begin |
| | | ${_insertsql} |
| | | end |
| | | else |
| | | begin |
| | | ${_updatesql} |
| | | end |
| | | ` |
| | | } else if (_actionType === 'LogicDelete') { // 逻辑删除 |
| | | _sql += ` |
| | | /* 默认sql */ |