|
|
@@ -433,12 +433,12 @@ public class TextdictInfoController extends BladeController {
|
|
|
String value1;
|
|
|
if (type == 1) {
|
|
|
// 转数组格式
|
|
|
- value1 = String.format(" key_201 = concat(SUBSTRING_INDEX(key_201,'%s:',1), '%s:', if(substr(@v := if(INSTR(SUBSTRING_INDEX(key_201, '%s:',-1),'$$') - 1 < 0, SUBSTRING_INDEX(key_201, '%s:',-1), SUBSTR(SUBSTRING_INDEX(key_201, '%s:',-1), 1 , INSTR(SUBSTRING_INDEX(key_201, '%s:',-1),'$$') - 1)) , 1, 1) = '[', @v, concat('[', @vv := substr(@v,1, if(instr(@v, '_^_') - 1 < 0, char_length(@v), instr(@v, '_^_') - 1), if(instr(@vv,',') > 0, '', concat(',',@vv)) ,']', substr(@v, instr(@v, '_^_')))) , if (INSTR(SUBSTRING_INDEX(key_201, 'key_16:',-1),'$$') - 1 < 0, '', concat('$$', SUBSTRING_INDEX(SUBSTRING_INDEX(key_201,'key_16:',-1),'$$',-1))) ) ",
|
|
|
- split[0],split[0], split[0], split[0], split[0], split[0]);
|
|
|
+ value1 = String.format(" key_201 = if(key_201 is null or instr(key_201, '%s') =0, key_201, concat(SUBSTRING_INDEX(key_201,'%s:',1), '%s:', if(substr(@v := if(INSTR(SUBSTRING_INDEX(key_201, '%s:',-1),'$$') - 1 < 0, SUBSTRING_INDEX(key_201, '%s:',-1), SUBSTR(SUBSTRING_INDEX(key_201, '%s:',-1), 1 , INSTR(SUBSTRING_INDEX(key_201, '%s:',-1),'$$') - 1)) , 1, 1) = '[', @v, concat('[', @vv := substr(@v,1, if(instr(@v, '_^_') - 1 < 0, char_length(@v), instr(@v, '_^_') - 1)), if(instr(@vv,',') > 0, '', concat(',',@vv)) ,']', substr(@v, instr(@v, '_^_')))) , if (INSTR(SUBSTRING_INDEX(key_201, 'key_16:',-1),'$$') - 1 < 0, '', concat('$$', SUBSTRING_INDEX(SUBSTRING_INDEX(key_201,'key_16:',-1),'$$',-1))) ) )",
|
|
|
+ split[0],split[0], split[0], split[0], split[0], split[0], split[0]);
|
|
|
} else {
|
|
|
// 转普通格式
|
|
|
- value1 = String.format(" key_201 = concat(SUBSTRING_INDEX(key_201,'%s:',1), '%s:', if(substr(@v := if(INSTR(SUBSTRING_INDEX(key_201, '%s:',-1),'$$') - 1 < 0, SUBSTRING_INDEX(key_201, '%s:',-1), SUBSTR(SUBSTRING_INDEX(key_201, '%s:',-1), 1 , INSTR(SUBSTRING_INDEX(key_201, '%s:',-1),'$$') - 1)) , 1, 1) != '[', @v, concat(substr(@v, instr(@v, '[') + 1, (CHAR_LENGTH(@v) - instr(REVERSE(@v) , ']') - instr(@v, '['))), substr(@v, instr(@v, '_^_')))) , if (INSTR(SUBSTRING_INDEX(key_201, 'key_16:',-1),'$$') - 1 < 0, '', concat('$$', SUBSTRING_INDEX(SUBSTRING_INDEX(key_201,'key_16:',-1),'$$',-1))) ) ",
|
|
|
- split[0],split[0],split[0],split[0],split[0], split[0]);
|
|
|
+ value1 = String.format(" key_201 = if(key_201 is null or instr(key_201, '%s') <= 0, key_201, concat(SUBSTRING_INDEX(key_201,'%s:',1), '%s:', if(substr(@v := if(INSTR(SUBSTRING_INDEX(key_201, '%s:',-1),'$$') - 1 < 0, SUBSTRING_INDEX(key_201, '%s:',-1), SUBSTR(SUBSTRING_INDEX(key_201, '%s:',-1), 1 , INSTR(SUBSTRING_INDEX(key_201, '%s:',-1),'$$') - 1)) , 1, 1) != '[', @v, concat(substr(@v, instr(@v, '[') + 1, (CHAR_LENGTH(@v) - instr(REVERSE(@v) , ']') - instr(@v, '['))), substr(@v, instr(@v, '_^_')))) , if (INSTR(SUBSTRING_INDEX(key_201, 'key_16:',-1),'$$') - 1 < 0, '', concat('$$', SUBSTRING_INDEX(SUBSTRING_INDEX(key_201,'key_16:',-1),'$$',-1))) ) )",
|
|
|
+ split[0],split[0],split[0],split[0],split[0],split[0], split[0]);
|
|
|
}
|
|
|
value = value + " , " + value1;
|
|
|
sql = String.format("update %s set %s where p_key_id in ( select p_key_id from m_wbs_tree_contract WHERE is_type_private_pid = %d and project_id = %s )",
|