KwsEnterpriseDao.xml 21 KB

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