KwsEnterpriseDao.xml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691
  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. <if test="entName != null and entName != ''">
  293. and ke.firm_name = #{entName}
  294. </if>
  295. <choose>
  296. <when test="entTypes != null and entTypes != '' and entTypes.size() > 0">
  297. and exists (select 1 from kws_ent_type ket where ket.del_flag = 0 and ke.id = ket.ent_id and ket.type in
  298. <foreach collection="entTypes" item="type" open="(" close=")" separator=",">
  299. #{type,jdbcType=BIGINT}
  300. </foreach>
  301. )
  302. </when>
  303. </choose>
  304. </select>
  305. <select id="checkEntRepeat" resultType="com.sckw.system.model.KwsEnterprise">
  306. select * from kws_enterprise where (
  307. firm_name = #{entName}
  308. <if test="phone != null and phone != ''">
  309. or phone = #{phone}
  310. </if>
  311. )
  312. and del_flag = 0 and approval in (1,3,4)
  313. </select>
  314. <select id="selectAllByKeys" resultType="com.sckw.system.model.KwsEnterprise">
  315. select
  316. <include refid="Base_Column_List" />
  317. from kws_enterprise
  318. where del_flag = 0
  319. <if test="list != null and list.size() > 0">
  320. and id in
  321. <foreach collection="list" item="item" open="(" close=")" separator=",">
  322. #{item}
  323. </foreach>
  324. </if>
  325. </select>
  326. <select id="queryEntInfoByCityCodeAndEntTypesWithPage" resultType="com.sckw.system.model.KwsEnterprise">
  327. SELECT a.*
  328. FROM kws_enterprise a
  329. LEFT JOIN sys_area b ON a.city_code = b.CODE
  330. where 1 = 1
  331. <if test="cityCode != null">
  332. and (b.code = #{cityCode} or b.province_code = #{cityCode} or b.pcode = #{cityCode})
  333. </if>
  334. <if test="entIdList != null and entIdList.size() > 0">
  335. and a.id in
  336. <foreach collection="entIdList" item="item" open="(" close=")" separator=",">
  337. #{item}
  338. </foreach>
  339. </if>
  340. <if test="entName != null and entName != ''">
  341. and a.firm_name like concat('%', #{entName}, '%')
  342. </if>
  343. and exists (select 1
  344. from kws_ent_type k
  345. where a.id = k.ent_id
  346. and k.status = 0
  347. and k.del_flag = 0
  348. and k.type in
  349. <foreach collection="entTypeList" open="(" close=")" separator="," item="item">
  350. #{item}
  351. </foreach>
  352. )
  353. and exists (
  354. select 1
  355. from kws_ent_check_track e
  356. where a.id = e.ent_id
  357. and a.status = 0
  358. )
  359. </select>
  360. <select id="findManageInfoByEntIds" resultType="com.sckw.system.model.pojo.FindManagePojo">
  361. select distinct d.id userId,
  362. b.id deptId,
  363. f.id roleId,
  364. a.id entId
  365. from kws_enterprise a
  366. left join kws_dept b on a.id = b.ent_id
  367. left join kws_user_dept c on b.id = c.dept_id
  368. left join kws_user d on c.user_id = d.id
  369. left join kws_user_role e on d.id = e.user_id
  370. left join kws_role f on e.role_id = f.id
  371. where a.del_flag = 0
  372. and b.del_flag = 0
  373. and c.del_flag = 0
  374. and d.del_flag = 0
  375. and e.del_flag = 0
  376. and f.del_flag = 0
  377. and d.is_main = 1
  378. and d.system_type = 2
  379. and a.id in
  380. <foreach collection="list" separator="," open="(" close=")" item="item">
  381. #{item}
  382. </foreach>
  383. </select>
  384. <insert id="insert" parameterType="com.sckw.system.model.KwsEnterprise">
  385. insert into kws_enterprise
  386. <trim prefix="(" suffix=")" suffixOverrides=",">
  387. <if test="id != null">
  388. id,
  389. </if>
  390. <if test="firmName != null">
  391. firm_name,
  392. </if>
  393. <if test="code != null">
  394. code,
  395. </if>
  396. <if test="contacts != null">
  397. contacts,
  398. </if>
  399. <if test="phone != null">
  400. phone,
  401. </if>
  402. <if test="legalName != null">
  403. legal_name,
  404. </if>
  405. <if test="legalPhone != null">
  406. legal_phone,
  407. </if>
  408. <if test="head != null">
  409. head,
  410. </if>
  411. <if test="integral != null">
  412. integral,
  413. </if>
  414. <if test="balance != null">
  415. balance,
  416. </if>
  417. <if test="experience != null">
  418. experience,
  419. </if>
  420. <if test="memberLevel != null">
  421. member_level,
  422. </if>
  423. <if test="regTime != null">
  424. reg_time,
  425. </if>
  426. <if test="regSource != null">
  427. reg_source,
  428. </if>
  429. <if test="orgCode != null">
  430. org_code,
  431. </if>
  432. <if test="cityCode != null">
  433. city_code,
  434. </if>
  435. <if test="detailAddress != null">
  436. detail_address,
  437. </if>
  438. <if test="lat != null">
  439. lat,
  440. </if>
  441. <if test="lng != null">
  442. lng,
  443. </if>
  444. <if test="approval != null">
  445. approval,
  446. </if>
  447. <if test="approvalTime != null">
  448. approval_time,
  449. </if>
  450. <if test="manager != null">
  451. manager,
  452. </if>
  453. <if test="remark != null">
  454. remark,
  455. </if>
  456. <if test="status != null">
  457. status,
  458. </if>
  459. <if test="createBy != null">
  460. create_by,
  461. </if>
  462. <if test="createTime != null">
  463. create_time,
  464. </if>
  465. <if test="updateBy != null">
  466. update_by,
  467. </if>
  468. <if test="updateTime != null">
  469. update_time,
  470. </if>
  471. <if test="delFlag != null">
  472. del_flag,
  473. </if>
  474. </trim>
  475. <trim prefix="values (" suffix=")" suffixOverrides=",">
  476. <if test="id != null">
  477. #{id,jdbcType=BIGINT},
  478. </if>
  479. <if test="firmName != null">
  480. #{firmName,jdbcType=VARCHAR},
  481. </if>
  482. <if test="code != null">
  483. #{code,jdbcType=VARCHAR},
  484. </if>
  485. <if test="contacts != null">
  486. #{contacts,jdbcType=VARCHAR},
  487. </if>
  488. <if test="phone != null">
  489. #{phone,jdbcType=VARCHAR},
  490. </if>
  491. <if test="legalName != null">
  492. #{legalName,jdbcType=VARCHAR},
  493. </if>
  494. <if test="legalPhone != null">
  495. #{legalPhone,jdbcType=VARCHAR},
  496. </if>
  497. <if test="head != null">
  498. #{head,jdbcType=VARCHAR},
  499. </if>
  500. <if test="integral != null">
  501. #{integral,jdbcType=INTEGER},
  502. </if>
  503. <if test="balance != null">
  504. #{balance,jdbcType=DECIMAL},
  505. </if>
  506. <if test="experience != null">
  507. #{experience,jdbcType=INTEGER},
  508. </if>
  509. <if test="memberLevel != null">
  510. #{memberLevel,jdbcType=INTEGER},
  511. </if>
  512. <if test="regTime != null">
  513. #{regTime,jdbcType=TIMESTAMP},
  514. </if>
  515. <if test="regSource != null">
  516. #{regSource,jdbcType=VARCHAR},
  517. </if>
  518. <if test="orgCode != null">
  519. #{orgCode,jdbcType=VARCHAR},
  520. </if>
  521. <if test="cityCode != null">
  522. #{cityCode,jdbcType=INTEGER},
  523. </if>
  524. <if test="detailAddress != null">
  525. #{detailAddress,jdbcType=VARCHAR},
  526. </if>
  527. <if test="lat != null">
  528. #{lat,jdbcType=VARCHAR},
  529. </if>
  530. <if test="lng != null">
  531. #{lng,jdbcType=VARCHAR},
  532. </if>
  533. <if test="approval != null">
  534. #{approval,jdbcType=INTEGER},
  535. </if>
  536. <if test="approvalTime != null">
  537. #{approvalTime,jdbcType=TIMESTAMP},
  538. </if>
  539. <if test="manager != null">
  540. #{manager,jdbcType=BIGINT},
  541. </if>
  542. <if test="remark != null">
  543. #{remark,jdbcType=VARCHAR},
  544. </if>
  545. <if test="status != null">
  546. #{status,jdbcType=INTEGER},
  547. </if>
  548. <if test="createBy != null">
  549. #{createBy,jdbcType=BIGINT},
  550. </if>
  551. <if test="createTime != null">
  552. #{createTime,jdbcType=TIMESTAMP},
  553. </if>
  554. <if test="updateBy != null">
  555. #{updateBy,jdbcType=BIGINT},
  556. </if>
  557. <if test="updateTime != null">
  558. #{updateTime,jdbcType=TIMESTAMP},
  559. </if>
  560. <if test="delFlag != null">
  561. #{delFlag,jdbcType=INTEGER},
  562. </if>
  563. </trim>
  564. </insert>
  565. <update id="update" parameterType="com.sckw.system.model.KwsEnterprise">
  566. update kws_enterprise
  567. <set>
  568. <if test="firmName != null">
  569. firm_name = #{firmName,jdbcType=VARCHAR},
  570. </if>
  571. <if test="code != null">
  572. code = #{code,jdbcType=VARCHAR},
  573. </if>
  574. <if test="contacts != null">
  575. contacts = #{contacts,jdbcType=VARCHAR},
  576. </if>
  577. <if test="phone != null">
  578. phone = #{phone,jdbcType=VARCHAR},
  579. </if>
  580. <if test="legalName != null">
  581. legal_name = #{legalName,jdbcType=VARCHAR},
  582. </if>
  583. <if test="legalPhone != null">
  584. legal_phone = #{legalPhone,jdbcType=VARCHAR},
  585. </if>
  586. <if test="head != null">
  587. head = #{head,jdbcType=VARCHAR},
  588. </if>
  589. <if test="integral != null">
  590. integral = #{integral,jdbcType=INTEGER},
  591. </if>
  592. <if test="balance != null">
  593. balance = #{balance,jdbcType=DECIMAL},
  594. </if>
  595. <if test="experience != null">
  596. experience = #{experience,jdbcType=INTEGER},
  597. </if>
  598. <if test="memberLevel != null">
  599. member_level = #{memberLevel,jdbcType=INTEGER},
  600. </if>
  601. <if test="regTime != null">
  602. reg_time = #{regTime,jdbcType=TIMESTAMP},
  603. </if>
  604. <if test="regSource != null">
  605. reg_source = #{regSource,jdbcType=VARCHAR},
  606. </if>
  607. <if test="orgCode != null">
  608. org_code = #{orgCode,jdbcType=VARCHAR},
  609. </if>
  610. <if test="cityCode != null">
  611. city_code = #{cityCode,jdbcType=INTEGER},
  612. </if>
  613. <if test="cityName != null">
  614. city_name = #{cityName,jdbcType=VARCHAR},
  615. </if>
  616. <if test="detailAddress != null">
  617. detail_address = #{detailAddress,jdbcType=VARCHAR},
  618. </if>
  619. <if test="lat != null">
  620. lat = #{lat,jdbcType=VARCHAR},
  621. </if>
  622. <if test="lng != null">
  623. lng = #{lng,jdbcType=VARCHAR},
  624. </if>
  625. <if test="approval != null">
  626. approval = #{approval,jdbcType=INTEGER},
  627. </if>
  628. <if test="approvalTime != null">
  629. approval_time = #{approvalTime,jdbcType=TIMESTAMP},
  630. </if>
  631. <if test="manager != null">
  632. manager = #{manager,jdbcType=BIGINT},
  633. </if>
  634. <if test="remark != null">
  635. remark = #{remark,jdbcType=VARCHAR},
  636. </if>
  637. <if test="status != null">
  638. status = #{status,jdbcType=INTEGER},
  639. </if>
  640. <if test="createBy != null">
  641. create_by = #{createBy,jdbcType=BIGINT},
  642. </if>
  643. <if test="createTime != null">
  644. create_time = #{createTime,jdbcType=TIMESTAMP},
  645. </if>
  646. <if test="updateBy != null">
  647. update_by = #{updateBy,jdbcType=BIGINT},
  648. </if>
  649. <if test="updateTime != null">
  650. update_time = #{updateTime,jdbcType=TIMESTAMP},
  651. </if>
  652. <if test="delFlag != null">
  653. del_flag = #{delFlag,jdbcType=INTEGER},
  654. </if>
  655. <if test="website != null">
  656. website = #{website,jdbcType=VARCHAR},
  657. </if>
  658. <if test="business != null">
  659. business = #{business,jdbcType=VARCHAR},
  660. </if>
  661. </set>
  662. where id = #{id,jdbcType=BIGINT}
  663. </update>
  664. <update id="approval">
  665. update kws_enterprise
  666. set approval = #{approval},
  667. approval_time = now(),
  668. remark = #{remark}
  669. where id = #{id,jdbcType=BIGINT}
  670. and del_flag = 0
  671. </update>
  672. </mapper>