|
@@ -49,7 +49,13 @@
|
|
|
<result column="seniority" property="seniority" jdbcType="VARCHAR"/>
|
|
|
<result column="gender" property="gender" jdbcType="VARCHAR"/>
|
|
|
<result column="babynumber" property="babynumber" jdbcType="VARCHAR"/>
|
|
|
- <result column="ids" property="ids" jdbcType="VARCHAR"/>
|
|
|
+ <!--4.14增加查询条件-->
|
|
|
+ <result column="ethnicgroup" property="ethnicgroup" jdbcType="VARCHAR"/>
|
|
|
+ <result column="education" property="education" jdbcType="VARCHAR"/>
|
|
|
+ <result column="height" property="height" jdbcType="VARCHAR"/>
|
|
|
+ <result column="marriage" property="marriage" jdbcType="VARCHAR"/>
|
|
|
+ <result column="highlight" property="highlight" jdbcType="VARCHAR"/>
|
|
|
+
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List">
|
|
|
id, password, truename,mobile_phone,status,last_login_time,last_login_ip,salt,token,zone_code,updated_at,stock_status,usertype
|
|
@@ -65,7 +71,7 @@
|
|
|
count(1)
|
|
|
from jl_service_user
|
|
|
LEFT JOIN jl_service_user_info on jl_service_user.id = jl_service_user_info.id
|
|
|
- LEFT JOIN (select service_id,GROUP_CONCAT(jl_region.`name`) cityname from jl_store_service LEFT JOIN jl_region
|
|
|
+ LEFT JOIN (select service_id,GROUP_CONCAT(jl_region.`name`) cityname,GROUP_CONCAT(store_id) citycode from jl_store_service LEFT JOIN jl_region
|
|
|
on jl_store_service.store_id = jl_region.`code` group by service_id) as
|
|
|
city ON jl_service_user.id = city.service_id
|
|
|
where 1=1
|
|
@@ -73,10 +79,10 @@
|
|
|
and jl_service_user.id not in ( #{ids,jdbcType=INTEGER} )
|
|
|
</if>
|
|
|
<if test="truename != null and truename !=''">
|
|
|
- and jl_service_user.truename like #{truename,jdbcType=VARCHAR}
|
|
|
+ and jl_service_user.truename like "%"#{truename,jdbcType=VARCHAR}"%"
|
|
|
</if>
|
|
|
<if test="constellation != null and constellation !=''">
|
|
|
- and constellation = #{constellation,jdbcType=VARCHAR}
|
|
|
+ and constellation like "%"#{constellation,jdbcType=VARCHAR}"%"
|
|
|
</if>
|
|
|
<if test="zodiac != null and zodiac !=''">
|
|
|
and zodiac = #{zodiac,jdbcType=VARCHAR}
|
|
@@ -99,9 +105,32 @@
|
|
|
<if test="babynumber != null and babynumber !=''">
|
|
|
and babynumber = #{babynumber,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test="cityname != null and cityname !=''">
|
|
|
- and cityname in #{cityname,jdbcType=VARCHAR}
|
|
|
+ <if test="cityname != null ">
|
|
|
+ and citycode like "%"#{cityname,jdbcType=VARCHAR}"%"
|
|
|
+ </if>
|
|
|
+ <if test="ethnicgroup != null ">
|
|
|
+ and ethnicgroup = #{ethnicgroup,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="education != null ">
|
|
|
+ and education = #{education,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="height != null ">
|
|
|
+ and height = #{height,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="marriage != null ">
|
|
|
+ and marriage = #{marriage,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="highlight != null ">
|
|
|
+ and highlight like "%"#{highlight,jdbcType=VARCHAR}"%"
|
|
|
</if>
|
|
|
+ <if test="weight != null ">
|
|
|
+ and weight = #{weight,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="agestart != null and ageend != null ">
|
|
|
+ and year(CURDATE())-substring(jl_service_user_info.idcard,7,4) >= #{agestart,jdbcType=VARCHAR}
|
|
|
+ and year(CURDATE())-substring(jl_service_user_info.idcard,7,4) <= #{ageend,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <!--age-->
|
|
|
</select>
|
|
|
<!--获取主键-->
|
|
|
<select id="getpmid" resultType="java.lang.Integer" >
|
|
@@ -112,12 +141,19 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getquerycount" resultType="java.lang.Integer" parameterType="com.ygj.yuemum.domain.maternitymatron.QueryServiceUser">
|
|
|
- select count(1) from jl_service_user where 2=2
|
|
|
+ select
|
|
|
+ count(1)
|
|
|
+ from jl_service_user
|
|
|
+ LEFT JOIN jl_service_user_info on jl_service_user.id = jl_service_user_info.id
|
|
|
+ LEFT JOIN (select service_id,GROUP_CONCAT(jl_region.`name`) cityname,GROUP_CONCAT(store_id) citycode from jl_store_service LEFT JOIN jl_region
|
|
|
+ on jl_store_service.store_id = jl_region.`code` group by service_id) as
|
|
|
+ city ON jl_service_user.id = city.service_id
|
|
|
+ where 1=1
|
|
|
<if test="id != null and id != ''">
|
|
|
and jl_service_user.id = #{id,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="truename != null and truename != ''">
|
|
|
- and jl_service_user.truename like #{truename,jdbcType=VARCHAR}
|
|
|
+ and jl_service_user.truename like "%"#{truename,jdbcType=VARCHAR}"%"
|
|
|
</if>
|
|
|
<if test="status != null and status != ''">
|
|
|
and status = #{status,jdbcType=VARCHAR}
|
|
@@ -126,13 +162,13 @@
|
|
|
and idcard = #{idcard,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="cityname != null and cityname != ''">
|
|
|
- and cityname = #{cityname,jdbcType=VARCHAR}
|
|
|
+ and citycode like "%"#{cityname,jdbcType=VARCHAR}"%"
|
|
|
</if>
|
|
|
<if test="np != null and np != ''">
|
|
|
- and np = #{np,jdbcType=VARCHAR}
|
|
|
+ and city = #{np,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="experience != null and experience != ''">
|
|
|
- and experience = #{experience,jdbcType=VARCHAR}
|
|
|
+ and seniority = #{experience,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="gender != null and gender != ''">
|
|
|
and gender = #{gender,jdbcType=VARCHAR}
|
|
@@ -188,32 +224,32 @@
|
|
|
jl_service_user.status
|
|
|
from jl_service_user
|
|
|
LEFT JOIN jl_service_user_info on jl_service_user.id = jl_service_user_info.id
|
|
|
- LEFT JOIN (select service_id,GROUP_CONCAT(jl_region.`name`) cityname from jl_store_service LEFT JOIN jl_region
|
|
|
- on jl_store_service.store_id = jl_region.`code` where jl_store_service.service_id = 3 group by service_id) as
|
|
|
+ LEFT JOIN (select service_id,GROUP_CONCAT(jl_region.`name`) cityname,GROUP_CONCAT(store_id) citycode from jl_store_service LEFT JOIN jl_region
|
|
|
+ on jl_store_service.store_id = jl_region.`code` group by service_id) as
|
|
|
city ON jl_service_user.id = city.service_id
|
|
|
where 1=1
|
|
|
- <if test="id != null and id != ''">
|
|
|
- and jl_service_user.id = #{ids,jdbcType=INTEGER}
|
|
|
+ <if test="id != null ">
|
|
|
+ and jl_service_user.id = #{id,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
- <if test="truename != null and truename != ''">
|
|
|
- and jl_service_user.truename like #{truename,jdbcType=VARCHAR}
|
|
|
+ <if test="truename != null">
|
|
|
+ and jl_service_user.truename like "%"#{truename,jdbcType=VARCHAR}"%"
|
|
|
</if>
|
|
|
- <if test="status != null and status != ''">
|
|
|
+ <if test="status != null ">
|
|
|
and status = #{status,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test="idcard != null and idcard != ''">
|
|
|
+ <if test="idcard != null ">
|
|
|
and idcard = #{idcard,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test="cityname != null and cityname != ''">
|
|
|
- and cityname = #{cityname,jdbcType=VARCHAR}
|
|
|
+ <if test="cityname != null ">
|
|
|
+ and citycode like "%"#{cityname,jdbcType=VARCHAR}"%"
|
|
|
</if>
|
|
|
- <if test="np != null and np != ''">
|
|
|
- and np = #{np,jdbcType=VARCHAR}
|
|
|
+ <if test="np != null ">
|
|
|
+ and city = #{np,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test="experience != null and experience != ''">
|
|
|
- and experience = #{experience,jdbcType=VARCHAR}
|
|
|
+ <if test="experience != null ">
|
|
|
+ and seniority = #{experience,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test="gender != null and gender != ''">
|
|
|
+ <if test="gender != null ">
|
|
|
and gender = #{gender,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
order by id
|
|
@@ -234,43 +270,69 @@
|
|
|
jl_service_user_info.babynumber
|
|
|
from jl_service_user
|
|
|
LEFT JOIN jl_service_user_info on jl_service_user.id = jl_service_user_info.id
|
|
|
- LEFT JOIN (select service_id,GROUP_CONCAT(jl_region.`name`) cityname from jl_store_service LEFT JOIN jl_region
|
|
|
+ LEFT JOIN (select service_id,GROUP_CONCAT(jl_region.`name`) cityname,GROUP_CONCAT(store_id) citycode from jl_store_service LEFT JOIN jl_region
|
|
|
on jl_store_service.store_id = jl_region.`code` group by service_id) as
|
|
|
city ON jl_service_user.id = city.service_id
|
|
|
where 1=1
|
|
|
- <if test="ids != null and ids != ''">
|
|
|
+ <if test="ids != null ">
|
|
|
and jl_service_user.id not in ( #{ids,jdbcType=INTEGER} )
|
|
|
</if>
|
|
|
- <if test="truename != null and truename !=''">
|
|
|
- and jl_service_user.truename like #{truename,jdbcType=VARCHAR}
|
|
|
+ <if test="id != null ">
|
|
|
+ and jl_service_user.id = ( #{id,jdbcType=INTEGER} )
|
|
|
</if>
|
|
|
- <if test="constellation != null and constellation !=''">
|
|
|
- and constellation = #{constellation,jdbcType=VARCHAR}
|
|
|
+ <if test="truename != null ">
|
|
|
+ and jl_service_user.truename like "%"#{truename,jdbcType=VARCHAR}"%"
|
|
|
</if>
|
|
|
- <if test="zodiac != null and zodiac !=''">
|
|
|
- and zodiac = #{zodiac,jdbcType=VARCHAR}
|
|
|
+ <if test="constellation != null ">
|
|
|
+ and constellation like "%"#{constellation,jdbcType=VARCHAR}"%"
|
|
|
</if>
|
|
|
- <if test="np != null and np !=''">
|
|
|
+ <if test="zodiac != null ">
|
|
|
+ and zodiac = #{zodiac,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="np != null ">
|
|
|
and city = #{np,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test="experience != null and experience !=''">
|
|
|
+ <if test="experience != null ">
|
|
|
and seniority = #{experience,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test="gender != null and gender !=''">
|
|
|
+ <if test="gender != null ">
|
|
|
and gender = #{gender,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test="status != null and status !=''">
|
|
|
+ <if test="status != null ">
|
|
|
and status = #{status,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test="gender != null and gender !=''">
|
|
|
+ <if test="gender != null ">
|
|
|
and gender = #{gender,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test="babynumber != null and babynumber !=''">
|
|
|
+ <if test="babynumber != null ">
|
|
|
and babynumber = #{babynumber,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test="cityname != null and cityname !=''">
|
|
|
- and cityname in #{cityname,jdbcType=VARCHAR}
|
|
|
+ <if test="cityname != null ">
|
|
|
+ and citycode like "%"#{cityname,jdbcType=VARCHAR}"%"
|
|
|
+ </if>
|
|
|
+ <if test="ethnicgroup != null ">
|
|
|
+ and ethnicgroup = #{ethnicgroup,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="education != null ">
|
|
|
+ and education = #{education,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="height != null ">
|
|
|
+ and height = #{height,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="marriage != null ">
|
|
|
+ and marriage = #{marriage,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="highlight != null ">
|
|
|
+ and highlight like "%"#{highlight,jdbcType=VARCHAR}"%"
|
|
|
+ </if>
|
|
|
+ <if test="weight != null ">
|
|
|
+ and weight = #{weight,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="agestart != null and ageend != null ">
|
|
|
+ and year(CURDATE())-substring(jl_service_user_info.idcard,7,4) >= #{agestart,jdbcType=VARCHAR}
|
|
|
+ and year(CURDATE())-substring(jl_service_user_info.idcard,7,4) <= #{ageend,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
+ <!--age-->
|
|
|
order by gender desc , babynumber desc , status asc
|
|
|
</select>
|
|
|
|