2
3

oilsupplierService.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  1. package supplier
  2. import (
  3. . "dashoo.cn/backend/api/mydb"
  4. "dashoo.cn/utils"
  5. "github.com/go-xorm/xorm"
  6. "strconv"
  7. )
  8. type OilSupplierService struct {
  9. MyServiceBase
  10. }
  11. func GetOilSupplierService(xormEngine *xorm.Engine) *OilSupplierService {
  12. s := new(OilSupplierService)
  13. s.DBE = xormEngine
  14. return s
  15. }
  16. //
  17. func (s *OilSupplierService) GetMyPagingEntitiesWithOrderBytbl(supplierTableName, supplierCertTableName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where string) (total int64) {
  18. var resultsSlice []map[string][]byte
  19. //获取总记录数
  20. sqlCount := `select count(*) from ` + supplierTableName + ` a `
  21. sqlCount += ` left join ` + supplierCertTableName + " b on b.SupplierId = a.Id"
  22. sqlCount += ` where ` + where
  23. var sql string
  24. sql = `select a.*, b.Id as CertId, b.AccessCardNo, b.SupplierTypeCode, b.SupplierTypeName, b.InFlag, b.ApplyTime,b.EffectEndTime, `
  25. sql += ` b.WorkerTotal, `
  26. sql += ` b.ContractNum, `
  27. sql += ` b.UniversityNum, `
  28. sql += ` b.TechnicalNum, `
  29. sql += ` b.AboveProfNum, `
  30. sql += ` b.MiddleProfNum, `
  31. sql += ` b.NationalRegNum, `
  32. sql += ` b.NationalCertTotal, `
  33. sql += ` b.DesignerTotal, `
  34. sql += ` b.SkillerTotal, `
  35. sql += ` b.Status, `
  36. sql += ` b.WorkflowId, b.CreateOn ,b.ProcessKey,b.BusinessKey,b.BackRemark,b.IsRestrict`
  37. sql += ` from ` + supplierTableName + ` a `
  38. sql += ` left join ` + supplierCertTableName + " b on b.SupplierId = a.Id"
  39. sql += ` where ` + where
  40. if asc {
  41. sql += ` order by ` + orderby + ` ASC `
  42. } else {
  43. sql += ` order by ` + orderby + ` DESC `
  44. }
  45. if pageIndex != 0 && itemsPerPage != 0 {
  46. sql += ` limit ` + utils.ToStr((pageIndex-1)*itemsPerPage) + "," + utils.ToStr(itemsPerPage)
  47. }
  48. s.DBE.SQL(sql).Find(entitiesPtr)
  49. resultsSlice, _ = s.DBE.Query(sqlCount)
  50. if len(resultsSlice) > 0 {
  51. results := resultsSlice[0]
  52. for _, value := range results {
  53. total, _ = strconv.ParseInt(string(value), 10, 64)
  54. break
  55. }
  56. }
  57. return total
  58. }
  59. func (s *OilSupplierService) GetMyPagingEntitiesWithOrderBytbl4(supplierTableName, supplierCertTableName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where string) (total int64) {
  60. var resultsSlice []map[string][]byte
  61. //获取总记录数
  62. sqlCount := `select count(*) from ` + supplierTableName + ` a `
  63. sqlCount += ` left join ` + supplierCertTableName + " b on b.SupplierId = a.Id"
  64. sqlCount += ` where ` + where
  65. var sql string
  66. sql = `select a.*, b.Id as CertId, b.AccessCardNo, b.SupplierTypeCode, b.SupplierTypeName, b.InFlag, b.ApplyTime,b.InStyle`
  67. sql += ` from ` + supplierTableName + ` a `
  68. sql += ` left join ` + supplierCertTableName + " b on b.SupplierId = a.Id"
  69. sql += ` where ` + where
  70. if asc {
  71. sql += ` order by ` + orderby + ` ASC `
  72. } else {
  73. sql += ` order by ` + orderby + ` DESC `
  74. }
  75. if pageIndex != 0 && itemsPerPage != 0 {
  76. sql += ` limit ` + utils.ToStr((pageIndex-1)*itemsPerPage) + "," + utils.ToStr(itemsPerPage)
  77. }
  78. s.DBE.SQL(sql).Find(entitiesPtr)
  79. resultsSlice, _ = s.DBE.Query(sqlCount)
  80. if len(resultsSlice) > 0 {
  81. results := resultsSlice[0]
  82. for _, value := range results {
  83. total, _ = strconv.ParseInt(string(value), 10, 64)
  84. break
  85. }
  86. }
  87. return total
  88. }
  89. func (s *OilSupplierService) GetMyPagingEntitiesWithOrderBytbl2(supplierTableName, supplierCertTableName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where string, code string, Ids string) (total int64) {
  90. var resultsSlice []map[string][]byte
  91. //获取总记录数
  92. sqlCount := `select count(DISTINCT b.Id) from ` + supplierTableName + ` a `
  93. sqlCount += ` left join ` + supplierCertTableName + " b on b.SupplierId = a.Id"
  94. sqlCount += ` where ` + where
  95. if code != "" {
  96. sqlCount += ` and b.Id in (` + Ids + ")"
  97. }
  98. var sql string
  99. sql = `select DISTINCT b.Id as CertId, a.*, b.AccessCardNo, b.SupplierTypeCode, b.SupplierTypeName, b.InFlag, b.ApplyTime,b.EffectEndTime, `
  100. sql += ` b.WorkerTotal, `
  101. sql += ` b.ContractNum, `
  102. sql += ` b.UniversityNum, `
  103. sql += ` b.TechnicalNum, `
  104. sql += ` b.AboveProfNum, `
  105. sql += ` b.MiddleProfNum, `
  106. sql += ` b.NationalRegNum, `
  107. sql += ` b.NationalCertTotal, `
  108. sql += ` b.DesignerTotal, `
  109. sql += ` b.SkillerTotal, `
  110. sql += ` b.Status, `
  111. sql += ` b.WorkflowId, b.CreateOn ,b.ProcessKey,b.BusinessKey,b.BackRemark,b.IsRestrict,b.Remark`
  112. sql += ` from ` + supplierTableName + ` a `
  113. sql += ` left join ` + supplierCertTableName + " b on b.SupplierId = a.Id"
  114. sql += ` where ` + where
  115. if code != "" {
  116. sql += ` and b.Id in (` + Ids + ")"
  117. }
  118. if asc {
  119. sql += ` order by ` + orderby + ` ASC `
  120. } else {
  121. sql += ` order by ` + orderby + ` DESC `
  122. }
  123. if pageIndex != 0 && itemsPerPage != 0 {
  124. sql += ` limit ` + utils.ToStr((pageIndex-1)*itemsPerPage) + "," + utils.ToStr(itemsPerPage)
  125. }
  126. s.DBE.SQL(sql).Find(entitiesPtr)
  127. resultsSlice, _ = s.DBE.Query(sqlCount)
  128. if len(resultsSlice) > 0 {
  129. results := resultsSlice[0]
  130. for _, value := range results {
  131. total, _ = strconv.ParseInt(string(value), 10, 64)
  132. break
  133. }
  134. }
  135. return total
  136. }
  137. func (s *OilSupplierService) GetMyPagingEntitiesWithOrderBytbl3(supplierTableName, supplierCertTableName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where string) (total int64) {
  138. var resultsSlice []map[string][]byte
  139. //获取总记录数
  140. sqlCount := `select count(DISTINCT b.Id) from ` + supplierTableName + ` a `
  141. sqlCount += ` left join ` + supplierCertTableName + " b on b.SupplierId = a.Id"
  142. sqlCount += ` left join OilSupplierCertSub c on c.SupplierCertId = b.Id`
  143. sqlCount += ` where ` + where
  144. var sql string
  145. sql = `select DISTINCT b.Id as CertId, a.*, b.AccessCardNo, b.SupplierTypeCode, b.SupplierTypeName, b.InFlag, b.ApplyTime,b.EffectEndTime, `
  146. sql += ` b.WorkerTotal, `
  147. sql += ` b.ContractNum, `
  148. sql += ` b.UniversityNum, `
  149. sql += ` b.TechnicalNum, `
  150. sql += ` b.AboveProfNum, `
  151. sql += ` b.MiddleProfNum, `
  152. sql += ` b.NationalRegNum, `
  153. sql += ` b.NationalCertTotal, `
  154. sql += ` b.DesignerTotal, `
  155. sql += ` b.SkillerTotal, `
  156. sql += ` b.Status, `
  157. sql += ` b.RecUnitName, `
  158. sql += ` GROUP_CONCAT(CONCAT(c.Code, ':', c.Name)) as CodeName, `
  159. sql += ` b.WorkflowId, b.CreateOn ,b.ProcessKey,b.BusinessKey,b.BackRemark,b.IsRestrict,b.Remark`
  160. sql += ` from ` + supplierTableName + ` a `
  161. sql += ` left join ` + supplierCertTableName + " b on b.SupplierId = a.Id"
  162. sql += ` left join OilSupplierCertSub c on c.SupplierCertId = b.Id`
  163. sql += ` where ` + where
  164. sql += ` GROUP BY a.Id,b.Id`
  165. if asc {
  166. sql += ` order by ` + orderby + ` ASC `
  167. } else {
  168. sql += ` order by ` + orderby + ` DESC `
  169. }
  170. if pageIndex != 0 && itemsPerPage != 0 {
  171. sql += ` limit ` + utils.ToStr((pageIndex-1)*itemsPerPage) + "," + utils.ToStr(itemsPerPage)
  172. }
  173. s.DBE.SQL(sql).Find(entitiesPtr)
  174. resultsSlice, _ = s.DBE.Query(sqlCount)
  175. if len(resultsSlice) > 0 {
  176. results := resultsSlice[0]
  177. for _, value := range results {
  178. total, _ = strconv.ParseInt(string(value), 10, 64)
  179. break
  180. }
  181. }
  182. return total
  183. }
  184. func (s *OilSupplierService) CheckRepeatApplyInfo(supplierTableName, supplierCertTableName, typeCode, SupplierName, CommercialNo, OrganCode, BankAccount, CompanyUrl string, entitiesPtr interface{}) {
  185. //获取分页信息
  186. where2 := " b.SupplierTypeCode = '" + typeCode
  187. where := ""
  188. if SupplierName != "" {
  189. where = where + " or a.SupplierName = '" + SupplierName + "'"
  190. }
  191. if CommercialNo != "" {
  192. where = where + " or a.CommercialNo = '" + CommercialNo + "'"
  193. }
  194. if OrganCode != "" {
  195. where = where + " or a.OrganCode = '" + OrganCode + "'"
  196. }
  197. if BankAccount != "" {
  198. where = where + " or a.BankAccount = '" + BankAccount + "'"
  199. }
  200. if CompanyUrl != "" {
  201. where = where + " or a.CompanyUrl = '" + CompanyUrl + "'"
  202. }
  203. if len(where) > 0 {
  204. where2 += " and (1=0 " + where + ")"
  205. var sql string
  206. sql = `select a.*, b.Id as CertId, b.AccessCardNo, b.SupplierTypeCode, b.SupplierTypeName, `
  207. sql += ` b.WorkerTotal, `
  208. sql += ` b.ContractNum, `
  209. sql += ` b.UniversityNum, `
  210. sql += ` b.TechnicalNum, `
  211. sql += ` b.AboveProfNum, `
  212. sql += ` b.MiddleProfNum, `
  213. sql += ` b.NationalRegNum, `
  214. sql += ` b.NationalCertTotal, `
  215. sql += ` b.DesignerTotal, `
  216. sql += ` b.SkillerTotal, `
  217. sql += ` b.Status, `
  218. sql += ` b.WorkflowId `
  219. sql += ` from ` + supplierTableName + ` a `
  220. sql += ` right join ` + supplierCertTableName + " b on b.SupplierId = a.Id"
  221. sql += ` where ` + where2
  222. s.DBE.SQL(sql).Find(entitiesPtr)
  223. }
  224. }
  225. func (s *OilSupplierService) CheckUpdateRepeatApplyInfo(supplierTableName, supplierCertTableName, typeCode, supplierId, SupplierName, CommercialNo, OrganCode, BankAccount, CompanyUrl string, entitiesPtr interface{}) {
  226. //获取分页信息
  227. where2 := " a.Id != '" + supplierId + "'"
  228. where := ""
  229. if SupplierName != "" {
  230. where = where + " or a.SupplierName = '" + SupplierName + "'"
  231. }
  232. if CommercialNo != "" {
  233. where = where + " or a.CommercialNo = '" + CommercialNo + "'"
  234. }
  235. if OrganCode != "" {
  236. where = where + " or a.OrganCode = '" + OrganCode + "'"
  237. }
  238. if BankAccount != "" {
  239. where = where + " or a.BankAccount = '" + BankAccount + "'"
  240. }
  241. if CompanyUrl != "" {
  242. where = where + " or a.CompanyUrl = '" + CompanyUrl + "'"
  243. }
  244. if len(where) > 0 {
  245. where2 += " and (1=0 " + where + ")"
  246. var sql string
  247. sql = `select a.*, b.Id as CertId, b.AccessCardNo, b.SupplierTypeCode, b.SupplierTypeName, `
  248. sql += ` b.WorkerTotal, `
  249. sql += ` b.ContractNum, `
  250. sql += ` b.UniversityNum, `
  251. sql += ` b.TechnicalNum, `
  252. sql += ` b.AboveProfNum, `
  253. sql += ` b.MiddleProfNum, `
  254. sql += ` b.NationalRegNum, `
  255. sql += ` b.NationalCertTotal, `
  256. sql += ` b.DesignerTotal, `
  257. sql += ` b.SkillerTotal, `
  258. sql += ` b.Status, `
  259. sql += ` b.WorkflowId `
  260. sql += ` from ` + supplierTableName + ` a `
  261. sql += ` right join ` + supplierCertTableName + " b on b.SupplierId = a.Id"
  262. sql += ` where ` + where2
  263. s.DBE.SQL(sql).Find(entitiesPtr)
  264. }
  265. }
  266. func (s *OilSupplierService) CanUpdateSupplier(oilSupplierCertTableName string, supplierId int, typeCode string) bool {
  267. session := s.DBE.NewSession()
  268. sessionSvc := GetOilSupplierSession(session)
  269. defer session.Close()
  270. session.Begin()
  271. result := sessionSvc.CanUpdateSupplier(oilSupplierCertTableName, supplierId, typeCode)
  272. session.Commit()
  273. return result
  274. }
  275. func (s *OilSupplierService) GetUpdateCols(oilSupplierCertTableName string, supplierTypeCode string, supplierId int) []string {
  276. session := s.DBE.NewSession()
  277. sessionSvc := GetOilSupplierSession(session)
  278. defer session.Close()
  279. session.Begin()
  280. cols := sessionSvc.GetUpdateCols(oilSupplierCertTableName, supplierTypeCode, supplierId)
  281. session.Commit()
  282. return cols
  283. }
  284. func (s *OilSupplierService) GetProOrTreeList(ids string, entitiesPtr interface{}) {
  285. where := " Id in (" + ids + ")"
  286. sql := "SELECT Id, FullName, ParentId FROM Base_Organize where " + where
  287. s.DBE.SQL(sql).Find(entitiesPtr)
  288. return
  289. }
  290. func (s *OilSupplierService) GetMyTodoEntitie(supplierTableName, supplierCertTableName string, entitiesPtr interface{}, where string) bool {
  291. var sql string
  292. sql = `select a.Id, a.SupplierName, b.Id as CertId, b.SupplierTypeCode, '1' as Type, b.Status `
  293. sql += ` from ` + supplierTableName + ` a `
  294. sql += ` left join ` + supplierCertTableName + " b on b.SupplierId = a.Id"
  295. sql += ` where ` + where
  296. has, _ := s.DBE.SQL(sql).Get(entitiesPtr)
  297. return has
  298. }
  299. func (s *OilSupplierService) GetExpireFile(supplierTableName, supplierFileTableName string, entitiesPtr interface{}, where string) error {
  300. var sql string
  301. sql = `SELECT a.Id, a.SupplierName, a.Mobile, a.CreateBy, a.ContactName, a.CreateUserId, GROUP_CONCAT(b.NeedFileType SEPARATOR ';' ) NeedAllFile `
  302. sql += ` FROM ` + supplierTableName + ` a `
  303. sql += ` left join ` + supplierFileTableName + " b ON a.Id=b.SupplierId "
  304. sql += ` where ` + where
  305. sql += ` GROUP BY a.Id, a.SupplierName, a.Mobile `
  306. err := s.DBE.SQL(sql).Find(entitiesPtr)
  307. return err
  308. }
  309. func (s *OilSupplierService) GetExpireFileList(supplierTableName, supplierFileTableName string, entitiesPtr interface{}, where string) error {
  310. var sql string
  311. sql = `SELECT a.Id, a.SupplierName, a.Mobile, b.SupplierTypeCode`
  312. sql += ` FROM ` + supplierTableName + ` a `
  313. sql += ` left join ` + supplierFileTableName + " b ON a.Id=b.SupplierId "
  314. sql += ` where ` + where
  315. sql += ` GROUP BY a.Id, a.SupplierName, a.Mobile, b.SupplierTypeCode `
  316. err := s.DBE.SQL(sql).Find(entitiesPtr)
  317. return err
  318. }
  319. func (s *OilSupplierService) GetInterfaceData(supplierTableName, supplierFileTableName string, entitiesPtr interface{}, where string) error {
  320. var sql string
  321. sql = `SELECT a.Id, a.SupplierName, a.RegCapital, GROUP_CONCAT(b.NeedFileType SEPARATOR ';' ) NeedAllFile `
  322. sql += ` FROM ` + supplierTableName + ` a `
  323. sql += ` left join ` + supplierFileTableName + " b ON a.Id=b.SupplierId "
  324. sql += ` where ` + where
  325. sql += ` GROUP BY a.Id, a.SupplierName, a.Mobile `
  326. err := s.DBE.SQL(sql).Find(entitiesPtr)
  327. return err
  328. }
  329. func (s *OilSupplierService) GetProcessInfoWithOrderBytbl(supplierTableName, supplierCertTableName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where string) (total int64) {
  330. var resultsSlice []map[string][]byte
  331. //获取总记录数
  332. sqlCount := `select count(*) from ` + supplierTableName + ` a `
  333. sqlCount += ` left join ` + supplierCertTableName + ` b on b.SupplierId = a.Id`
  334. sqlCount += ` Left join Base_User u on a.CreateUserId = u.Id `
  335. sqlCount += ` LEFT JOIN Base_Organize org ON b.CommitComId = org.Id`
  336. sqlCount += ` where ` + where
  337. var sql string
  338. sql = `select a.Id as SupplierId, a.SupplierName, b.Id, b.AccessCardNo, b.CreateOn, b.ModifiedOn As AddinTime, a.Mobile, `
  339. sql += ` b.Status, b.SupplierTypeCode, `
  340. sql += ` b.WorkflowId, b.ProcessKey, '1' as Type, b.CreateOn,`
  341. sql += ` org.FullName As RecUnitName,`
  342. sql += ` u.Realname as ContactName,`
  343. sql += ` u.Telephone as Mobile`
  344. sql += ` from ` + supplierTableName + ` a `
  345. sql += ` left join ` + supplierCertTableName + ` b on b.SupplierId = a.Id`
  346. sql += ` Left join Base_User u on b.CreateUserId = u.Id `
  347. sql += ` LEFT JOIN Base_Organize org ON b.CommitComId = org.Id`
  348. sql += ` where ` + where
  349. sql += ` group by b.Id`
  350. if asc {
  351. sql += ` order by ` + orderby + ` ASC `
  352. } else {
  353. sql += ` order by ` + orderby + ` DESC `
  354. }
  355. if pageIndex != 0 && itemsPerPage != 0 {
  356. sql += ` limit ` + utils.ToStr((pageIndex-1)*itemsPerPage) + "," + utils.ToStr(itemsPerPage)
  357. }
  358. s.DBE.SQL(sql).Find(entitiesPtr)
  359. resultsSlice, _ = s.DBE.Query(sqlCount)
  360. if len(resultsSlice) > 0 {
  361. results := resultsSlice[0]
  362. for _, value := range results {
  363. total, _ = strconv.ParseInt(string(value), 10, 64)
  364. break
  365. }
  366. }
  367. return total
  368. }
  369. func (s *OilSupplierService) GetCertIds(entitiesPtr interface{}, where string) {
  370. sql := "SELECT GROUP_CONCAT(DISTINCT SupplierCertId) as Ids from OilSupplierCertSub where " + where + " ORDER BY SupplierCertId"
  371. s.DBE.SQL(sql).Get(entitiesPtr)
  372. }
  373. func (s *OilSupplierService) ConverseSupplierTypeToInt(typeCode string) (typeInt int) {
  374. if typeCode == "01" {
  375. typeInt = 1
  376. }else if typeCode == "02" {
  377. typeInt = 2
  378. } else if typeCode == "03" {
  379. typeInt = 3
  380. } else if typeCode == "4" {
  381. typeInt = 4
  382. } else if typeCode == "5" {
  383. typeInt = 5
  384. } else if typeCode == "8" {
  385. typeInt = 8
  386. } else if typeCode == "9" || typeCode == "9-6" || typeCode == "9-7" {
  387. typeInt = 9
  388. } else if typeCode == "10" {
  389. typeInt = 10
  390. } else if typeCode == "11" {
  391. typeInt = 11
  392. } else if typeCode == "12" {
  393. typeInt = 12
  394. } else {
  395. typeInt = 0
  396. }
  397. return typeInt
  398. }
  399. func (s *OilSupplierService) GetDeleteSub(TableName, where string , entitiesPtr interface{}) {
  400. //var resultsSlice []map[string][]byte
  401. //获取总记录数
  402. //sqlCount := `select count(*) from OilSupplierCertSub a `
  403. //if TableName == "OilBasisBuild" {
  404. // sqlCount += ` left join ` + TableName + ` b on b.Id = a.SubClassId`
  405. //} else {
  406. // sqlCount += ` left join ` + TableName + ` b on b.ClassId = a.SubClassId`
  407. //}
  408. //sqlCount += ` where ` + where
  409. sql := `update OilSupplierCertSub a `
  410. if TableName == "OilBasisBuild" {
  411. sql += ` left join ` + TableName + ` b on b.Id = a.SubClassId`
  412. } else {
  413. sql += ` left join ` + TableName + ` b on b.ClassId = a.SubClassId`
  414. }
  415. sql += ` set IsQuestion = 1 where IsQuestion = 0 and ` + where
  416. s.DBE.SQL(sql).Find(entitiesPtr)
  417. //resultsSlice, _ = s.DBE.Query(sqlCount)
  418. //if len(resultsSlice) > 0 {
  419. // results := resultsSlice[0]
  420. // for _, value := range results {
  421. // total, _ = strconv.ParseInt(string(value), 10, 64)
  422. // break
  423. // }
  424. //}
  425. //return total
  426. }
  427. func (s *OilSupplierService) GetDeleteSub2(TableName, where string , entitiesPtr interface{}, name string) {
  428. sql := `update OilSupplierCertSub a `
  429. if TableName == "OilBasisBuild" {
  430. sql += ` left join ` + TableName + ` b on b.Id = a.SubClassId`
  431. } else {
  432. sql += ` left join ` + TableName + ` b on b.ClassId = a.SubClassId`
  433. }
  434. sql += " set IsQuestion = 2, LackFile = concat(IFNULL(LackFile,''),',','" + name + "') where IsQuestion != 2 and " + where
  435. s.DBE.SQL(sql).Find(entitiesPtr)
  436. }