KwsEnterpriseDao.xml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.sckw.system.dao.KwsEnterpriseDao">
  4. <resultMap id="BaseResultMap" type="com.sckw.system.model.KwsEnterprise">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="firm_name" jdbcType="VARCHAR" property="firmName" />
  7. <result column="code" jdbcType="VARCHAR" property="code" />
  8. <result column="contacts" jdbcType="VARCHAR" property="contacts" />
  9. <result column="phone" jdbcType="VARCHAR" property="phone" />
  10. <result column="legal_name" jdbcType="VARCHAR" property="legalName" />
  11. <result column="legal_phone" jdbcType="VARCHAR" property="legalPhone" />
  12. <result column="head" jdbcType="VARCHAR" property="head" />
  13. <result column="integral" jdbcType="INTEGER" property="integral" />
  14. <result column="balance" jdbcType="DECIMAL" property="balance" />
  15. <result column="experience" jdbcType="INTEGER" property="experience" />
  16. <result column="member_level" jdbcType="INTEGER" property="memberLevel" />
  17. <result column="reg_time" jdbcType="TIMESTAMP" property="regTime" />
  18. <result column="reg_source" jdbcType="VARCHAR" property="regSource" />
  19. <result column="org_code" jdbcType="VARCHAR" property="orgCode" />
  20. <result column="city_code" jdbcType="INTEGER" property="cityCode" />
  21. <result column="detail_address" jdbcType="VARCHAR" property="detailAddress" />
  22. <result column="city_name" jdbcType="VARCHAR" property="cityName" />
  23. <result column="lat" jdbcType="VARCHAR" property="lat" />
  24. <result column="lng" jdbcType="VARCHAR" property="lng" />
  25. <result column="approval" jdbcType="INTEGER" property="approval" />
  26. <result column="approval_time" jdbcType="TIMESTAMP" property="approvalTime" />
  27. <result column="manager" jdbcType="BIGINT" property="manager" />
  28. <result column="remark" jdbcType="VARCHAR" property="remark" />
  29. <result column="status" jdbcType="INTEGER" property="status" />
  30. <result column="create_by" jdbcType="BIGINT" property="createBy" />
  31. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  32. <result column="update_by" jdbcType="BIGINT" property="updateBy" />
  33. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  34. <result column="del_flag" jdbcType="INTEGER" property="delFlag" />
  35. <result column="website" jdbcType="VARCHAR" property="website" />
  36. <result column="business" jdbcType="VARCHAR" property="business" />
  37. </resultMap>
  38. <sql id="Base_Column_List">
  39. id, firm_name, code, contacts, phone, legal_name, legal_phone, head, integral,
  40. balance, experience, member_level, reg_time, reg_source, org_code, city_code, detail_address,
  41. lat, lng, approval, approval_time, manager, remark, status, create_by, create_time,
  42. update_by, update_time, del_flag,city_name, website, business
  43. </sql>
  44. <select id="selectByKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  45. select
  46. <include refid="Base_Column_List" />
  47. from kws_enterprise
  48. where id = #{id,jdbcType=BIGINT}
  49. </select>
  50. <select id="findPojo" resultType="com.sckw.system.model.pojo.FindEntListPojo" parameterType="com.sckw.system.model.pojo.FindPojoParam">
  51. select tab.*,
  52. case when tab.id in (select ent_id from kws_ent_dep) then '子单位' else '主单位' end entDept,
  53. case when tab.status = 0 then '正常' else '冻结' end statusName
  54. from
  55. (
  56. select a.id,
  57. min(a.firm_name) firm_name,
  58. min(a.code) code,
  59. min(a.contacts) contacts,
  60. min(a.phone) phone,
  61. min(a.legal_name) legal_name,
  62. min(a.legal_phone) legal_phone,
  63. min(a.head) head,
  64. min(a.integral) integral,
  65. min(a.balance) balance,
  66. min(a.experience) experience,
  67. min(a.member_level) member_level,
  68. min(a.reg_time) reg_time,
  69. min(a.reg_source) reg_source,
  70. min(a.org_code) org_code,
  71. min(a.city_code) city_code,
  72. min(a.detail_address) detail_address,
  73. min(a.lat) lat,
  74. min(a.lng) lng,
  75. min(a.approval) approval,
  76. min(a.approval_time) approval_time,
  77. min(a.manager) manager,
  78. min(a.remark) remark,
  79. min(a.status) status,
  80. min(a.create_by) create_by,
  81. min(a.create_time) create_time,
  82. min(a.update_by) update_by,
  83. min(a.update_time) update_time,
  84. min(a.del_flag) del_flag,
  85. ifnull(GROUP_CONCAT(distinct b.type), '') type,
  86. min(k.system_type) system_type,
  87. min(k.name) createByName,
  88. min(ku.name) updateByName,
  89. min(d.id) pid,
  90. min(d.firm_name) pEntName
  91. from kws_enterprise a
  92. left join kws_user k on a.create_by = k.id
  93. left join kws_user ku on a.update_by = ku.id
  94. left join kws_ent_type b on a.id = b.ent_id and b.del_flag = 0
  95. left join kws_ent_dep c on a.id = c.ent_id
  96. left join kws_enterprise d on c.ent_pid = d.id
  97. where a.del_flag = 0
  98. <if test="dto.typeList != null and dto.typeList.size() > 0">
  99. and exists (select 1
  100. from kws_ent_type kt
  101. where a.id = kt.ent_id
  102. and kt.del_flag = 0
  103. and kt.type in
  104. <foreach collection="dto.typeList" item="item" open="(" close=")" separator=",">
  105. #{item}
  106. </foreach>
  107. )
  108. </if>
  109. <choose>
  110. <when test="dto.approval != null and dto.approval == 3">
  111. and a.approval in (3,4)
  112. </when>
  113. <when test="dto.approval != null and dto.approval != 3">
  114. and a.approval = #{dto.approval}
  115. </when>
  116. </choose>
  117. <if test="dto.customer != null and dto.customer == 1">
  118. and a.approval in (1, 4)
  119. </if>
  120. <if test="dto.keywords != null">
  121. and (a.contacts like concat('%', #{dto.keywords}, '%') or a.phone like concat('%', #{dto.keywords}, '%') or a.firm_name like concat('%', #{dto.keywords}, '%'))
  122. </if>
  123. <if test="dto.startTime != null">
  124. and a.reg_time >= #{dto.startTime}
  125. </if>
  126. <if test="dto.endTime != null">
  127. and a.reg_time &lt;= #{dto.endTime}
  128. </if>
  129. <if test="dto.approvalStartTime != null">
  130. and a.approval_time >= #{dto.approvalStartTime}
  131. </if>
  132. <if test="dto.approvalEndTime != null">
  133. and a.approval_time &lt; date_add(#{dto.approvalEndTime}, INTERVAL 1 DAY)
  134. </if>
  135. <if test="dto.status != null and dto.status != ''">
  136. and a.status = #{dto.status}
  137. </if>
  138. <if test="dto.entryType != null and dto.entryType == 1">
  139. and k.system_type = 2
  140. </if>
  141. <if test="dto.entryType != null and dto.entryType == 2">
  142. and k.system_type = 1
  143. </if>
  144. <choose>
  145. <when test="dto.entDept != null and dto.entDept == 0">
  146. and not exists (
  147. select 1
  148. from kws_ent_dep dep
  149. where a.id = dep.ent_id
  150. <if test="dto.entId != null">
  151. and dep.ent_pid = #{dto.entId}
  152. </if>
  153. )
  154. </when>
  155. <when test="dto.entDept != null and dto.entDept == 1">
  156. and exists (
  157. select 1 from kws_ent_dep dep
  158. where a.id = dep.ent_id
  159. <if test="dto.entId != null">
  160. and dep.ent_pid = #{dto.entId}
  161. </if>)
  162. </when>
  163. </choose>
  164. group by a.id
  165. ) tab
  166. where tab.id is not null
  167. order by tab.create_time desc
  168. </select>
  169. <select id="findList" resultType="com.sckw.system.model.vo.res.FindEntListResVo" parameterType="com.sckw.system.model.vo.req.FindListReqVo">
  170. select a.*,
  171. b.id userId,
  172. b.account,
  173. b.name
  174. from kws_enterprise a
  175. left join kws_user b on a.phone = b.account and b.del_flag = 0
  176. where a.del_flag = 0
  177. <if test="approval != null">
  178. and a.approval = #{approval}
  179. </if>
  180. <if test="entName != null and entName != ''">
  181. and a.firm_name like concat('%', #{entName}, '%')
  182. </if>
  183. <if test="entType != null">
  184. and exists (select 1 from kws_ent_type b where a.id = b.ent_id and b.type = #{entType})
  185. </if>
  186. order by a.create_time
  187. </select>
  188. <select id="findByUserId" resultType="com.sckw.system.model.KwsEnterprise">
  189. select distinct a.*
  190. from kws_enterprise a
  191. inner join kws_dept b on a.id = b.ent_id
  192. inner join kws_user_dept c on b.id = c.dept_id
  193. inner join kws_user d on c.user_id = d.id
  194. where d.id = #{id}
  195. and a.del_flag = 0
  196. and b.del_flag = 0
  197. and c.del_flag = 0
  198. and d.del_flag = 0
  199. and a.status = 0
  200. and b.status = 0
  201. and c.status = 0
  202. and d.status = 0
  203. </select>
  204. <select id="selectByKeys" resultType="com.sckw.system.model.KwsEnterprise">
  205. select
  206. <include refid="Base_Column_List" />
  207. from kws_enterprise
  208. where del_flag = 0
  209. and approval = 1
  210. <if test="list != null and list.size() > 0">
  211. and id in
  212. <foreach collection="list" item="item" open="(" close=")" separator=",">
  213. #{item}
  214. </foreach>
  215. </if>
  216. </select>
  217. <select id="findUserByEntIds" resultType="com.sckw.system.model.pojo.FindEntUserPojo">
  218. select distinct a.id entId,
  219. a.firm_name entName,
  220. d.id userId,
  221. d.name,
  222. d.account,
  223. d.phone,
  224. f.name roleName
  225. from kws_enterprise a
  226. left join kws_dept b on a.id = b.ent_id
  227. left join kws_user_dept c on b.id = c.dept_id
  228. left join kws_user d on c.user_id = d.id
  229. left join kws_user_role e on d.id = e.user_id
  230. left join kws_role f on e.role_id = f.id
  231. where a.del_flag = 0
  232. and b.del_flag = 0
  233. and c.del_flag = 0
  234. and d.del_flag = 0
  235. and f.del_flag = 0
  236. and a.id in
  237. <foreach collection="list" separator="," open="(" close=")" item="item">
  238. #{item}
  239. </foreach>
  240. </select>
  241. <select id="findManageInfoByEntId" resultType="com.sckw.system.model.pojo.FindManagePojo">
  242. select distinct d.id userId,
  243. b.id deptId,
  244. f.id roleId,
  245. a.id entId
  246. from kws_enterprise a
  247. left join kws_dept b on a.id = b.ent_id
  248. left join kws_user_dept c on b.id = c.dept_id
  249. left join kws_user d on c.user_id = d.id
  250. left join kws_user_role e on d.id = e.user_id
  251. left join kws_role f on e.role_id = f.id
  252. where a.del_flag = 0
  253. and b.del_flag = 0
  254. and c.del_flag = 0
  255. and d.del_flag = 0
  256. and e.del_flag = 0
  257. and f.del_flag = 0
  258. and d.is_main = 1
  259. and a.id = #{entId}
  260. </select>
  261. <select id="findManageInfoByEntIdBeforeApproval" resultType="com.sckw.system.model.pojo.FindManagePojo">
  262. select distinct d.id userId,
  263. f.id roleId
  264. from kws_enterprise a
  265. left join kws_dept b on a.id = b.ent_id
  266. LEFT JOIN kws_user d ON a.phone = d.account
  267. left join kws_role f on b.id = f.dept_id
  268. where a.del_flag = 0
  269. and b.del_flag = 0
  270. and d.del_flag = 0
  271. and f.del_flag = 0
  272. and d.is_main = 1
  273. and d.system_type = 2
  274. and a.id = #{entId}
  275. </select>
  276. <select id="queryEntByName" resultType="com.sckw.system.model.KwsEnterprise">
  277. select * from kws_enterprise where firm_name like concat('%', #{entName}, '%') and del_flag = 0
  278. </select>
  279. <select id="checkEntRepeat" resultType="com.sckw.system.model.KwsEnterprise">
  280. select * from kws_enterprise where (
  281. firm_name = #{entName}
  282. <if test="phone != null and phone != ''">
  283. or phone = #{phone}
  284. </if>
  285. )
  286. and del_flag = 0 and approval in (1,3,4)
  287. </select>
  288. <select id="selectAllByKeys" resultType="com.sckw.system.model.KwsEnterprise">
  289. select
  290. <include refid="Base_Column_List" />
  291. from kws_enterprise
  292. where del_flag = 0
  293. <if test="list != null and list.size() > 0">
  294. and id in
  295. <foreach collection="list" item="item" open="(" close=")" separator=",">
  296. #{item}
  297. </foreach>
  298. </if>
  299. </select>
  300. <select id="queryEntInfoByCityCodeAndEntTypesWithPage" resultType="com.sckw.system.model.KwsEnterprise">
  301. SELECT a.*
  302. FROM kws_enterprise a
  303. LEFT JOIN sys_area b ON a.city_code = b.CODE
  304. where 1 = 1
  305. <if test="cityCode != null">
  306. and (b.code = #{cityCode} or b.province_code = #{cityCode} or b.pcode = #{cityCode})
  307. </if>
  308. <if test="entIdList != null and entIdList.size() > 0">
  309. and a.id in
  310. <foreach collection="entIdList" item="item" open="(" close=")" separator=",">
  311. #{item}
  312. </foreach>
  313. </if>
  314. <if test="entName != null and entName != ''">
  315. and a.firm_name like concat('%', #{entName}, '%')
  316. </if>
  317. and exists (select 1
  318. from kws_ent_type k
  319. where a.id = k.ent_id
  320. and k.type in
  321. <foreach collection="entTypeList" open="(" close=")" separator="," item="item">
  322. #{item}
  323. </foreach>
  324. )
  325. </select>
  326. <select id="findManageInfoByEntIds" resultType="com.sckw.system.model.pojo.FindManagePojo">
  327. select distinct d.id userId,
  328. b.id deptId,
  329. f.id roleId,
  330. a.id entId
  331. from kws_enterprise a
  332. left join kws_dept b on a.id = b.ent_id
  333. left join kws_user_dept c on b.id = c.dept_id
  334. left join kws_user d on c.user_id = d.id
  335. left join kws_user_role e on d.id = e.user_id
  336. left join kws_role f on e.role_id = f.id
  337. where a.del_flag = 0
  338. and b.del_flag = 0
  339. and c.del_flag = 0
  340. and d.del_flag = 0
  341. and e.del_flag = 0
  342. and f.del_flag = 0
  343. and d.is_main = 1
  344. and d.system_type = 2
  345. and a.id in
  346. <foreach collection="list" separator="," open="(" close=")" item="item">
  347. #{item}
  348. </foreach>
  349. </select>
  350. <insert id="insert" parameterType="com.sckw.system.model.KwsEnterprise">
  351. insert into kws_enterprise
  352. <trim prefix="(" suffix=")" suffixOverrides=",">
  353. <if test="id != null">
  354. id,
  355. </if>
  356. <if test="firmName != null">
  357. firm_name,
  358. </if>
  359. <if test="code != null">
  360. code,
  361. </if>
  362. <if test="contacts != null">
  363. contacts,
  364. </if>
  365. <if test="phone != null">
  366. phone,
  367. </if>
  368. <if test="legalName != null">
  369. legal_name,
  370. </if>
  371. <if test="legalPhone != null">
  372. legal_phone,
  373. </if>
  374. <if test="head != null">
  375. head,
  376. </if>
  377. <if test="integral != null">
  378. integral,
  379. </if>
  380. <if test="balance != null">
  381. balance,
  382. </if>
  383. <if test="experience != null">
  384. experience,
  385. </if>
  386. <if test="memberLevel != null">
  387. member_level,
  388. </if>
  389. <if test="regTime != null">
  390. reg_time,
  391. </if>
  392. <if test="regSource != null">
  393. reg_source,
  394. </if>
  395. <if test="orgCode != null">
  396. org_code,
  397. </if>
  398. <if test="cityCode != null">
  399. city_code,
  400. </if>
  401. <if test="detailAddress != null">
  402. detail_address,
  403. </if>
  404. <if test="lat != null">
  405. lat,
  406. </if>
  407. <if test="lng != null">
  408. lng,
  409. </if>
  410. <if test="approval != null">
  411. approval,
  412. </if>
  413. <if test="approvalTime != null">
  414. approval_time,
  415. </if>
  416. <if test="manager != null">
  417. manager,
  418. </if>
  419. <if test="remark != null">
  420. remark,
  421. </if>
  422. <if test="status != null">
  423. status,
  424. </if>
  425. <if test="createBy != null">
  426. create_by,
  427. </if>
  428. <if test="createTime != null">
  429. create_time,
  430. </if>
  431. <if test="updateBy != null">
  432. update_by,
  433. </if>
  434. <if test="updateTime != null">
  435. update_time,
  436. </if>
  437. <if test="delFlag != null">
  438. del_flag,
  439. </if>
  440. </trim>
  441. <trim prefix="values (" suffix=")" suffixOverrides=",">
  442. <if test="id != null">
  443. #{id,jdbcType=BIGINT},
  444. </if>
  445. <if test="firmName != null">
  446. #{firmName,jdbcType=VARCHAR},
  447. </if>
  448. <if test="code != null">
  449. #{code,jdbcType=VARCHAR},
  450. </if>
  451. <if test="contacts != null">
  452. #{contacts,jdbcType=VARCHAR},
  453. </if>
  454. <if test="phone != null">
  455. #{phone,jdbcType=VARCHAR},
  456. </if>
  457. <if test="legalName != null">
  458. #{legalName,jdbcType=VARCHAR},
  459. </if>
  460. <if test="legalPhone != null">
  461. #{legalPhone,jdbcType=VARCHAR},
  462. </if>
  463. <if test="head != null">
  464. #{head,jdbcType=VARCHAR},
  465. </if>
  466. <if test="integral != null">
  467. #{integral,jdbcType=INTEGER},
  468. </if>
  469. <if test="balance != null">
  470. #{balance,jdbcType=DECIMAL},
  471. </if>
  472. <if test="experience != null">
  473. #{experience,jdbcType=INTEGER},
  474. </if>
  475. <if test="memberLevel != null">
  476. #{memberLevel,jdbcType=INTEGER},
  477. </if>
  478. <if test="regTime != null">
  479. #{regTime,jdbcType=TIMESTAMP},
  480. </if>
  481. <if test="regSource != null">
  482. #{regSource,jdbcType=VARCHAR},
  483. </if>
  484. <if test="orgCode != null">
  485. #{orgCode,jdbcType=VARCHAR},
  486. </if>
  487. <if test="cityCode != null">
  488. #{cityCode,jdbcType=INTEGER},
  489. </if>
  490. <if test="detailAddress != null">
  491. #{detailAddress,jdbcType=VARCHAR},
  492. </if>
  493. <if test="lat != null">
  494. #{lat,jdbcType=VARCHAR},
  495. </if>
  496. <if test="lng != null">
  497. #{lng,jdbcType=VARCHAR},
  498. </if>
  499. <if test="approval != null">
  500. #{approval,jdbcType=INTEGER},
  501. </if>
  502. <if test="approvalTime != null">
  503. #{approvalTime,jdbcType=TIMESTAMP},
  504. </if>
  505. <if test="manager != null">
  506. #{manager,jdbcType=BIGINT},
  507. </if>
  508. <if test="remark != null">
  509. #{remark,jdbcType=VARCHAR},
  510. </if>
  511. <if test="status != null">
  512. #{status,jdbcType=INTEGER},
  513. </if>
  514. <if test="createBy != null">
  515. #{createBy,jdbcType=BIGINT},
  516. </if>
  517. <if test="createTime != null">
  518. #{createTime,jdbcType=TIMESTAMP},
  519. </if>
  520. <if test="updateBy != null">
  521. #{updateBy,jdbcType=BIGINT},
  522. </if>
  523. <if test="updateTime != null">
  524. #{updateTime,jdbcType=TIMESTAMP},
  525. </if>
  526. <if test="delFlag != null">
  527. #{delFlag,jdbcType=INTEGER},
  528. </if>
  529. </trim>
  530. </insert>
  531. <update id="update" parameterType="com.sckw.system.model.KwsEnterprise">
  532. update kws_enterprise
  533. <set>
  534. <if test="firmName != null">
  535. firm_name = #{firmName,jdbcType=VARCHAR},
  536. </if>
  537. <if test="code != null">
  538. code = #{code,jdbcType=VARCHAR},
  539. </if>
  540. <if test="contacts != null">
  541. contacts = #{contacts,jdbcType=VARCHAR},
  542. </if>
  543. <if test="phone != null">
  544. phone = #{phone,jdbcType=VARCHAR},
  545. </if>
  546. <if test="legalName != null">
  547. legal_name = #{legalName,jdbcType=VARCHAR},
  548. </if>
  549. <if test="legalPhone != null">
  550. legal_phone = #{legalPhone,jdbcType=VARCHAR},
  551. </if>
  552. <if test="head != null">
  553. head = #{head,jdbcType=VARCHAR},
  554. </if>
  555. <if test="integral != null">
  556. integral = #{integral,jdbcType=INTEGER},
  557. </if>
  558. <if test="balance != null">
  559. balance = #{balance,jdbcType=DECIMAL},
  560. </if>
  561. <if test="experience != null">
  562. experience = #{experience,jdbcType=INTEGER},
  563. </if>
  564. <if test="memberLevel != null">
  565. member_level = #{memberLevel,jdbcType=INTEGER},
  566. </if>
  567. <if test="regTime != null">
  568. reg_time = #{regTime,jdbcType=TIMESTAMP},
  569. </if>
  570. <if test="regSource != null">
  571. reg_source = #{regSource,jdbcType=VARCHAR},
  572. </if>
  573. <if test="orgCode != null">
  574. org_code = #{orgCode,jdbcType=VARCHAR},
  575. </if>
  576. <if test="cityCode != null">
  577. city_code = #{cityCode,jdbcType=INTEGER},
  578. </if>
  579. <if test="cityName != null">
  580. city_name = #{cityName,jdbcType=VARCHAR},
  581. </if>
  582. <if test="detailAddress != null">
  583. detail_address = #{detailAddress,jdbcType=VARCHAR},
  584. </if>
  585. <if test="lat != null">
  586. lat = #{lat,jdbcType=VARCHAR},
  587. </if>
  588. <if test="lng != null">
  589. lng = #{lng,jdbcType=VARCHAR},
  590. </if>
  591. <if test="approval != null">
  592. approval = #{approval,jdbcType=INTEGER},
  593. </if>
  594. <if test="approvalTime != null">
  595. approval_time = #{approvalTime,jdbcType=TIMESTAMP},
  596. </if>
  597. <if test="manager != null">
  598. manager = #{manager,jdbcType=BIGINT},
  599. </if>
  600. <if test="remark != null">
  601. remark = #{remark,jdbcType=VARCHAR},
  602. </if>
  603. <if test="status != null">
  604. status = #{status,jdbcType=INTEGER},
  605. </if>
  606. <if test="createBy != null">
  607. create_by = #{createBy,jdbcType=BIGINT},
  608. </if>
  609. <if test="createTime != null">
  610. create_time = #{createTime,jdbcType=TIMESTAMP},
  611. </if>
  612. <if test="updateBy != null">
  613. update_by = #{updateBy,jdbcType=BIGINT},
  614. </if>
  615. <if test="updateTime != null">
  616. update_time = #{updateTime,jdbcType=TIMESTAMP},
  617. </if>
  618. <if test="delFlag != null">
  619. del_flag = #{delFlag,jdbcType=INTEGER},
  620. </if>
  621. <if test="website != null">
  622. website = #{website,jdbcType=VARCHAR},
  623. </if>
  624. <if test="business != null">
  625. business = #{business,jdbcType=VARCHAR},
  626. </if>
  627. </set>
  628. where id = #{id,jdbcType=BIGINT}
  629. </update>
  630. <update id="approval">
  631. update kws_enterprise
  632. set approval = #{approval},
  633. approval_time = now(),
  634. remark = #{remark}
  635. where id = #{id,jdbcType=BIGINT}
  636. and approval in (3, 4)
  637. and del_flag = 0
  638. </update>
  639. </mapper>