AdminMapper.xml 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126
  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.goafanti.common.dao.AdminMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.Admin">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Fri Jun 22 14:12:55 CST 2018.
  9. -->
  10. <id column="id" jdbcType="VARCHAR" property="id" />
  11. <result column="mobile" jdbcType="VARCHAR" property="mobile" />
  12. <result column="name" jdbcType="VARCHAR" property="name" />
  13. <result column="password" jdbcType="VARCHAR" property="password" />
  14. <result column="email" jdbcType="VARCHAR" property="email" />
  15. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  16. <result column="number" jdbcType="INTEGER" property="number" />
  17. <result column="province" jdbcType="VARCHAR" property="province" />
  18. <result column="position" jdbcType="VARCHAR" property="position" />
  19. <result column="superior_id" jdbcType="VARCHAR" property="superiorId" />
  20. <result column="city" jdbcType="VARCHAR" property="city" />
  21. <result column="department_id" jdbcType="VARCHAR" property="departmentId" />
  22. <result column="status" jdbcType="VARCHAR" property="status" />
  23. <result column="user_no" jdbcType="VARCHAR" property="userNo" />
  24. <result column="duty" jdbcType="VARCHAR" property="duty" />
  25. <result column="district" jdbcType="VARCHAR" property="district" />
  26. <result column="head_portrait_url" jdbcType="VARCHAR" property="headPortraitUrl" />
  27. <result column="contact_mobile" jdbcType="VARCHAR" property="contactMobile" />
  28. <result column="last_login_time" jdbcType="TIMESTAMP" property="lastLoginTime" />
  29. </resultMap>
  30. <sql id="Example_Where_Clause">
  31. <!--
  32. WARNING - @mbg.generated
  33. This element is automatically generated by MyBatis Generator, do not modify.
  34. This element was generated on Fri Jun 22 14:12:55 CST 2018.
  35. -->
  36. <where>
  37. <foreach collection="oredCriteria" item="criteria" separator="or">
  38. <if test="criteria.valid">
  39. <trim prefix="(" prefixOverrides="and" suffix=")">
  40. <foreach collection="criteria.criteria" item="criterion">
  41. <choose>
  42. <when test="criterion.noValue">
  43. and ${criterion.condition}
  44. </when>
  45. <when test="criterion.singleValue">
  46. and ${criterion.condition} #{criterion.value}
  47. </when>
  48. <when test="criterion.betweenValue">
  49. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  50. </when>
  51. <when test="criterion.listValue">
  52. and ${criterion.condition}
  53. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  54. #{listItem}
  55. </foreach>
  56. </when>
  57. </choose>
  58. </foreach>
  59. </trim>
  60. </if>
  61. </foreach>
  62. </where>
  63. </sql>
  64. <sql id="Update_By_Example_Where_Clause">
  65. <!--
  66. WARNING - @mbg.generated
  67. This element is automatically generated by MyBatis Generator, do not modify.
  68. This element was generated on Fri Jun 22 14:12:55 CST 2018.
  69. -->
  70. <where>
  71. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  72. <if test="criteria.valid">
  73. <trim prefix="(" prefixOverrides="and" suffix=")">
  74. <foreach collection="criteria.criteria" item="criterion">
  75. <choose>
  76. <when test="criterion.noValue">
  77. and ${criterion.condition}
  78. </when>
  79. <when test="criterion.singleValue">
  80. and ${criterion.condition} #{criterion.value}
  81. </when>
  82. <when test="criterion.betweenValue">
  83. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  84. </when>
  85. <when test="criterion.listValue">
  86. and ${criterion.condition}
  87. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  88. #{listItem}
  89. </foreach>
  90. </when>
  91. </choose>
  92. </foreach>
  93. </trim>
  94. </if>
  95. </foreach>
  96. </where>
  97. </sql>
  98. <sql id="Base_Column_List">
  99. <!--
  100. WARNING - @mbg.generated
  101. This element is automatically generated by MyBatis Generator, do not modify.
  102. This element was generated on Fri Jun 22 14:12:55 CST 2018.
  103. -->
  104. id, mobile, name, password, email, create_time, number, province, position, superior_id,
  105. city, department_id, status, user_no, duty, district, head_portrait_url, contact_mobile,
  106. last_login_time
  107. </sql>
  108. <select id="selectByExample" parameterType="com.goafanti.common.model.AdminExample" resultMap="BaseResultMap">
  109. <!--
  110. WARNING - @mbg.generated
  111. This element is automatically generated by MyBatis Generator, do not modify.
  112. This element was generated on Fri Jun 22 14:12:55 CST 2018.
  113. -->
  114. select
  115. <if test="distinct">
  116. distinct
  117. </if>
  118. <include refid="Base_Column_List" />
  119. from admin
  120. <if test="_parameter != null">
  121. <include refid="Example_Where_Clause" />
  122. </if>
  123. <if test="orderByClause != null">
  124. order by ${orderByClause}
  125. </if>
  126. </select>
  127. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  128. <!--
  129. WARNING - @mbg.generated
  130. This element is automatically generated by MyBatis Generator, do not modify.
  131. This element was generated on Fri Jun 22 14:12:55 CST 2018.
  132. -->
  133. select
  134. <include refid="Base_Column_List" />
  135. from admin
  136. where id = #{id,jdbcType=VARCHAR}
  137. </select>
  138. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  139. <!--
  140. WARNING - @mbg.generated
  141. This element is automatically generated by MyBatis Generator, do not modify.
  142. This element was generated on Fri Jun 22 14:12:55 CST 2018.
  143. -->
  144. delete from admin
  145. where id = #{id,jdbcType=VARCHAR}
  146. </delete>
  147. <delete id="deleteByExample" parameterType="com.goafanti.common.model.AdminExample">
  148. <!--
  149. WARNING - @mbg.generated
  150. This element is automatically generated by MyBatis Generator, do not modify.
  151. This element was generated on Fri Jun 22 14:12:55 CST 2018.
  152. -->
  153. delete from admin
  154. <if test="_parameter != null">
  155. <include refid="Example_Where_Clause" />
  156. </if>
  157. </delete>
  158. <insert id="insert" parameterType="com.goafanti.common.model.Admin">
  159. <!--
  160. WARNING - @mbg.generated
  161. This element is automatically generated by MyBatis Generator, do not modify.
  162. This element was generated on Fri Jun 22 14:12:55 CST 2018.
  163. -->
  164. insert into admin (id, mobile, name,
  165. password, email, create_time,
  166. number, province, position,
  167. superior_id, city, department_id,
  168. status, user_no, duty,
  169. district, head_portrait_url, contact_mobile,
  170. last_login_time)
  171. values (#{id,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
  172. #{password,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
  173. #{number,jdbcType=INTEGER}, #{province,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR},
  174. #{superiorId,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, #{departmentId,jdbcType=VARCHAR},
  175. #{status,jdbcType=VARCHAR}, #{userNo,jdbcType=VARCHAR}, #{duty,jdbcType=VARCHAR},
  176. #{district,jdbcType=VARCHAR}, #{headPortraitUrl,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR},
  177. #{lastLoginTime,jdbcType=TIMESTAMP})
  178. </insert>
  179. <insert id="insertSelective" parameterType="com.goafanti.common.model.Admin">
  180. <!--
  181. WARNING - @mbg.generated
  182. This element is automatically generated by MyBatis Generator, do not modify.
  183. This element was generated on Fri Jun 22 14:12:55 CST 2018.
  184. -->
  185. insert into admin
  186. <trim prefix="(" suffix=")" suffixOverrides=",">
  187. <if test="id != null">
  188. id,
  189. </if>
  190. <if test="mobile != null">
  191. mobile,
  192. </if>
  193. <if test="name != null">
  194. name,
  195. </if>
  196. <if test="password != null">
  197. password,
  198. </if>
  199. <if test="email != null">
  200. email,
  201. </if>
  202. <if test="createTime != null">
  203. create_time,
  204. </if>
  205. <if test="number != null">
  206. number,
  207. </if>
  208. <if test="province != null">
  209. province,
  210. </if>
  211. <if test="position != null">
  212. position,
  213. </if>
  214. <if test="superiorId != null">
  215. superior_id,
  216. </if>
  217. <if test="city != null">
  218. city,
  219. </if>
  220. <if test="departmentId != null">
  221. department_id,
  222. </if>
  223. <if test="status != null">
  224. status,
  225. </if>
  226. <if test="userNo != null">
  227. user_no,
  228. </if>
  229. <if test="duty != null">
  230. duty,
  231. </if>
  232. <if test="district != null">
  233. district,
  234. </if>
  235. <if test="headPortraitUrl != null">
  236. head_portrait_url,
  237. </if>
  238. <if test="contactMobile != null">
  239. contact_mobile,
  240. </if>
  241. <if test="lastLoginTime != null">
  242. last_login_time,
  243. </if>
  244. </trim>
  245. <trim prefix="values (" suffix=")" suffixOverrides=",">
  246. <if test="id != null">
  247. #{id,jdbcType=VARCHAR},
  248. </if>
  249. <if test="mobile != null">
  250. #{mobile,jdbcType=VARCHAR},
  251. </if>
  252. <if test="name != null">
  253. #{name,jdbcType=VARCHAR},
  254. </if>
  255. <if test="password != null">
  256. #{password,jdbcType=VARCHAR},
  257. </if>
  258. <if test="email != null">
  259. #{email,jdbcType=VARCHAR},
  260. </if>
  261. <if test="createTime != null">
  262. #{createTime,jdbcType=TIMESTAMP},
  263. </if>
  264. <if test="number != null">
  265. #{number,jdbcType=INTEGER},
  266. </if>
  267. <if test="province != null">
  268. #{province,jdbcType=VARCHAR},
  269. </if>
  270. <if test="position != null">
  271. #{position,jdbcType=VARCHAR},
  272. </if>
  273. <if test="superiorId != null">
  274. #{superiorId,jdbcType=VARCHAR},
  275. </if>
  276. <if test="city != null">
  277. #{city,jdbcType=VARCHAR},
  278. </if>
  279. <if test="departmentId != null">
  280. #{departmentId,jdbcType=VARCHAR},
  281. </if>
  282. <if test="status != null">
  283. #{status,jdbcType=VARCHAR},
  284. </if>
  285. <if test="userNo != null">
  286. #{userNo,jdbcType=VARCHAR},
  287. </if>
  288. <if test="duty != null">
  289. #{duty,jdbcType=VARCHAR},
  290. </if>
  291. <if test="district != null">
  292. #{district,jdbcType=VARCHAR},
  293. </if>
  294. <if test="headPortraitUrl != null">
  295. #{headPortraitUrl,jdbcType=VARCHAR},
  296. </if>
  297. <if test="contactMobile != null">
  298. #{contactMobile,jdbcType=VARCHAR},
  299. </if>
  300. <if test="lastLoginTime != null">
  301. #{lastLoginTime,jdbcType=TIMESTAMP},
  302. </if>
  303. </trim>
  304. </insert>
  305. <select id="countByExample" parameterType="com.goafanti.common.model.AdminExample" resultType="java.lang.Long">
  306. <!--
  307. WARNING - @mbg.generated
  308. This element is automatically generated by MyBatis Generator, do not modify.
  309. This element was generated on Fri Jun 22 14:12:55 CST 2018.
  310. -->
  311. select count(*) from admin
  312. <if test="_parameter != null">
  313. <include refid="Example_Where_Clause" />
  314. </if>
  315. </select>
  316. <update id="updateByExampleSelective" parameterType="map">
  317. <!--
  318. WARNING - @mbg.generated
  319. This element is automatically generated by MyBatis Generator, do not modify.
  320. This element was generated on Fri Jun 22 14:12:55 CST 2018.
  321. -->
  322. update admin
  323. <set>
  324. <if test="record.id != null">
  325. id = #{record.id,jdbcType=VARCHAR},
  326. </if>
  327. <if test="record.mobile != null">
  328. mobile = #{record.mobile,jdbcType=VARCHAR},
  329. </if>
  330. <if test="record.name != null">
  331. name = #{record.name,jdbcType=VARCHAR},
  332. </if>
  333. <if test="record.password != null">
  334. password = #{record.password,jdbcType=VARCHAR},
  335. </if>
  336. <if test="record.email != null">
  337. email = #{record.email,jdbcType=VARCHAR},
  338. </if>
  339. <if test="record.createTime != null">
  340. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  341. </if>
  342. <if test="record.number != null">
  343. number = #{record.number,jdbcType=INTEGER},
  344. </if>
  345. <if test="record.province != null">
  346. province = #{record.province,jdbcType=VARCHAR},
  347. </if>
  348. <if test="record.position != null">
  349. position = #{record.position,jdbcType=VARCHAR},
  350. </if>
  351. <if test="record.superiorId != null">
  352. superior_id = #{record.superiorId,jdbcType=VARCHAR},
  353. </if>
  354. <if test="record.city != null">
  355. city = #{record.city,jdbcType=VARCHAR},
  356. </if>
  357. <if test="record.departmentId != null">
  358. department_id = #{record.departmentId,jdbcType=VARCHAR},
  359. </if>
  360. <if test="record.status != null">
  361. status = #{record.status,jdbcType=VARCHAR},
  362. </if>
  363. <if test="record.userNo != null">
  364. user_no = #{record.userNo,jdbcType=VARCHAR},
  365. </if>
  366. <if test="record.duty != null">
  367. duty = #{record.duty,jdbcType=VARCHAR},
  368. </if>
  369. <if test="record.district != null">
  370. district = #{record.district,jdbcType=VARCHAR},
  371. </if>
  372. <if test="record.headPortraitUrl != null">
  373. head_portrait_url = #{record.headPortraitUrl,jdbcType=VARCHAR},
  374. </if>
  375. <if test="record.contactMobile != null">
  376. contact_mobile = #{record.contactMobile,jdbcType=VARCHAR},
  377. </if>
  378. <if test="record.lastLoginTime != null">
  379. last_login_time = #{record.lastLoginTime,jdbcType=TIMESTAMP},
  380. </if>
  381. </set>
  382. <if test="_parameter != null">
  383. <include refid="Update_By_Example_Where_Clause" />
  384. </if>
  385. </update>
  386. <update id="updateByExample" parameterType="map">
  387. <!--
  388. WARNING - @mbg.generated
  389. This element is automatically generated by MyBatis Generator, do not modify.
  390. This element was generated on Fri Jun 22 14:12:55 CST 2018.
  391. -->
  392. update admin
  393. set id = #{record.id,jdbcType=VARCHAR},
  394. mobile = #{record.mobile,jdbcType=VARCHAR},
  395. name = #{record.name,jdbcType=VARCHAR},
  396. password = #{record.password,jdbcType=VARCHAR},
  397. email = #{record.email,jdbcType=VARCHAR},
  398. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  399. number = #{record.number,jdbcType=INTEGER},
  400. province = #{record.province,jdbcType=VARCHAR},
  401. position = #{record.position,jdbcType=VARCHAR},
  402. superior_id = #{record.superiorId,jdbcType=VARCHAR},
  403. city = #{record.city,jdbcType=VARCHAR},
  404. department_id = #{record.departmentId,jdbcType=VARCHAR},
  405. status = #{record.status,jdbcType=VARCHAR},
  406. user_no = #{record.userNo,jdbcType=VARCHAR},
  407. duty = #{record.duty,jdbcType=VARCHAR},
  408. district = #{record.district,jdbcType=VARCHAR},
  409. head_portrait_url = #{record.headPortraitUrl,jdbcType=VARCHAR},
  410. contact_mobile = #{record.contactMobile,jdbcType=VARCHAR},
  411. last_login_time = #{record.lastLoginTime,jdbcType=TIMESTAMP}
  412. <if test="_parameter != null">
  413. <include refid="Update_By_Example_Where_Clause" />
  414. </if>
  415. </update>
  416. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Admin">
  417. <!--
  418. WARNING - @mbg.generated
  419. This element is automatically generated by MyBatis Generator, do not modify.
  420. This element was generated on Fri Jun 22 14:12:55 CST 2018.
  421. -->
  422. update admin
  423. <set>
  424. <if test="mobile != null">
  425. mobile = #{mobile,jdbcType=VARCHAR},
  426. </if>
  427. <if test="name != null">
  428. name = #{name,jdbcType=VARCHAR},
  429. </if>
  430. <if test="password != null">
  431. password = #{password,jdbcType=VARCHAR},
  432. </if>
  433. <if test="email != null">
  434. email = #{email,jdbcType=VARCHAR},
  435. </if>
  436. <if test="createTime != null">
  437. create_time = #{createTime,jdbcType=TIMESTAMP},
  438. </if>
  439. <if test="number != null">
  440. number = #{number,jdbcType=INTEGER},
  441. </if>
  442. <if test="province != null">
  443. province = #{province,jdbcType=VARCHAR},
  444. </if>
  445. <if test="position != null">
  446. position = #{position,jdbcType=VARCHAR},
  447. </if>
  448. <if test="superiorId != null">
  449. superior_id = #{superiorId,jdbcType=VARCHAR},
  450. </if>
  451. <if test="city != null">
  452. city = #{city,jdbcType=VARCHAR},
  453. </if>
  454. <if test="departmentId != null">
  455. department_id = #{departmentId,jdbcType=VARCHAR},
  456. </if>
  457. <if test="status != null">
  458. status = #{status,jdbcType=VARCHAR},
  459. </if>
  460. <if test="userNo != null">
  461. user_no = #{userNo,jdbcType=VARCHAR},
  462. </if>
  463. <if test="duty != null">
  464. duty = #{duty,jdbcType=VARCHAR},
  465. </if>
  466. <if test="district != null">
  467. district = #{district,jdbcType=VARCHAR},
  468. </if>
  469. <if test="headPortraitUrl != null">
  470. head_portrait_url = #{headPortraitUrl,jdbcType=VARCHAR},
  471. </if>
  472. <if test="contactMobile != null">
  473. contact_mobile = #{contactMobile,jdbcType=VARCHAR},
  474. </if>
  475. <if test="lastLoginTime != null">
  476. last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
  477. </if>
  478. </set>
  479. where id = #{id,jdbcType=VARCHAR}
  480. </update>
  481. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Admin">
  482. <!--
  483. WARNING - @mbg.generated
  484. This element is automatically generated by MyBatis Generator, do not modify.
  485. This element was generated on Fri Jun 22 14:12:55 CST 2018.
  486. -->
  487. update admin
  488. set mobile = #{mobile,jdbcType=VARCHAR},
  489. name = #{name,jdbcType=VARCHAR},
  490. password = #{password,jdbcType=VARCHAR},
  491. email = #{email,jdbcType=VARCHAR},
  492. create_time = #{createTime,jdbcType=TIMESTAMP},
  493. number = #{number,jdbcType=INTEGER},
  494. province = #{province,jdbcType=VARCHAR},
  495. position = #{position,jdbcType=VARCHAR},
  496. superior_id = #{superiorId,jdbcType=VARCHAR},
  497. city = #{city,jdbcType=VARCHAR},
  498. department_id = #{departmentId,jdbcType=VARCHAR},
  499. status = #{status,jdbcType=VARCHAR},
  500. user_no = #{userNo,jdbcType=VARCHAR},
  501. duty = #{duty,jdbcType=VARCHAR},
  502. district = #{district,jdbcType=VARCHAR},
  503. head_portrait_url = #{headPortraitUrl,jdbcType=VARCHAR},
  504. contact_mobile = #{contactMobile,jdbcType=VARCHAR},
  505. last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP}
  506. where id = #{id,jdbcType=VARCHAR}
  507. </update>
  508. <select id="selectAllAdmin" resultMap="BaseResultMap">
  509. select
  510. <include refid="Base_Column_List" />
  511. from admin
  512. where status !='锁定'
  513. <if test="depId != null">
  514. and department_id = #{depId,jdbcType=VARCHAR}
  515. </if>
  516. </select>
  517. <select id="selectByMobile" parameterType="java.lang.String" resultMap="BaseResultMap">
  518. select
  519. <include refid="Base_Column_List" />
  520. from admin
  521. where mobile = #{mobile,jdbcType=VARCHAR}
  522. </select>
  523. <select id="selectRolesByPrimaryKey" parameterType="java.lang.String">
  524. select r.name, r.id, r.type
  525. from role r
  526. left join user_role ur on ur.rid=r.id
  527. where ur.uid = #{uid,jdbcType=VARCHAR}
  528. </select>
  529. <select id="selectCognizanceConsultant" resultMap="BaseResultMap">
  530. select
  531. <include refid="Base_Column_List" />
  532. from admin
  533. where id <![CDATA[ <> ]]> '1'
  534. </select>
  535. <select id="selectCognizancePrincipal" resultMap="BaseResultMap">
  536. select a.id, a.name, a.position from admin a
  537. INNER JOIN user_role ur on a.id = ur.uid
  538. where ur.rid not in('1','2','3','4','5','6')
  539. group by a.id
  540. </select>
  541. <select id="selectPatentAuthor" resultMap="BaseResultMap">
  542. select a.id, a.name, a.position from admin a
  543. INNER JOIN user_role ur on a.id = ur.uid
  544. where ur.rid not in('1','2','3','4','5','6')
  545. group by a.id
  546. </select>
  547. <select id="selectPatentPrincipal" resultMap="BaseResultMap">
  548. select a.id, a.name, a.position from admin a
  549. INNER JOIN user_role ur on a.id = ur.uid
  550. where ur.rid not in('1','2','3','4','5','6')
  551. group by a.id
  552. </select>
  553. <select id="selectCopyrightConsultant" resultMap="BaseResultMap">
  554. select
  555. <include refid="Base_Column_List" />
  556. from admin
  557. where id <![CDATA[ <> ]]> '1'
  558. </select>
  559. <select id="selectCopyrightPrincipal" resultMap="BaseResultMap">
  560. select a.id, a.name, a.position from admin a
  561. INNER JOIN user_role ur on a.id = ur.uid
  562. where ur.rid not in('1','2','3','4','5','6')
  563. group by a.id
  564. </select>
  565. <select id="selectTechprojectConsultant" resultMap="BaseResultMap">
  566. select
  567. <include refid="Base_Column_List" />
  568. from admin
  569. where id <![CDATA[ <> ]]> '1'
  570. </select>
  571. <select id="selectTechprojectPrincipal" resultMap="BaseResultMap">
  572. select a.id, a.name, a.position from admin a
  573. INNER JOIN user_role ur on a.id = ur.uid
  574. where ur.rid not in('1','2','3','4','5','6')
  575. group by a.id
  576. </select>
  577. <select id="selectRoleByPrimaryKey" parameterType="java.lang.String" resultType="String">
  578. SELECT rid FROM user_role
  579. where uid = #{uid,jdbcType=VARCHAR}
  580. </select>
  581. <select id="selectAccoutManager" resultMap="BaseResultMap">
  582. select a.id, a.name, a.position from admin a
  583. INNER JOIN user_role ur on a.id = ur.uid
  584. where ur.rid = '4'
  585. </select>
  586. <select id="selectTechnician" resultMap="BaseResultMap">
  587. select a.id, a.name, a.position from admin a
  588. INNER JOIN user_role ur on a.id = ur.uid
  589. where ur.rid not in('1','2','3','4')
  590. group by a.id
  591. </select>
  592. <select id="selectSalesman" resultMap="BaseResultMap">
  593. select a.id, a.name, a.position from admin a
  594. INNER JOIN user_role ur on a.id = ur.uid
  595. where ur.rid in ('5', '6')
  596. </select>
  597. <select id="selectContractManager" resultMap="BaseResultMap">
  598. select a.id, a.name, a.position from admin a
  599. INNER JOIN user_role ur on a.id = ur.uid
  600. where ur.rid not in('1','2','3','4')
  601. group by a.id
  602. </select>
  603. <select id="selectTechBroder" resultMap="BaseResultMap">
  604. select
  605. u.rid as rolesId, a.name,a.id, a.position
  606. from user_role u
  607. left join admin a on a.id =u.uid
  608. left join role r on r.id =u.rid
  609. where
  610. r.role_name='技术经纪专员'
  611. </select>
  612. <select id="listAdminSelectBySuperAdmin" resultMap="BaseResultMap">
  613. select
  614. <include refid="Base_Column_List" />
  615. from admin
  616. where id <![CDATA[ <> ]]> '1'
  617. </select>
  618. <select id="listAdminSelectByAreaAdmin" resultMap="BaseResultMap">
  619. select
  620. a.id, a.name, a.mobile,
  621. a.create_time as createTime, a.number, aa.name as superior
  622. from admin a
  623. left join admin_location al on al.admin_id = a.id
  624. left join admin aa on aa.id = a.superior_id
  625. where 1 = 1
  626. <if test="provinceList != null and provinceList.size &gt; 0">
  627. and al.province in
  628. <foreach close=")" collection="provinceList" item="plist" open="(" separator=",">
  629. #{plist}
  630. </foreach>
  631. </if>
  632. <if test="cityList != null and cityList.size &gt; 0">
  633. and al.city in
  634. <foreach close=")" collection="cityList" item="clist" open="(" separator=",">
  635. #{clist}
  636. </foreach>
  637. </if>
  638. </select>
  639. <select id="findAdminListByPage" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminListBo">
  640. select
  641. a.number, a.mobile, a.name,
  642. a.position, a.email, a.id,
  643. a.province,
  644. a.city,
  645. a.create_time as createTime,
  646. aa.name as superior,
  647. a.superior_id as superiorId,
  648. a.department_id as departmentId,
  649. date_format(a.last_login_time,'%Y-%m-%d %H:%i:%S') as lastLoginTime,
  650. dm.name as departmentName
  651. from admin a
  652. left join admin_location al on a.id = al.admin_id
  653. left join admin aa on aa.id = a.superior_id
  654. left join department dm on a.department_id = dm.id
  655. left join user_role x on x.uid=a.id
  656. left join `role` y on x.rid=y.id
  657. where a.id <![CDATA[ <> ]]> '1'
  658. <if test="roleName != null">
  659. where y.role_name= #{roleName,jdbcType=VARCHAR}
  660. </if>
  661. <if test="mobile != null">
  662. and a.mobile = #{mobile,jdbcType=VARCHAR}
  663. </if>
  664. <if test="name != null">
  665. and a.name = #{name,jdbcType=VARCHAR}
  666. </if>
  667. <if test="number != null">
  668. and a.number = #{number,jdbcType=INTEGER}
  669. </if>
  670. <if test="province != null">
  671. and a.province = #{province,jdbcType=VARCHAR}
  672. </if>
  673. order by a.last_login_time ,a.number
  674. <if test="page_sql!=null">
  675. ${page_sql}
  676. </if>
  677. </select>
  678. <select id="findAdminCount" parameterType="java.lang.String" resultType="java.lang.Integer">
  679. select count(1) from admin
  680. where id <![CDATA[ <> ]]> '1'
  681. left join `role` y on x.rid=y.id
  682. where a.id <![CDATA[ <> ]]> '1'
  683. <if test="roleName != null">
  684. where y.role_name= #{roleName,jdbcType=VARCHAR}
  685. </if>
  686. <if test="mobile != null">
  687. and mobile = #{mobile,jdbcType=VARCHAR}
  688. </if>
  689. <if test="name != null">
  690. and name = #{name,jdbcType=VARCHAR}
  691. </if>
  692. <if test="number != null">
  693. and number = #{number,jdbcType=INTEGER}
  694. </if>
  695. <if test="province != null">
  696. and a.province = #{province,jdbcType=VARCHAR}
  697. </if>
  698. </select>
  699. <select id="listAdminByName" parameterType="java.lang.String" resultMap="BaseResultMap">
  700. select id,name from admin where name like concat('%',#{name},'%')
  701. </select>
  702. <!--*************************************************************************-->
  703. <select id="selectAdminListByPage" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminListBo">
  704. select x.*,y.name as departmentName from(select
  705. <!-- a.user_no as userNo, -->
  706. a.mobile, a.name,
  707. a.position, a.email, a.id,
  708. a.province,
  709. a.city,
  710. a.create_time as createTime,
  711. aa.name as superior,
  712. a.superior_id as superiorId,
  713. a.department_id as departmentId,
  714. a.last_login_time as lastLoginTime,
  715. a.contact_mobile as contactMobile,
  716. a.duty,a.status
  717. from admin a
  718. left join admin_location al on a.id = al.admin_id
  719. left join admin aa on aa.id = a.superior_id
  720. left join user_role ur on a.id=ur.uid
  721. left join `role` y on ur.rid=y.id
  722. where a.id <![CDATA[ <> ]]> '1'
  723. and (a.status != '注销' or a.status is null)
  724. <if test="roleName != null">
  725. and y.role_name= #{roleName,jdbcType=VARCHAR}
  726. </if>
  727. <if test="name != null">
  728. and a.name like concat('%',#{name,jdbcType=VARCHAR},'%')
  729. </if>
  730. <if test="departmentId != null">
  731. and a.department_id = #{departmentId,jdbcType=VARCHAR}
  732. </if>
  733. <if test="rid != null">
  734. and ur.rid = #{rid,jdbcType=VARCHAR}
  735. </if>
  736. <if test="duty != null">
  737. and a.duty = #{duty,jdbcType=VARCHAR}
  738. </if>
  739. <if test="position != null">
  740. and a.position = #{position,jdbcType=VARCHAR}
  741. </if>
  742. <if test="status != null">
  743. and a.status = #{status,jdbcType=VARCHAR}
  744. </if>
  745. <if test="mobile != null">
  746. and a.mobile = #{mobile,jdbcType=VARCHAR}
  747. </if>
  748. <if test="superiorId != null">
  749. and a.superior_id = #{superiorId,jdbcType=VARCHAR}
  750. </if>
  751. group by a.id
  752. order by a.last_login_time,a.number )x left join department y on x.departmentId = y.id
  753. <if test="page_sql!=null">
  754. ${page_sql}
  755. </if>
  756. </select>
  757. <select id="selectAdminCount" parameterType="java.lang.String" resultType="java.lang.Integer">
  758. select count(t.counts)
  759. from(select a.id counts from (select a.id from admin a
  760. left join user_role ur on a.id=ur.uid
  761. left join `role` y on ur.rid=y.id
  762. where a.id <![CDATA[ <> ]]> '1'
  763. and (a.status != '注销' or a.status is null)
  764. <if test="roleName != null">
  765. and y.role_name= #{roleName,jdbcType=VARCHAR}
  766. </if>
  767. <if test="name != null">
  768. and a.name like concat('%',#{name,jdbcType=VARCHAR},'%')
  769. </if>
  770. <if test="departmentId != null">
  771. and a.department_id = #{departmentId,jdbcType=VARCHAR}
  772. </if>
  773. <if test="rid != null">
  774. and ur.rid = #{rid,jdbcType=VARCHAR}
  775. </if>
  776. <if test="duty != null">
  777. and a.duty = #{duty,jdbcType=VARCHAR}
  778. </if>
  779. <if test="position != null">
  780. and a.position = #{position,jdbcType=VARCHAR}
  781. </if>
  782. <if test="status != null">
  783. and a.status = #{status,jdbcType=VARCHAR}
  784. </if>
  785. <if test="mobile != null">
  786. and a.mobile = #{mobile,jdbcType=VARCHAR}
  787. </if>
  788. <if test="superiorId != null">
  789. and a.superior_id = #{superiorId,jdbcType=VARCHAR}
  790. </if>
  791. )a
  792. group by a.id)t
  793. </select>
  794. <insert id="insertn" parameterType="com.goafanti.common.model.Admin">
  795. insert into admin (id, mobile, name,
  796. password, email, create_time,
  797. number, province, position, superior_id, city,department_id,status,user_no,duty,district,head_portrait_url,contact_mobile)
  798. values (#{id,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
  799. #{password,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
  800. #{number,jdbcType=INTEGER}, #{province,jdbcType=INTEGER}, #{position,jdbcType=VARCHAR},
  801. #{superiorId,jdbcType=VARCHAR}, #{city,jdbcType=INTEGER},#{departmentId,jdbcType=VARCHAR},
  802. #{status,jdbcType=VARCHAR},#{userNo,jdbcType=VARCHAR},#{duty,jdbcType=VARCHAR},#{district,jdbcType=VARCHAR},#{headPortraitUrl,jdbcType=VARCHAR},#{contactMobile,jdbcType=VARCHAR}
  803. )
  804. </insert>
  805. <select id="selectUserNoBySuperiorId" parameterType="java.lang.String" resultType="java.lang.String">
  806. select
  807. user_no as userNo
  808. from admin
  809. where
  810. id=#{superiorId,jdbcType=VARCHAR}
  811. </select>
  812. <select id="selectCountBySuperiorId" parameterType="java.lang.String" resultType="java.lang.Integer">
  813. select
  814. count(1)
  815. from admin
  816. where
  817. superior_id=#{superiorId,jdbcType=VARCHAR}
  818. </select>
  819. <select id="selectIdByUserNo" parameterType="java.lang.String" resultType="java.lang.String">
  820. select
  821. id
  822. from admin
  823. where
  824. user_no=#{UserNo,jdbcType=VARCHAR}
  825. </select>
  826. <select id="selectAllByid" parameterType="java.lang.String" resultType="com.goafanti.common.model.Admin">
  827. select
  828. id, mobile, name,
  829. password, email, create_time as createTime,
  830. province, position,
  831. superior_id as superiorId,department_id as departmentId,
  832. status,user_no as userNo,duty,district,head_portrait_url as headPortraitUrl,
  833. contact_mobile as contactMobile
  834. from admin
  835. where
  836. id=#{id,jdbcType=VARCHAR}
  837. </select>
  838. <select id="selectNameByid" parameterType="java.lang.String" resultType="java.lang.String">
  839. select
  840. name
  841. from admin
  842. where
  843. id=#{id,jdbcType=VARCHAR}
  844. </select>
  845. <select id="selectRolesByUid" parameterType="java.lang.String" resultType="java.lang.String">
  846. select
  847. r.role_name as roles
  848. from user_role ur
  849. left join role r on r.id = ur.rid
  850. where
  851. uid=#{id,jdbcType=VARCHAR}
  852. </select>
  853. <select id="selectRolesIdByUid" parameterType="java.lang.String" resultType="java.lang.String">
  854. select
  855. rid as rolesId
  856. from user_role
  857. where
  858. uid=#{id,jdbcType=VARCHAR}
  859. </select>
  860. <select id="selectStatusByMobile" parameterType="java.lang.String" resultType="java.lang.String">
  861. select
  862. status
  863. from admin
  864. where
  865. mobile= #{mobile,jdbcType=VARCHAR}
  866. </select>
  867. <delete id="deleteById" parameterType="java.lang.String">
  868. delete from admin
  869. where id = #{id,jdbcType=VARCHAR}
  870. </delete>
  871. <select id="selectIDNBySuperiorId" parameterType="java.lang.String" resultType="com.goafanti.common.model.Admin">
  872. select id, mobile, name,
  873. password, email, create_time as createTime,
  874. province, position,
  875. superior_id as superiorId,department_id as departmentId,
  876. status,user_no as userNo,duty,district,head_portrait_url as headPortraitUrl
  877. from admin
  878. where
  879. superior_id=#{superiorId,jdbcType=VARCHAR}
  880. </select>
  881. <select id="selectUserNoById" resultType="java.lang.String">
  882. select user_no as userNo
  883. from admin
  884. where
  885. id=#{superiorId,jdbcType=VARCHAR}
  886. </select>
  887. <update id="updateByUserNo" parameterType="com.goafanti.common.model.Admin">
  888. update admin
  889. set user_no = #{userNo,jdbcType=VARCHAR}
  890. where
  891. id=#{id,jdbcType=VARCHAR}
  892. </update>
  893. <select id="selectIdBySuperiorId" parameterType="java.lang.String" resultType="java.lang.String">
  894. select id
  895. from admin
  896. where
  897. superior_id=#{superiorId,jdbcType=VARCHAR}
  898. </select>
  899. <select id="selectSubList" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminListBo">
  900. select
  901. a.id,
  902. a.user_no as userNo,
  903. a.mobile,
  904. a.name,
  905. a.position,
  906. b.name as departmentName
  907. from
  908. admin a left join department b on
  909. a.department_id = b.id
  910. where
  911. a.department_id =(
  912. select
  913. department_id
  914. from
  915. admin
  916. where
  917. id = #{adminId,jdbcType=VARCHAR}
  918. )
  919. and a.id <![CDATA[ <> ]]> #{adminId,jdbcType=VARCHAR}
  920. </select>
  921. <select id="selectAdminByRoleId" parameterType="java.lang.String" resultMap="BaseResultMap">
  922. select a.id,a.name from admin a left join user_role b on a.id = b.uid left join role c on b.rid = c.id where c.id = #{roleId,jdbcType=VARCHAR} limit 1
  923. </select>
  924. <select id="selectDepartmentStaff" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminListBo">
  925. select a.id ,a.name,a.password,a.department_id,b.name
  926. from admin a left join department b
  927. on a.department_id= b.id
  928. where 1=1
  929. <if test="departmentId != null and departmentId !='' ">
  930. and a.department_id = #{departmentId,jdbcType=VARCHAR}
  931. </if>
  932. <if test="name != null">
  933. and a.name like concat('%',#{name,jdbcType=VARCHAR},'%')
  934. </if>
  935. </select>
  936. <select id="selectAdminName" parameterType="java.lang.String" resultMap="BaseResultMap">
  937. select a.id, a.name from admin a left join user_role b on a.id=b.uid
  938. left join `role` c on b.rid=c.id
  939. where c.role_name = #{name,jdbcType=VARCHAR}
  940. </select>
  941. <update id="updateLockIds" parameterType="java.lang.String">
  942. update admin set status = '锁定' where id in (${lockIds})
  943. </update>
  944. <!-- 用户是为正常的 -->
  945. <select id="getCountById" parameterType="java.lang.String" resultType="java.lang.Integer">
  946. select count(a.id) from admin a
  947. inner join user_role ur on a.id=ur.uid
  948. where a.id= #{_parameter,jdbcType=VARCHAR} and ( a.status != '注销' or a.status is null)
  949. </select>
  950. <select id="getAdminRoleList" parameterType="java.lang.String" resultMap="BaseResultMap">
  951. select a.id, a.name from admin a left join user_role b on a.id=b.uid
  952. left join `role` c on b.rid=c.id
  953. where c.role_name = #{name,jdbcType=VARCHAR}
  954. </select>
  955. <!-- 获得当前登录人的名字和部门名 -->
  956. <select id="getDeptNameByAid" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminListBo">
  957. select a.name, d.name as departmentName from admin a
  958. left join department d on a.department_id = d.id
  959. where a.id = #{_parameter,jdbcType=VARCHAR}
  960. </select>
  961. <insert id="addAdminContacts" parameterType="com.goafanti.admin.bo.AdminContacts">
  962. insert into admin_contacts (id,aid,contacts_id)values
  963. (#{id,jdbcType=VARCHAR},#{aid,jdbcType=VARCHAR},#{contactsId,jdbcType=VARCHAR})
  964. </insert>
  965. <select id="frequentContactsList" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminListBo">
  966. select a.id,b.id as contactId,b.name,b.position,b.contact_mobile as contactMobile,c.name as departmentName,y.role_name as roleName
  967. from admin_contacts a left join admin b
  968. on a.contacts_id=b.id left join department c
  969. on c.id=b.department_id left join user_role x on x.uid=b.id
  970. left join `role` y on x.rid=y.id
  971. where b.status ='正常'
  972. <if test="roleName != null">
  973. and y.role_name= #{roleName,jdbcType=VARCHAR}
  974. </if>
  975. <if test="aid != null">
  976. and a.aid= #{aid,jdbcType=VARCHAR}
  977. </if>
  978. <if test="name != null">
  979. and b.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  980. </if>
  981. <if test="depId != null">
  982. and b.department_id= #{depId,jdbcType=VARCHAR}
  983. </if>
  984. <if test="page_sql!=null">
  985. ${page_sql}
  986. </if>
  987. </select>
  988. <select id="frequentContactsCount" parameterType="java.lang.String" resultType="java.lang.Integer">
  989. select count(*)
  990. from admin_contacts a left join admin b
  991. on a.contacts_id=b.id
  992. left join user_role x on x.uid=b.id
  993. left join `role` y on x.rid=y.id
  994. where b.status ='正常'
  995. <if test="roleName != null">
  996. and y.role_name= #{roleName,jdbcType=VARCHAR}
  997. </if>
  998. <if test="aid != null">
  999. and a.aid= #{aid,jdbcType=VARCHAR}
  1000. </if>
  1001. <if test="name != null">
  1002. and b.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1003. </if>
  1004. <if test="depId != null">
  1005. and b.department_id= #{depId,jdbcType=VARCHAR}
  1006. </if>
  1007. </select>
  1008. <delete id="deleteFrequentContacts" parameterType="java.lang.String">
  1009. delete from admin_contacts
  1010. where id = #{id,jdbcType=VARCHAR}
  1011. </delete>
  1012. <select id="getaidFrequentContacts" resultType="java.lang.String">
  1013. select b.id from admin_contacts a left join admin b on a.contacts_id = b.id
  1014. where b.status = '正常' and a.aid= #{id,jdbcType=VARCHAR}
  1015. </select>
  1016. <select id="selectAdminCustomerList" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminCustomerBo">
  1017. select a.id as aid,a.name as aName,d.name as depName,ifnull(b.userCount,0) as userCount,ifnull(c.timeCount,0) as timeCount from admin a
  1018. left join (select aid,count(aid) as userCount from user where aid is not null
  1019. and share_type=0 and source !=0
  1020. group by aid) b on a.id=b.aid
  1021. left join (select aid,count(aid) as timeCount from user where aid is not null
  1022. and share_type=0 and source=1
  1023. <if test="startTime != null and endTime != null">
  1024. and create_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1025. </if>
  1026. group by aid) c on a.id=c.aid
  1027. left join department d on a.department_id=d.id
  1028. where a.status='正常'
  1029. and b.userCount !=0
  1030. <if test="depId != null">
  1031. and a.department_id = #{depId,jdbcType=VARCHAR}
  1032. </if>
  1033. <if test="page_sql!=null">
  1034. ${page_sql}
  1035. </if>
  1036. </select>
  1037. <select id="selectAdminCustomerCount" parameterType="java.lang.String" resultType="java.lang.Integer">
  1038. select count(*) from admin a
  1039. left join (select aid,count(aid) as userCount from user where aid is not null
  1040. and share_type=0 and source !=0
  1041. group by aid) b on a.id=b.aid
  1042. left join (select aid,count(aid) as timeCount from user where aid is not null
  1043. and share_type=0 and source=1
  1044. <if test="startTime != null and endTime != null">
  1045. and create_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1046. </if>
  1047. group by aid) c on a.id=c.aid
  1048. where a.status='正常'
  1049. and b.userCount !=0
  1050. <if test="depId != null">
  1051. and a.department_id = #{depId,jdbcType=VARCHAR}
  1052. </if>
  1053. </select>
  1054. <select id="selectAdminCustomerDetailList" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminCustomerDetailBo">
  1055. select a.id,a.nickname as name,c.contacts,c.contact_mobile as contactMobile,
  1056. a.create_time as createTime,b.time_stamp as followTime
  1057. from user a
  1058. left join (select uid,max(time_stamp) as time_stamp from user_follow group by uid) b on a.id=b.uid
  1059. left join organization_identity c on a.id=c.uid
  1060. where a.aid is not null
  1061. <if test="aid != null">
  1062. and a.aid= #{aid,jdbcType=VARCHAR}
  1063. </if>
  1064. and a.share_type=0 and a.source=1
  1065. <if test="startTime != null and endTime != null">
  1066. and a.create_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1067. </if>
  1068. <if test="page_sql!=null">
  1069. ${page_sql}
  1070. </if>
  1071. </select>
  1072. <select id="selectAdminCustomerDetailCount" parameterType="java.lang.String" resultType="java.lang.Integer">
  1073. select count(*) from user a
  1074. left join (select uid,max(time_stamp) as time_stamp from user_follow group by uid) b on a.id=b.uid
  1075. left join organization_identity c on a.id=c.uid
  1076. where a.aid is not null
  1077. <if test="aid != null">
  1078. and a.aid= #{aid,jdbcType=VARCHAR}
  1079. </if>
  1080. and a.share_type=0 and a.source=1
  1081. <if test="startTime != null and endTime != null">
  1082. and a.create_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1083. </if>
  1084. </select>
  1085. </mapper>