KwsEnterpriseDao.xml 23 KB

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