TbClueMapper.xml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.huike.clues.mapper.TbClueMapper">
  6. <resultMap type="TbClue" id="TbClueResult">
  7. <result property="id" column="id" />
  8. <result property="name" column="name" />
  9. <result property="phone" column="phone" />
  10. <result property="channel" column="channel" />
  11. <result property="activityId" column="activity_id" />
  12. <result property="sex" column="sex" />
  13. <result property="age" column="age" />
  14. <result property="weixin" column="weixin" />
  15. <result property="qq" column="qq" />
  16. <result property="level" column="level" />
  17. <result property="subject" column="subject" />
  18. <result property="status" column="status" />
  19. <result property="createTime" column="create_time" />
  20. <result property="createBy" column="create_by" />
  21. <result property="falseCount" column="false_count" />
  22. <result property="nextTime" column="next_time" />
  23. <result property="transfer" column="transfer" />
  24. </resultMap>
  25. <sql id="selectTbClueVo">
  26. select id, name, phone, channel, activity_id, sex, age, weixin, qq, level, subject, status, create_time,
  27. create_by,false_count, next_time,transfer from tb_clue
  28. </sql>
  29. <select id="selectTbCluePoll" parameterType="TbClue" resultMap="TbClueResult">
  30. <include refid="selectTbClueVo"/>
  31. <where>
  32. <if test="id != null and id != ''"> and id = #{id}</if>
  33. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  34. <if test="phone != null and phone != ''"> and phone = #{phone}</if>
  35. <if test="channel != null and channel != ''"> and channel = #{channel}</if>
  36. <if test="activityId != null and activityId != ''"> and activity_id = #{activityId}</if>
  37. <if test="sex != null and sex != ''"> and sex = #{sex}</if>
  38. <if test="age != null "> and age = #{age}</if>
  39. <if test="weixin != null and weixin != ''"> and weixin = #{weixin}</if>
  40. <if test="qq != null and qq != ''"> and qq = #{qq}</if>
  41. <if test="level != null and level != ''"> and level = #{level}</if>
  42. <if test="subject != null and subject != ''"> and subject = #{subject}</if>
  43. <if test="params.beginCreateTime != null and params.beginCreateTime != ''"><!-- 开始创建时间 -->
  44. and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginCreateTime},'%y%m%d')
  45. </if>
  46. <if test="params.endCreateTime != null and params.endCreateTime != ''"><!-- -->
  47. and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endCreateTime},'%y%m%d')
  48. </if>
  49. <if test="nextTime != null "> and next_time = #{nextTime}</if>
  50. and status in ('3','4')
  51. </where>
  52. order by create_time
  53. </select>
  54. <resultMap type="TbClue" id="TbClueAssignResult">
  55. <result property="id" column="id" />
  56. <result property="name" column="name" />
  57. <result property="phone" column="phone" />
  58. <result property="channel" column="channel" />
  59. <result property="activityId" column="activity_id" />
  60. <result property="sex" column="sex" />
  61. <result property="age" column="age" />
  62. <result property="weixin" column="weixin" />
  63. <result property="qq" column="qq" />
  64. <result property="level" column="level" />
  65. <result property="subject" column="subject" />
  66. <result property="status" column="status" />
  67. <result property="createTime" column="create_time" />
  68. <result property="createBy" column="create_by" />
  69. <result property="falseCount" column="false_count" />
  70. <result property="nextTime" column="next_time" />
  71. <result property="assignBy" column="assign_by" />
  72. <result property="owner" column="owner" />
  73. <result property="ownerTime" column="owner_time" />
  74. </resultMap>
  75. <sql id="selectTbClueAssignVo">
  76. select clue.id, clue.name, clue.phone, clue.channel, clue.activity_id, clue.sex, clue.age, clue.weixin, clue.qq,
  77. clue.level, clue.subject, clue.status, clue.create_time,
  78. clue.create_by, clue.next_time,r.create_by as assign_by, r.user_name as owner,r.create_time as owner_time from tb_clue clue
  79. left join tb_assign_record r on clue.id=r.assign_id
  80. </sql>
  81. <select id="selectTbClueList" parameterType="TbClue" resultMap="TbClueAssignResult">
  82. <include refid="selectTbClueAssignVo"/>
  83. <where>
  84. <if test="id != null and id != ''"> and clue.id = #{id}</if>
  85. <if test="name != null and name != ''"> and clue.name like concat('%', #{name}, '%')</if>
  86. <if test="phone != null and phone != ''"> and clue.phone like concat('%',#{phone},'%')</if>
  87. <if test="channel != null and channel != ''"> and clue.channel = #{channel}</if>
  88. <if test="activityId != null and activityId != ''"> and clue.activity_id = #{activityId}</if>
  89. <if test="sex != null and sex != ''"> and clue.sex = #{sex}</if>
  90. <if test="age != null "> and clue.age = #{age}</if>
  91. <if test="weixin != null and weixin != ''"> and clue.weixin = #{weixin}</if>
  92. <if test="qq != null and qq != ''"> and clue.qq = #{qq}</if>
  93. <if test="level != null and level != ''"> and clue.level = #{level}</if>
  94. <if test="subject != null and subject != ''"> and clue.subject = #{subject}</if>
  95. <if test="params.beginCreateTime != null and params.beginCreateTime != ''"><!-- 开始创建时间 -->
  96. and date_format(clue.create_time,'%y%m%d') &gt;= date_format(#{params.beginCreateTime},'%y%m%d')
  97. </if>
  98. <if test="params.endCreateTime != null and params.endCreateTime != ''"><!-- -->
  99. and date_format(clue.create_time,'%y%m%d') &lt;= date_format(#{params.endCreateTime},'%y%m%d')
  100. </if>
  101. <if test="nextTime != null "> and clue.next_time = #{nextTime}</if>
  102. <if test="owner != null and owner != ''"> and r.user_name like concat('%', #{owner}, '%')</if>
  103. <!-- 线索状态没有被查询,这里去掉状态转而添加if -->
  104. <if test="status != null and status !=''"> and clue.status = #{status}</if>
  105. <if test="status == null or status == ''"> and clue.status in ('1','2')</if>
  106. AND (r.latest = '1' OR r.id IS NULL)
  107. AND (r.type = '0' OR r.id IS NULL)
  108. </where>
  109. <!-- 数据范围过滤 -->
  110. <if test="params.dataScope != null and params.dataScope != ''">
  111. AND (${params.dataScope} OR r.id IS NULL)
  112. </if>
  113. order by clue.create_time desc
  114. </select>
  115. <resultMap type="com.huike.clues.domain.vo.ClueReportVo" id="clueReport">
  116. <result property="id" column="id" />
  117. <result property="name" column="name" />
  118. <result property="owner" column="owner" />
  119. <result property="phone" column="phone" />
  120. <result property="channel" column="channel" />
  121. <result property="code" column="code" />
  122. <result property="info" column="info" />
  123. <result property="clueStatus" column="clue_status" />
  124. <result property="clueCreateTime" column="clue_create_time" />
  125. <result property="businessCreateTime" column="business_create_time" />
  126. <result property="businessStatus" column="business_status" />
  127. <result property="contractCreateTime" column="contract_create_time" />
  128. <result property="order" column="contract_order" />
  129. </resultMap>
  130. <select id="selectTbClueForReport" parameterType="TbClue" resultMap="clueReport">
  131. select clue.id, clue.name, clue.phone, clue.channel, clue.activity_id, activity.code as code, activity.name as info,clue.status as clue_status, clue.create_time as clue_create_time,
  132. r.user_name as owner,b.create_time as business_create_time,b.`status` as business_status,c.create_time contract_create_time,c.contract_order from tb_clue clue
  133. left join tb_activity activity on activity.id = clue.activity_id
  134. left join tb_business b on clue.id=b.clue_id
  135. left join tb_contract c on b.id=c.business_id
  136. left join tb_assign_record r on clue.id=r.assign_id
  137. and r.latest = '1' and r.type='0'
  138. <where>
  139. <if test="id != null and id != ''"> and clue.id = #{id}</if>
  140. <if test="name != null and name != ''"> and clue.name like concat('%', #{name}, '%')</if>
  141. <if test="phone != null and phone != ''"> and clue.phone = #{phone}</if>
  142. <if test="channel != null and channel != ''"> and clue.channel = #{channel}</if>
  143. <if test="activityId != null and activityId != ''"> and clue.activity_id = #{activityId}</if>
  144. <if test="sex != null and sex != ''"> and clue.sex = #{sex}</if>
  145. <if test="age != null "> and clue.age = #{age}</if>
  146. <if test="weixin != null and weixin != ''"> and clue.weixin = #{weixin}</if>
  147. <if test="qq != null and qq != ''"> and clue.qq = #{qq}</if>
  148. <if test="level != null and level != ''"> and clue.level = #{level}</if>
  149. <if test="subject != null and subject != ''"> and clue.subject = #{subject}</if>
  150. <if test="params.beginCreateTime != null and params.beginCreateTime != ''"><!-- 开始创建时间 -->
  151. and date_format(clue.create_time,'%y%m%d') &gt;= date_format(#{params.beginCreateTime},'%y%m%d')
  152. </if>
  153. <if test="params.endCreateTime != null and params.endCreateTime != ''"><!-- -->
  154. and date_format(clue.create_time,'%y%m%d') &lt;= date_format(#{params.endCreateTime},'%y%m%d')
  155. </if>
  156. <if test="nextTime != null "> and clue.next_time = #{nextTime}</if>
  157. <if test="owner != null and owner != ''"> and r.user_name like concat('%', #{owner}, '%')</if>
  158. </where>
  159. order by clue.create_time desc
  160. </select>
  161. <!-- <select id="selectTbClueById" parameterType="Long" resultMap="TbClueAssignResult">-->
  162. <!-- <include refid="selectTbClueAssignVo"/>-->
  163. <!-- where clue.id = #{id} and r.latest = '1'-->
  164. <!-- </select>-->
  165. <select id="selectTbClueById" parameterType="Long" resultMap="TbClueResult">
  166. <include refid="selectTbClueVo"/>
  167. where id = #{id}
  168. </select>
  169. <select id="selectClueByIds" parameterType="String" resultMap="TbClueResult">
  170. <include refid="selectTbClueVo"/>
  171. where id in
  172. <foreach item="id" collection="array" open="(" separator="," close=")">
  173. #{id}
  174. </foreach>
  175. </select>
  176. <select id="selectTbClueByPhone" parameterType="String" resultMap="TbClueResult">
  177. <include refid="selectTbClueVo"/>
  178. where phone = #{phone}
  179. </select>
  180. <insert id="insertTbClue" parameterType="TbClue" useGeneratedKeys="true" keyProperty="id">
  181. insert into tb_clue
  182. <trim prefix="(" suffix=")" suffixOverrides=",">
  183. <if test="name != null">name,</if>
  184. <if test="phone != null and phone != ''">phone,</if>
  185. <if test="channel != null and channel != ''">channel,</if>
  186. <if test="activityId != null">activity_id,</if>
  187. <if test="sex != null">sex,</if>
  188. <if test="age != null">age,</if>
  189. <if test="weixin != null">weixin,</if>
  190. <if test="qq != null">qq,</if>
  191. <if test="level != null">level,</if>
  192. <if test="subject != null">subject,</if>
  193. <if test="status != null">status,</if>
  194. <if test="createTime != null">create_time,</if>
  195. <if test="createBy != null">create_by,</if>
  196. <if test="assignBy != null">assign_by,</if>
  197. <if test="owner != null">owner,</if>
  198. <if test="assignTime != null">assign_time,</if>
  199. <if test="falseCount != null">false_count,</if>
  200. <if test="nextTime != null">next_time,</if>
  201. </trim>
  202. <trim prefix="values (" suffix=")" suffixOverrides=",">
  203. <if test="name != null">#{name},</if>
  204. <if test="phone != null and phone != ''">#{phone},</if>
  205. <if test="channel != null and channel != ''">#{channel},</if>
  206. <if test="activityId != null">#{activityId},</if>
  207. <if test="sex != null">#{sex},</if>
  208. <if test="age != null">#{age},</if>
  209. <if test="weixin != null">#{weixin},</if>
  210. <if test="qq != null">#{qq},</if>
  211. <if test="level != null">#{level},</if>
  212. <if test="subject != null">#{subject},</if>
  213. <if test="status != null">#{status},</if>
  214. <if test="createTime != null">#{createTime},</if>
  215. <if test="createBy != null">#{createBy},</if>
  216. <if test="assignBy != null">#{assignBy},</if>
  217. <if test="owner != null">#{owner},</if>
  218. <if test="assignTime != null">#{assignTime},</if>
  219. <if test="falseCount != null">#{falseCount},</if>
  220. <if test="nextTime != null">#{nextTime},</if>
  221. </trim>
  222. </insert>
  223. <update id="updateTbClue" parameterType="TbClue">
  224. update tb_clue
  225. <trim prefix="SET" suffixOverrides=",">
  226. <if test="name != null">name = #{name},</if>
  227. <if test="phone != null and phone != ''">phone = #{phone},</if>
  228. <if test="channel != null and channel != ''">channel = #{channel},</if>
  229. <if test="activityId != null">activity_id = #{activityId},</if>
  230. <if test="sex != null">sex = #{sex},</if>
  231. <if test="age != null">age = #{age},</if>
  232. <if test="weixin != null">weixin = #{weixin},</if>
  233. <if test="qq != null">qq = #{qq},</if>
  234. <if test="level != null">level = #{level},</if>
  235. <if test="subject != null">subject = #{subject},</if>
  236. <if test="status != null">status = #{status},</if>
  237. <if test="owner != null">owner = #{owner},</if>
  238. <if test="createTime != null">create_time = #{createTime},</if>
  239. <if test="createBy != null">create_by = #{createBy},</if>
  240. <if test="assignBy != null">assign_by = #{assignBy},</if>
  241. <if test="assignTime != null">assign_time = #{assignTime},</if>
  242. <if test="falseCount != null">false_count = #{falseCount},</if>
  243. <if test="nextTime != null">next_time = #{nextTime},</if>
  244. </trim>
  245. where id = #{id}
  246. </update>
  247. <update id="resetNextTimeAndStatus">
  248. update tb_clue set next_time=null, status=#{status} where id = #{id}
  249. </update>
  250. <update id="setTransfer">
  251. update tb_clue set next_time=null, status=#{status}, transfer='1' where id = #{id}
  252. </update>
  253. <delete id="deleteTbClueById" parameterType="Long">
  254. delete from tb_clue where id = #{id}
  255. </delete>
  256. <delete id="deleteTbClueByIds" parameterType="String">
  257. delete from tb_clue where id in
  258. <foreach item="id" collection="array" open="(" separator="," close=")">
  259. #{id}
  260. </foreach>
  261. </delete>
  262. <select id="countByActivity" parameterType="TbClue" resultType="java.util.Map">
  263. SELECT
  264. sum(case when t.`status`='4' THEN 1 ELSE 0 END ) AS falseClues,
  265. (SELECT COUNT(b.id) AS total FROM `tb_clue` a LEFT JOIN `tb_business` b ON a.phone = b.phone WHERE a.activity_id=#{activityId} ) AS toBusiness,
  266. count(1) AS total
  267. from tb_clue t
  268. where channel=#{channel} and t.activity_id=#{activityId}
  269. <if test="params.beginCreateTime != null and params.beginCreateTime != ''"><!-- 开始创建时间 -->
  270. and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginCreateTime},'%y%m%d')
  271. </if>
  272. <if test="params.endCreateTime != null and params.endCreateTime != ''"><!-- -->
  273. and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endCreateTime},'%y%m%d')
  274. </if>
  275. </select>
  276. <select id="countAllContractByUser" parameterType="com.huike.clues.domain.vo.IndexStatisticsVo" resultType="java.util.Map">
  277. select clue.create_by, r.dept_id, count(clue.id) as num from tb_clue clue
  278. left join tb_assign_record r
  279. on r.assign_id = clue.id
  280. and r.latest='1' and r.type ='0'
  281. <if test="indexVo.beginCreateTime != null and indexVo.beginCreateTime != ''"><!-- 开始创建时间 -->
  282. where r.`create_time` BETWEEN #{indexVo.beginCreateTime} AND #{indexVo.endCreateTime}
  283. </if>
  284. GROUP BY clue.create_by limit 10
  285. </select>
  286. <update id="updateClueEndTimeById">
  287. update tb_clue set end_time=#{endTime},next_time = null where id = #{id}
  288. </update>
  289. <select id="getCluesNum" resultType="int">
  290. SELECT
  291. IFNULL(COUNT(id), 0)
  292. FROM
  293. `tb_clue`
  294. WHERE id IN
  295. (SELECT
  296. assign_id
  297. FROM
  298. `tb_assign_record`
  299. WHERE `create_time` BETWEEN #{indexVo.beginCreateTime}
  300. AND #{indexVo.endCreateTime}
  301. AND `type` = 0
  302. AND `latest` = 1
  303. AND `user_name` = #{username})
  304. AND `status` IN (1, 2)
  305. </select>
  306. <select id="getcontractsBasicInfo" resultType="java.util.Map">
  307. SELECT
  308. IFNULL(COUNT(id), 0) AS cluesNum, <!-- 线索数量 -->
  309. IFNULL(
  310. (SELECT
  311. COUNT(DISTINCT (id))
  312. FROM
  313. `tb_business`
  314. WHERE id IN
  315. (SELECT
  316. assign_id
  317. FROM
  318. `tb_assign_record`
  319. WHERE `create_time` BETWEEN #{indexVo.beginCreateTime}
  320. AND #{indexVo.endCreateTime}
  321. AND `type` = 1
  322. AND `latest` = 1
  323. AND `user_name` = #{username}) AND `status` IN (1,2)),
  324. 0
  325. ) AS businessNum, <!-- 商机数量 -->
  326. IFNULL(
  327. (SELECT
  328. COUNT(DISTINCT (id))
  329. FROM
  330. `tb_contract`
  331. WHERE `create_time` BETWEEN #{indexVo.beginCreateTime}
  332. AND #{indexVo.endCreateTime}
  333. AND create_by = #{username}
  334. AND `status` = 4),
  335. 0
  336. ) AS contractNum, <!-- 客户数量 -->
  337. IFNULL(
  338. (SELECT
  339. CAST(
  340. SUM(h.`contract_order`) AS DECIMAL (30, 0)
  341. )
  342. FROM
  343. `tb_contract` h
  344. WHERE h.create_by = #{username}
  345. AND h.create_time BETWEEN #{indexVo.beginCreateTime}
  346. AND #{indexVo.endCreateTime}),
  347. 0
  348. ) AS salesAmount, <!-- 销售金额 -->
  349. IFNULL(
  350. (SELECT
  351. COUNT(DISTINCT (id))
  352. FROM
  353. `tb_clue`
  354. WHERE id IN
  355. (SELECT
  356. assign_id
  357. FROM
  358. `tb_assign_record`
  359. WHERE user_name = #{username}
  360. AND DATE_FORMAT(create_time, '%Y-%m-%d') = #{now}
  361. AND latest = 1
  362. AND `type` = 0)),
  363. 0
  364. ) AS todayCluesNum, <!-- 今日新增线索 -->
  365. IFNULL(
  366. (SELECT
  367. COUNT(DISTINCT (id))
  368. FROM
  369. `tb_business`
  370. WHERE id IN
  371. (SELECT
  372. assign_id
  373. FROM
  374. `tb_assign_record`
  375. WHERE user_name = #{username}
  376. AND DATE_FORMAT(create_time, '%Y-%m-%d') = #{now}
  377. AND latest = 1
  378. AND `type` = 1)),
  379. 0
  380. ) AS todayBusinessNum, <!-- 今日新增商机数量 -->
  381. IFNULL(
  382. (SELECT
  383. COUNT(id)
  384. FROM
  385. `tb_contract`
  386. WHERE create_by = #{username}
  387. AND DATE_FORMAT(create_time, '%Y-%m-%d') = #{now}
  388. AND `status` = 4),
  389. 0
  390. ) AS todayContractNum, <!-- 今日新增客户数 -->
  391. IFNULL(
  392. (SELECT
  393. CAST(
  394. SUM(`contract_order`) AS DECIMAL (30, 0)
  395. )
  396. FROM
  397. `tb_contract`
  398. WHERE create_by = #{username}
  399. AND DATE_FORMAT(create_time, '%Y-%m-%d') = #{now}),
  400. 0
  401. ) AS todaySalesAmount, <!-- 今日销售额 -->
  402. IFNULL(
  403. (SELECT
  404. COUNT(DISTINCT (id))
  405. FROM
  406. `tb_clue`
  407. WHERE id IN
  408. (SELECT
  409. assign_id
  410. FROM
  411. `tb_assign_record`
  412. WHERE user_name = #{username}
  413. AND create_time BETWEEN #{indexVo.beginCreateTime}
  414. AND #{indexVo.endCreateTime}
  415. AND latest = 1
  416. AND `type` = 0)
  417. AND `status` = 1),
  418. 0
  419. ) AS tofollowedCluesNum, <!-- 待跟进线索 -->
  420. IFNULL(
  421. (SELECT
  422. COUNT(DISTINCT (id))
  423. FROM
  424. `tb_business`
  425. WHERE id IN
  426. (SELECT
  427. assign_id
  428. FROM
  429. `tb_assign_record`
  430. WHERE user_name = #{username}
  431. AND create_time BETWEEN #{indexVo.beginCreateTime}
  432. AND #{indexVo.endCreateTime}
  433. AND latest = 1
  434. AND `type` = 1)
  435. AND `status` = 1),
  436. 0
  437. ) AS tofollowedBusinessNum <!-- 待跟进商机 -->
  438. <if test="username == 'admin'">
  439. ,IFNULL(
  440. (SELECT
  441. COUNT(DISTINCT (id))
  442. FROM
  443. `tb_clue`
  444. WHERE id NOT IN
  445. (SELECT
  446. assign_id
  447. FROM
  448. `tb_assign_record`
  449. WHERE create_time BETWEEN #{indexVo.beginCreateTime}
  450. AND #{indexVo.endCreateTime}
  451. AND latest = 1
  452. AND `type` = 0)
  453. AND create_time BETWEEN #{indexVo.beginCreateTime}
  454. AND #{indexVo.endCreateTime}),
  455. 0
  456. ) AS toallocatedCluesNum, <!-- 待分配线索 -->
  457. IFNULL(
  458. (SELECT
  459. COUNT(DISTINCT (id))
  460. FROM
  461. `tb_business`
  462. WHERE id NOT IN
  463. (SELECT
  464. assign_id
  465. FROM
  466. `tb_assign_record`
  467. WHERE create_time BETWEEN #{indexVo.beginCreateTime}
  468. AND #{indexVo.endCreateTime}
  469. AND latest = 1
  470. AND `type` = 1)
  471. AND create_time BETWEEN #{indexVo.beginCreateTime}
  472. AND #{indexVo.endCreateTime}),
  473. 0
  474. ) AS toallocatedBusinessNum <!-- 待分配商机 -->
  475. </if>
  476. FROM
  477. `tb_clue`
  478. WHERE id IN
  479. (SELECT
  480. assign_id
  481. FROM
  482. `tb_assign_record`
  483. WHERE `create_time` BETWEEN #{indexVo.beginCreateTime}
  484. AND #{indexVo.endCreateTime}
  485. AND `type` = 0
  486. AND `latest` = 1
  487. AND `user_name` = #{username})
  488. AND `status` IN (1,2)
  489. </select>
  490. </mapper>