JlServiceUserMapper.xml 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.ygj.yuemum.dao.maternitymatron.JlServiceUserDao">
  4. <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.maternitymatron.JlServiceUser">
  5. <id column="id" property="id" jdbcType="INTEGER"/>
  6. <result column="password" property="password" jdbcType="VARCHAR"/>
  7. <result column="truename" property="truename" jdbcType="VARCHAR"/>
  8. <result column="mobile_phone" property="mobile_phone" jdbcType="VARCHAR"/>
  9. <result column="status" property="status" jdbcType="VARCHAR"/>
  10. <result column="last_login_time" property="last_login_time" jdbcType="DATE"/>
  11. <result column="last_login_ip" property="last_login_ip" jdbcType="VARCHAR"/>
  12. <result column="salt" property="salt" jdbcType="VARCHAR"/>
  13. <result column="token" property="token" jdbcType="VARCHAR"/>
  14. <result column="zone_code" property="zone_code" jdbcType="VARCHAR"/>
  15. <result column="updated_at" property="updated_at" jdbcType="DATE"/>
  16. <result column="stock_status" property="stock_status" jdbcType="INTEGER"/>
  17. <result column="usertype" property="usertype" jdbcType="VARCHAR"/>
  18. <!--list add-->
  19. <result column="age" property="age" jdbcType="VARCHAR"/>
  20. <result column="idcard" property="idcard" jdbcType="VARCHAR"/>
  21. <result column="cityname" property="cityname" jdbcType="VARCHAR"/>
  22. <result column="np" property="np" jdbcType="VARCHAR"/>
  23. <!--query add-->
  24. <result column="experience" property="experience" jdbcType="VARCHAR"/>
  25. <result column="gender" property="gender" jdbcType="VARCHAR"/>
  26. </resultMap>
  27. <resultMap id="ListResultMap" type="com.ygj.yuemum.domain.maternitymatron.JlServiceUser">
  28. <id column="id" property="id" jdbcType="INTEGER"/>
  29. <result column="truename" property="truename" jdbcType="VARCHAR"/>
  30. <result column="status" property="status" jdbcType="VARCHAR"/>
  31. <!--list add-->
  32. <result column="age" property="age" jdbcType="VARCHAR"/>
  33. <result column="idcard" property="idcard" jdbcType="VARCHAR"/>
  34. <result column="cityname" property="cityname" jdbcType="VARCHAR"/>
  35. <result column="np" property="np" jdbcType="VARCHAR"/>
  36. </resultMap>
  37. <resultMap id="queryStockResultMap" type="com.ygj.yuemum.domain.maternitymatron.JlServiceUser">
  38. <id column="id" property="id" jdbcType="INTEGER"/>
  39. <result column="salt" property="salt" jdbcType="VARCHAR"/>
  40. <result column="truename" property="truename" jdbcType="VARCHAR"/>
  41. <result column="idcard" property="idcard" jdbcType="VARCHAR"/>
  42. <result column="age" property="age" jdbcType="VARCHAR"/>
  43. <result column="status" property="status" jdbcType="VARCHAR"/>
  44. <result column="cityname" property="cityname" jdbcType="VARCHAR"/>
  45. <result column="np" property="np" jdbcType="VARCHAR"/>
  46. <result column="constellation" property="constellation" jdbcType="VARCHAR"/>
  47. <result column="zodiac" property="zodiac" jdbcType="VARCHAR"/>
  48. <result column="seniority" property="seniority" jdbcType="VARCHAR"/>
  49. <result column="gender" property="gender" jdbcType="VARCHAR"/>
  50. <result column="babynumber" property="babynumber" jdbcType="VARCHAR"/>
  51. <!--4.14增加查询条件-->
  52. <result column="ethnicgroup" property="ethnicgroup" jdbcType="VARCHAR"/>
  53. <result column="education" property="education" jdbcType="VARCHAR"/>
  54. <result column="height" property="height" jdbcType="VARCHAR"/>
  55. <result column="marriage" property="marriage" jdbcType="VARCHAR"/>
  56. <result column="highlight" property="highlight" jdbcType="VARCHAR"/>
  57. <result column="citycode" property="citycode" jdbcType="VARCHAR"/>
  58. <result column="weight" property="weight" jdbcType="VARCHAR"/>
  59. <result column="city" property="city" jdbcType="VARCHAR"/>
  60. <result column="resume_path" property="resume_path" jdbcType="VARCHAR"/>
  61. </resultMap>
  62. <sql id="Base_Column_List">
  63. id, password, truename,mobile_phone,status,last_login_time,last_login_ip,salt,token,zone_code,updated_at,stock_status,usertype
  64. </sql>
  65. <!--获取所有数据-->
  66. <select id="getcount" resultType="java.lang.Integer" >
  67. select
  68. count(1)
  69. from jl_service_user
  70. </select>
  71. <select id="getstocklistcount" resultType="java.lang.Integer" >
  72. select
  73. count(1)
  74. from jl_service_user
  75. where jl_service_user.status = 1
  76. </select>
  77. <select id="getStock" resultType="java.lang.Integer" parameterType="com.ygj.yuemum.domain.maternitymatron.QueryServiceUser">
  78. select
  79. count(1)
  80. from jl_service_user
  81. LEFT JOIN jl_service_user_info on jl_service_user.id = jl_service_user_info.id
  82. LEFT JOIN (select service_id,GROUP_CONCAT(jl_region.`name`) cityname,GROUP_CONCAT(store_id) citycode from jl_store_service LEFT JOIN jl_region
  83. on jl_store_service.store_id = jl_region.`code` group by service_id) as
  84. city ON jl_service_user.id = city.service_id
  85. where 1=1
  86. <if test="ids != null and ids != ''">
  87. and jl_service_user.id not in ( #{ids,jdbcType=INTEGER} )
  88. </if>
  89. <if test="id != null and id != ''">
  90. and jl_service_user.id = #{id,jdbcType=INTEGER}
  91. </if>
  92. <if test="salt != null and salt !=''">
  93. and jl_service_user.salt like "%"#{salt,jdbcType=VARCHAR}"%"
  94. </if>
  95. <if test="truename != null and truename !=''">
  96. and jl_service_user.truename like "%"#{truename,jdbcType=VARCHAR}"%"
  97. </if>
  98. <if test="constellation != null and constellation !=''">
  99. and constellation like "%"#{constellation,jdbcType=VARCHAR}"%"
  100. </if>
  101. <if test="zodiac != null and zodiac !=''">
  102. and zodiac = #{zodiac,jdbcType=VARCHAR}
  103. </if>
  104. <if test="np != null and np !=''">
  105. and city = #{np,jdbcType=VARCHAR}
  106. </if>
  107. <if test="experience != null and experience != 0">
  108. and seniority = #{experience,jdbcType=VARCHAR}
  109. </if>
  110. <if test="gender != null and gender !=''">
  111. and gender = #{gender,jdbcType=VARCHAR}
  112. </if>
  113. <if test="status != null and status !=''">
  114. and status = #{status,jdbcType=VARCHAR}
  115. </if>
  116. <if test="gender != null and gender !=''">
  117. and gender = #{gender,jdbcType=VARCHAR}
  118. </if>
  119. <if test="babynumber != null and babynumber !=''">
  120. and babynumber = #{babynumber,jdbcType=VARCHAR}
  121. </if>
  122. <if test="cityname != null ">
  123. and citycode like "%"#{cityname,jdbcType=VARCHAR}"%"
  124. </if>
  125. <if test="ethnicgroup != null ">
  126. and ethnicgroup = #{ethnicgroup,jdbcType=VARCHAR}
  127. </if>
  128. <if test="education != null ">
  129. and education = #{education,jdbcType=VARCHAR}
  130. </if>
  131. <if test="height != null ">
  132. and height = #{height,jdbcType=VARCHAR}
  133. </if>
  134. <if test="marriage != null ">
  135. and marriage = #{marriage,jdbcType=VARCHAR}
  136. </if>
  137. <if test="highlight != null ">
  138. and highlight like "%"#{highlight,jdbcType=VARCHAR}"%"
  139. </if>
  140. <if test="weight != null ">
  141. and weight = #{weight,jdbcType=VARCHAR}
  142. </if>
  143. <if test="agestart != null and ageend != null ">
  144. and year(CURDATE())-substring(jl_service_user_info.idcard,7,4) &gt;= #{agestart,jdbcType=VARCHAR}
  145. and year(CURDATE())-substring(jl_service_user_info.idcard,7,4) &lt;= #{ageend,jdbcType=VARCHAR}
  146. </if>
  147. <!--age-->
  148. </select>
  149. <!--获取主键-->
  150. <select id="getpmid" resultType="java.lang.Integer" >
  151. SELECT auto_increment
  152. FROM information_schema.tables
  153. where table_schema="yuemum"
  154. and table_name="jl_service_user";
  155. </select>
  156. <select id="getquerycount" resultType="java.lang.Integer" parameterType="com.ygj.yuemum.domain.maternitymatron.QueryServiceUser">
  157. select
  158. count(1)
  159. from jl_service_user
  160. LEFT JOIN jl_service_user_info on jl_service_user.id = jl_service_user_info.id
  161. LEFT JOIN (select service_id,GROUP_CONCAT(jl_region.`name`) cityname,GROUP_CONCAT(store_id) citycode from jl_store_service LEFT JOIN jl_region
  162. on jl_store_service.store_id = jl_region.`code` group by service_id) as
  163. city ON jl_service_user.id = city.service_id
  164. where 1=1
  165. <if test="id != null and id != ''">
  166. and jl_service_user.id = #{id,jdbcType=INTEGER}
  167. </if>
  168. <if test="truename != null and truename != ''">
  169. and jl_service_user.truename like "%"#{truename,jdbcType=VARCHAR}"%"
  170. </if>
  171. <if test="status != null and status != ''">
  172. and status = #{status,jdbcType=VARCHAR}
  173. </if>
  174. <if test="idcard != null and idcard != ''">
  175. and idcard = #{idcard,jdbcType=VARCHAR}
  176. </if>
  177. <if test="cityname != null and cityname != ''">
  178. and citycode like "%"#{cityname,jdbcType=VARCHAR}"%"
  179. </if>
  180. <if test="np != null and np != ''">
  181. and city = #{np,jdbcType=VARCHAR}
  182. </if>
  183. <if test="experience != null and experience != 0">
  184. and seniority = #{experience,jdbcType=VARCHAR}
  185. </if>
  186. <if test="gender != null and gender != ''">
  187. and gender = #{gender,jdbcType=VARCHAR}
  188. </if>
  189. <if test="salt != null and salt != ''">
  190. and salt like "%"#{salt,jdbcType=VARCHAR}"%"
  191. </if>
  192. </select>
  193. <!--getList-->
  194. <select id="getMMList" resultMap="ListResultMap">
  195. select
  196. jl_service_user.id,
  197. jl_service_user.truename,
  198. year(CURDATE())-substring(jl_service_user_info.idcard,7,4) age,
  199. jl_service_user_info.idcard,
  200. city.cityname,
  201. fgetcityname(CONCAT(substring(jl_service_user_info.idcard,1,4),'00')) np,
  202. jl_service_user.status,
  203. jl_service_user.salt
  204. from jl_service_user
  205. LEFT JOIN jl_service_user_info on jl_service_user.id = jl_service_user_info.id
  206. LEFT JOIN (select service_id,GROUP_CONCAT(jl_region.`name`) cityname from jl_store_service LEFT JOIN jl_region
  207. on jl_store_service.store_id = jl_region.`code` group by service_id) as
  208. city ON jl_service_user.id = city.service_id
  209. order by id
  210. </select>
  211. <select id="queryServiceUserStock" resultMap="queryStockResultMap">
  212. select
  213. jl_service_user.id,
  214. jl_service_user.salt,
  215. jl_service_user.truename,
  216. fgetconstellationname(jl_service_user_info.constellation) constellation,
  217. year(CURDATE())-substring(jl_service_user_info.idcard,7,4) age,
  218. fgetzodiacname(jl_service_user_info.zodiac) zodiac,
  219. fgetcityname(CONCAT(substring(jl_service_user_info.idcard,1,4),'00')) np,
  220. city.cityname,
  221. jl_service_user_info.seniority,
  222. jl_service_user_info.gender,
  223. jl_service_user.status,
  224. jl_service_user_info.babynumber,
  225. IFNULL(mm_info_resume.resume_path,0) resume_path,
  226. fgetethnicgroupname(jl_service_user_info.ethnicgroup) ethnicgroup
  227. from jl_service_user
  228. LEFT JOIN jl_service_user_info on jl_service_user.id = jl_service_user_info.id
  229. LEFT JOIN (select service_id,GROUP_CONCAT(jl_region.`name`) cityname from jl_store_service LEFT JOIN jl_region
  230. on jl_store_service.store_id = jl_region.`code` group by service_id) as
  231. city ON jl_service_user.id = city.service_id
  232. left join mm_info_resume on jl_service_user.id = mm_info_resume.servant_code
  233. where jl_service_user.status = 1
  234. order by gender desc , babynumber desc , status asc
  235. </select>
  236. <select id="queryMMList" resultMap="ListResultMap" parameterType="com.ygj.yuemum.domain.maternitymatron.QueryServiceUserStock">
  237. select
  238. jl_service_user.id,
  239. jl_service_user.truename,
  240. year(CURDATE())-substring(jl_service_user_info.idcard,7,4) age,
  241. jl_service_user_info.idcard,
  242. city.cityname,
  243. fgetcityname(CONCAT(substring(jl_service_user_info.idcard,1,4),'00')) np,
  244. jl_service_user.status,
  245. jl_service_user.salt
  246. from jl_service_user
  247. LEFT JOIN jl_service_user_info on jl_service_user.id = jl_service_user_info.id
  248. LEFT JOIN (select service_id,GROUP_CONCAT(jl_region.`name`) cityname,GROUP_CONCAT(store_id) citycode from jl_store_service LEFT JOIN jl_region
  249. on jl_store_service.store_id = jl_region.`code` group by service_id) as
  250. city ON jl_service_user.id = city.service_id
  251. where 1=1
  252. <if test="id != null and id !=''">
  253. and jl_service_user.id = #{id,jdbcType=INTEGER}
  254. </if>
  255. <if test="truename != null">
  256. and jl_service_user.truename like "%"#{truename,jdbcType=VARCHAR}"%"
  257. </if>
  258. <if test="status != null ">
  259. and status = #{status,jdbcType=VARCHAR}
  260. </if>
  261. <if test="idcard != null ">
  262. and idcard = #{idcard,jdbcType=VARCHAR}
  263. </if>
  264. <if test="cityname != null ">
  265. and citycode like "%"#{cityname,jdbcType=VARCHAR}"%"
  266. </if>
  267. <if test="np != null ">
  268. and city = #{np,jdbcType=VARCHAR}
  269. </if>
  270. <if test="experience != null and experience != 0">
  271. and seniority = #{experience,jdbcType=VARCHAR}
  272. </if>
  273. <if test="gender != null ">
  274. and gender = #{gender,jdbcType=VARCHAR}
  275. </if>
  276. <if test="salt != null and salt !=''">
  277. and salt like "%"#{salt,jdbcType=VARCHAR}"%"
  278. </if>
  279. order by id
  280. </select>
  281. <select id="getResume" resultMap="queryStockResultMap" parameterType="java.lang.Integer" >
  282. select
  283. jl_service_user.id,
  284. jl_service_user.truename,
  285. fgetconstellationname(jl_service_user_info.constellation) constellation,
  286. year(CURDATE())-substring(jl_service_user_info.idcard,7,4) age,
  287. fgetzodiacname(jl_service_user_info.zodiac) zodiac,
  288. fgetcityname(CONCAT(substring(jl_service_user_info.idcard,1,4),'00')) np,
  289. city.cityname,
  290. jl_service_user_info.seniority,
  291. jl_service_user_info.gender,
  292. jl_service_user_info.babynumber,
  293. fgetethnicgroupname(jl_service_user_info.ethnicgroup) ethnicgroup,
  294. CASE jl_service_user_info.education WHEN '1' THEN '初中' WHEN '2' THEN '高中' WHEN '3' THEN '大专' WHEN '4' THEN '大本' WHEN '5' THEN '硕士' ELSE 'NAN' END as education,
  295. jl_service_user_info.height,
  296. CASE jl_service_user_info.marriage WHEN 'Y' THEN '已婚' WHEN 'N' THEN '未婚' ELSE 'NAN' END AS marriage ,
  297. jl_service_user_info.highlight,
  298. jl_service_user_info.weight
  299. from jl_service_user
  300. LEFT JOIN jl_service_user_info on jl_service_user.id = jl_service_user_info.id
  301. LEFT JOIN (select service_id,GROUP_CONCAT(jl_region.`name`) cityname,GROUP_CONCAT(store_id) citycode from jl_store_service LEFT JOIN jl_region
  302. on jl_store_service.store_id = jl_region.`code` group by service_id) as
  303. city ON jl_service_user.id = city.service_id
  304. where
  305. jl_service_user.id = #{id,jdbcType=INTEGER}
  306. </select>
  307. <select id="queryServiceUserStockCondition" resultMap="queryStockResultMap" parameterType="com.ygj.yuemum.domain.maternitymatron.QueryServiceUser">
  308. select
  309. jl_service_user.id,
  310. jl_service_user.salt,
  311. jl_service_user.truename,
  312. fgetconstellationname(jl_service_user_info.constellation) constellation,
  313. jl_service_user_info.idcard,
  314. year(CURDATE())-substring(jl_service_user_info.idcard,7,4) age,
  315. fgetzodiacname(jl_service_user_info.zodiac) zodiac,
  316. fgetcityname(CONCAT(substring(jl_service_user_info.idcard,1,4),'00')) np,
  317. city.cityname,
  318. jl_service_user_info.seniority,
  319. jl_service_user_info.gender,
  320. jl_service_user_info.city,
  321. jl_service_user.status,
  322. jl_service_user_info.babynumber,
  323. fgetethnicgroupname(jl_service_user_info.ethnicgroup) ethnicgroup,
  324. jl_service_user_info.education,
  325. jl_service_user_info.height,
  326. jl_service_user_info.marriage,
  327. jl_service_user_info.highlight,
  328. jl_service_user_info.weight,
  329. city.citycode,
  330. IFNULL(mm_info_resume.resume_path,0) resume_path
  331. from jl_service_user
  332. LEFT JOIN jl_service_user_info on jl_service_user.id = jl_service_user_info.id
  333. LEFT JOIN (select service_id,GROUP_CONCAT(jl_region.`name`) cityname,GROUP_CONCAT(store_id) citycode from jl_store_service LEFT JOIN jl_region
  334. on jl_store_service.store_id = jl_region.`code` group by service_id) as
  335. city ON jl_service_user.id = city.service_id
  336. left join mm_info_resume on jl_service_user.id = mm_info_resume.servant_code
  337. where 1=1
  338. <if test="ids != null and id !=''">
  339. and FIND_IN_SET(jl_service_user.id,#{ids,jdbcType=INTEGER}) = 0
  340. </if>
  341. <if test="salt != null and salt !=''">
  342. and jl_service_user.salt like "%"#{salt,jdbcType=VARCHAR}"%"
  343. </if>
  344. <if test="truename != null ">
  345. and jl_service_user.truename like "%"#{truename,jdbcType=VARCHAR}"%"
  346. </if>
  347. <if test="constellation != null ">
  348. and constellation like "%"#{constellation,jdbcType=VARCHAR}"%"
  349. </if>
  350. <if test="zodiac != null ">
  351. and zodiac = #{zodiac,jdbcType=VARCHAR}
  352. </if>
  353. <if test="np != null ">
  354. and city = #{np,jdbcType=VARCHAR}
  355. </if>
  356. <if test="experience != null and experience != 0">
  357. and seniority = #{experience,jdbcType=VARCHAR}
  358. </if>
  359. <if test="gender != null ">
  360. and gender = #{gender,jdbcType=VARCHAR}
  361. </if>
  362. <if test="status != null ">
  363. and status = #{status,jdbcType=VARCHAR}
  364. </if>
  365. <if test="gender != null ">
  366. and gender = #{gender,jdbcType=VARCHAR}
  367. </if>
  368. <if test="babynumber != null ">
  369. and babynumber = #{babynumber,jdbcType=VARCHAR}
  370. </if>
  371. <if test="cityname != null ">
  372. and citycode like "%"#{cityname,jdbcType=VARCHAR}"%"
  373. </if>
  374. <if test="ethnicgroup != null ">
  375. and ethnicgroup = #{ethnicgroup,jdbcType=VARCHAR}
  376. </if>
  377. <if test="education != null ">
  378. and education = #{education,jdbcType=VARCHAR}
  379. </if>
  380. <if test="height != null ">
  381. and height = #{height,jdbcType=VARCHAR}
  382. </if>
  383. <if test="marriage != null ">
  384. and marriage = #{marriage,jdbcType=VARCHAR}
  385. </if>
  386. <if test="highlight != null ">
  387. and highlight like "%"#{highlight,jdbcType=VARCHAR}"%"
  388. </if>
  389. <if test="weight != null ">
  390. and weight = #{weight,jdbcType=VARCHAR}
  391. </if>
  392. <if test="agestart != null and ageend != null ">
  393. and year(CURDATE())-substring(jl_service_user_info.idcard,7,4) &gt;= #{agestart,jdbcType=VARCHAR}
  394. and year(CURDATE())-substring(jl_service_user_info.idcard,7,4) &lt;= #{ageend,jdbcType=VARCHAR}
  395. </if>
  396. <!--age-->
  397. order by gender desc , babynumber desc , status asc
  398. </select>
  399. <select id="queryEditServiceUser" resultMap="queryStockResultMap" parameterType="com.ygj.yuemum.domain.maternitymatron.QueryServiceUser">
  400. select
  401. jl_service_user.id,
  402. jl_service_user.salt,
  403. jl_service_user.truename,
  404. jl_service_user_info.constellation,
  405. jl_service_user_info.idcard,
  406. year(CURDATE())-substring(jl_service_user_info.idcard,7,4) age,
  407. jl_service_user_info.zodiac,
  408. fgetcityname(CONCAT(substring(jl_service_user_info.idcard,1,4),'00')) np,
  409. city.cityname,
  410. jl_service_user_info.seniority,
  411. jl_service_user_info.gender,
  412. jl_service_user_info.city,
  413. jl_service_user.status,
  414. jl_service_user_info.babynumber,
  415. jl_service_user_info.ethnicgroup,
  416. jl_service_user_info.education,
  417. jl_service_user_info.height,
  418. jl_service_user_info.marriage,
  419. jl_service_user_info.highlight,
  420. jl_service_user_info.weight,
  421. city.citycode,
  422. IFNULL(mm_info_resume.resume_path,0) resume_path
  423. from jl_service_user
  424. LEFT JOIN jl_service_user_info on jl_service_user.id = jl_service_user_info.id
  425. LEFT JOIN (select service_id,GROUP_CONCAT(jl_region.`name`) cityname,GROUP_CONCAT(store_id) citycode from jl_store_service LEFT JOIN jl_region
  426. on jl_store_service.store_id = jl_region.`code` group by service_id) as
  427. city ON jl_service_user.id = city.service_id
  428. left join mm_info_resume on jl_service_user.id = mm_info_resume.servant_code
  429. where 1=1
  430. <if test="ids != null ">
  431. and jl_service_user.id not in ( #{ids,jdbcType=INTEGER} )
  432. </if>
  433. <if test="id != null and id !=''">
  434. and jl_service_user.id = #{id,jdbcType=INTEGER}
  435. </if>
  436. <if test="truename != null ">
  437. and jl_service_user.truename like "%"#{truename,jdbcType=VARCHAR}"%"
  438. </if>
  439. <if test="constellation != null ">
  440. and constellation like "%"#{constellation,jdbcType=VARCHAR}"%"
  441. </if>
  442. <if test="zodiac != null ">
  443. and zodiac = #{zodiac,jdbcType=VARCHAR}
  444. </if>
  445. <if test="np != null ">
  446. and city = #{np,jdbcType=VARCHAR}
  447. </if>
  448. <if test="experience != null and experience != 0">
  449. and seniority = #{experience,jdbcType=VARCHAR}
  450. </if>
  451. <if test="gender != null ">
  452. and gender = #{gender,jdbcType=VARCHAR}
  453. </if>
  454. <if test="status != null ">
  455. and status = #{status,jdbcType=VARCHAR}
  456. </if>
  457. <if test="gender != null ">
  458. and gender = #{gender,jdbcType=VARCHAR}
  459. </if>
  460. <if test="babynumber != null ">
  461. and babynumber = #{babynumber,jdbcType=VARCHAR}
  462. </if>
  463. <if test="cityname != null ">
  464. and citycode like "%"#{cityname,jdbcType=VARCHAR}"%"
  465. </if>
  466. <if test="ethnicgroup != null ">
  467. and ethnicgroup = #{ethnicgroup,jdbcType=VARCHAR}
  468. </if>
  469. <if test="education != null ">
  470. and education = #{education,jdbcType=VARCHAR}
  471. </if>
  472. <if test="height != null ">
  473. and height = #{height,jdbcType=VARCHAR}
  474. </if>
  475. <if test="marriage != null ">
  476. and marriage = #{marriage,jdbcType=VARCHAR}
  477. </if>
  478. <if test="highlight != null ">
  479. and highlight like "%"#{highlight,jdbcType=VARCHAR}"%"
  480. </if>
  481. <if test="weight != null ">
  482. and weight = #{weight,jdbcType=VARCHAR}
  483. </if>
  484. <if test="agestart != null and ageend != null ">
  485. and year(CURDATE())-substring(jl_service_user_info.idcard,7,4) &gt;= #{agestart,jdbcType=VARCHAR}
  486. and year(CURDATE())-substring(jl_service_user_info.idcard,7,4) &lt;= #{ageend,jdbcType=VARCHAR}
  487. </if>
  488. <!--age-->
  489. order by gender desc , babynumber desc , status asc
  490. </select>
  491. <!-- 得到所有的月嫂信息 -->
  492. <select id="getAll" resultMap="BaseResultMap">
  493. select
  494. <include refid="Base_Column_List"/>
  495. from jl_service_user
  496. </select>
  497. <select id="saltcheck" resultType="java.lang.Integer" parameterType="java.lang.String">
  498. select
  499. count(1)
  500. from jl_service_user
  501. where salt = #{salt,jdbcType=VARCHAR}
  502. </select>
  503. <!-- 根据id查找某个月嫂信息 -->
  504. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
  505. select
  506. <include refid="Base_Column_List"/>
  507. from jl_service_user
  508. where id = #{id,jdbcType=INTEGER}
  509. </select>
  510. <!-- 根据id删除某个月嫂信息 -->
  511. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  512. delete from jl_service_user
  513. where id = #{id,jdbcType=INTEGER}
  514. </delete>
  515. <!-- 插入一条月嫂信息 -->
  516. <insert id="insertSelective" parameterType="com.ygj.yuemum.domain.maternitymatron.JlServiceUser">
  517. insert into jl_service_user
  518. <trim prefix="(" suffix=")" suffixOverrides=",">
  519. <if test="password != null">
  520. password,
  521. </if>
  522. <if test="truename != null">
  523. truename,
  524. </if>
  525. <if test="mobile_phone != null">
  526. mobile_phone,
  527. </if>
  528. <if test="status != null">
  529. status,
  530. </if>
  531. <if test="last_login_time != null">
  532. last_login_time,
  533. </if>
  534. <if test="last_login_ip != null">
  535. last_login_ip,
  536. </if>
  537. <if test="salt != null">
  538. salt,
  539. </if>
  540. <if test="token != null">
  541. token,
  542. </if>
  543. <if test="zone_code != null">
  544. zone_code,
  545. </if>
  546. <if test="updated_at != null">
  547. updated_at,
  548. </if>
  549. <if test="stock_status != null">
  550. stock_status,
  551. </if>
  552. <if test="usertype != null">
  553. usertype
  554. </if>
  555. </trim>
  556. <trim prefix="values (" suffix=")" suffixOverrides=",">
  557. <if test="password != null">
  558. #{password,jdbcType=VARCHAR},
  559. </if>
  560. <if test="truename != null">
  561. #{truename,jdbcType=VARCHAR},
  562. </if>
  563. <if test="mobile_phone != null">
  564. #{mobile_phone,jdbcType=VARCHAR},
  565. </if>
  566. <if test="status != null">
  567. #{status,jdbcType=VARCHAR},
  568. </if>
  569. <if test="last_login_time != null">
  570. #{last_login_time,jdbcType=DATE},
  571. </if>
  572. <if test="last_login_ip != null">
  573. #{last_login_ip,jdbcType=VARCHAR},
  574. </if>
  575. <if test="salt != null">
  576. #{salt,jdbcType=VARCHAR},
  577. </if>
  578. <if test="token != null">
  579. #{token,jdbcType=VARCHAR},
  580. </if>
  581. <if test="zone_code != null">
  582. #{zone_code,jdbcType=VARCHAR},
  583. </if>
  584. <if test="updated_at != null">
  585. #{updated_at,jdbcType=DATE},
  586. </if>
  587. <if test="stock_status != null">
  588. #{stock_status,jdbcType=INTEGER},
  589. </if>
  590. <if test="usertype != null">
  591. #{usertype,jdbcType=VARCHAR}
  592. </if>
  593. </trim>
  594. </insert>
  595. <!-- 根据id更新一条月嫂信息 -->
  596. <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.domain.maternitymatron.JlServiceUser">
  597. update jl_service_user
  598. <set>
  599. <if test="password != null">
  600. password = #{password,jdbcType=VARCHAR},
  601. </if>
  602. <if test="truename != null">
  603. truename = #{truename,jdbcType=VARCHAR},
  604. </if>
  605. <if test="mobile_phone != null">
  606. mobile_phone = #{mobile_phone,jdbcType=VARCHAR},
  607. </if>
  608. <if test="status != null">
  609. status = #{status,jdbcType=VARCHAR},
  610. </if>
  611. <if test="last_login_time != null">
  612. last_login_time = #{last_login_time,jdbcType=DATE},
  613. </if>
  614. <if test="last_login_ip != null">
  615. last_login_ip = #{last_login_ip,jdbcType=VARCHAR},
  616. </if>
  617. <if test="salt != null">
  618. salt = #{salt,jdbcType=VARCHAR},
  619. </if>
  620. <if test="token != null">
  621. token = #{token,jdbcType=VARCHAR},
  622. </if>
  623. <if test="zone_code != null">
  624. zone_code = #{zone_code,jdbcType=VARCHAR},
  625. </if>
  626. <if test="updated_at != null">
  627. updated_at = #{updated_at,jdbcType=DATE},
  628. </if>
  629. <if test="stock_status != null">
  630. stock_status = #{stock_status,jdbcType=INTEGER},
  631. </if>
  632. <if test="usertype != null">
  633. usertype = #{usertype,jdbcType=VARCHAR}
  634. </if>
  635. </set>
  636. where id = #{id,jdbcType=INTEGER}
  637. </update>
  638. <update id="upDateStatus" parameterType="com.ygj.yuemum.domain.maternitymatron.JlServiceUser">
  639. update jl_service_user
  640. <set>
  641. <if test="status != null">
  642. status = #{status,jdbcType=VARCHAR},
  643. </if>
  644. </set>
  645. where id = #{id,jdbcType=INTEGER}
  646. </update>
  647. </mapper>