KwsEnterpriseDao.xml 22 KB

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