123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
- <mapper namespace="com.ygj.yuemum.dao.maternitymatron.JlServiceUserDao">
- <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.maternitymatron.JlServiceUser">
- <id column="id" property="id" jdbcType="INTEGER"/>
- <result column="password" property="password" jdbcType="VARCHAR"/>
- <result column="truename" property="truename" jdbcType="VARCHAR"/>
- <result column="mobile_phone" property="mobile_phone" jdbcType="VARCHAR"/>
- <result column="status" property="status" jdbcType="VARCHAR"/>
- <result column="last_login_time" property="last_login_time" jdbcType="DATE"/>
- <result column="last_login_ip" property="last_login_ip" jdbcType="VARCHAR"/>
- <result column="salt" property="salt" jdbcType="VARCHAR"/>
- <result column="token" property="token" jdbcType="VARCHAR"/>
- <result column="zone_code" property="zone_code" jdbcType="VARCHAR"/>
- <result column="updated_at" property="updated_at" jdbcType="DATE"/>
- <result column="stock_status" property="stock_status" jdbcType="INTEGER"/>
- <result column="usertype" property="usertype" jdbcType="VARCHAR"/>
- <!--list add-->
- <result column="age" property="age" jdbcType="VARCHAR"/>
- <result column="idcard" property="idcard" jdbcType="VARCHAR"/>
- <result column="cityname" property="cityname" jdbcType="VARCHAR"/>
- <result column="np" property="np" jdbcType="VARCHAR"/>
- <!--query add-->
- <result column="experience" property="experience" jdbcType="VARCHAR"/>
- <result column="gender" property="gender" jdbcType="VARCHAR"/>
- </resultMap>
- <resultMap id="ListResultMap" type="com.ygj.yuemum.domain.maternitymatron.JlServiceUser">
- <id column="id" property="id" jdbcType="INTEGER"/>
- <result column="truename" property="truename" jdbcType="VARCHAR"/>
- <result column="status" property="status" jdbcType="VARCHAR"/>
- <!--list add-->
- <result column="age" property="age" jdbcType="VARCHAR"/>
- <result column="idcard" property="idcard" jdbcType="VARCHAR"/>
- <result column="cityname" property="cityname" jdbcType="VARCHAR"/>
- <result column="np" property="np" 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
- </sql>
- <!--获取所有数据-->
- <select id="getcount" resultType="java.lang.Integer" >
- select
- count(1)
- from jl_service_user
- </select>
- <!--获取主键-->
- <select id="getpmid" resultType="java.lang.Integer" >
- SELECT auto_increment
- FROM information_schema.tables
- where table_schema="yuemum"
- and table_name="jl_service_user";
- </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
- <if test="id != null">
- and jl_service_user.id = #{id,jdbcType=INTEGER}
- </if>
- <if test="truename != null">
- and jl_service_user.truename = #{truename,jdbcType=VARCHAR}
- </if>
- <if test="status != null">
- and status = #{status,jdbcType=VARCHAR}
- </if>
- <if test="idcard != null">
- and idcard = #{idcard,jdbcType=VARCHAR}
- </if>
- <if test="cityname != null">
- and cityname = #{cityname,jdbcType=VARCHAR}
- </if>
- <if test="np != null">
- and np = #{np,jdbcType=VARCHAR}
- </if>
- <if test="experience != null">
- and experience = #{experience,jdbcType=VARCHAR}
- </if>
- <if test="gender != null">
- and gender = #{gender,jdbcType=VARCHAR}
- </if>
- </select>
- <!--getList-->
- <select id="getMMList" resultMap="ListResultMap">
- select
- jl_service_user.id,
- jl_service_user.truename,
- year(CURDATE())-substring(jl_service_user_info.idcard,7,4) age,
- jl_service_user_info.idcard,
- city.cityname,
- fgetcityname(CONCAT(substring(jl_service_user_info.idcard,1,4),'00')) np,
- 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` group by service_id) as
- city ON jl_service_user.id = city.service_id
- order by id
- </select>
- <select id="queryMMList" resultMap="ListResultMap" parameterType="com.ygj.yuemum.domain.maternitymatron.QueryServiceUser">
- select
- jl_service_user.id,
- jl_service_user.truename,
- year(CURDATE())-substring(jl_service_user_info.idcard,7,4) age,
- jl_service_user_info.idcard,
- city.cityname,
- fgetcityname(CONCAT(substring(jl_service_user_info.idcard,1,4),'00')) np,
- 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
- city ON jl_service_user.id = city.service_id
- where 1=1
- <if test="id != null">
- and jl_service_user.id = #{id,jdbcType=INTEGER}
- </if>
- <if test="truename != null">
- and jl_service_user.truename = #{truename,jdbcType=VARCHAR}
- </if>
- <if test="status != null">
- and status = #{status,jdbcType=VARCHAR}
- </if>
- <if test="idcard != null">
- and idcard = #{idcard,jdbcType=VARCHAR}
- </if>
- <if test="cityname != null">
- and cityname = #{cityname,jdbcType=VARCHAR}
- </if>
- <if test="np != null">
- and np = #{np,jdbcType=VARCHAR}
- </if>
- <if test="experience != null">
- and experience = #{experience,jdbcType=VARCHAR}
- </if>
- <if test="gender != null">
- and gender = #{gender,jdbcType=VARCHAR}
- </if>
- order by id
- </select>
- <!-- 得到所有的月嫂信息 -->
- <select id="getAll" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from jl_service_user
- </select>
- <!-- 根据id查找某个月嫂信息 -->
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
- select
- <include refid="Base_Column_List"/>
- from jl_service_user
- where id = #{id,jdbcType=INTEGER}
- </select>
- <!-- 根据id删除某个月嫂信息 -->
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
- delete from jl_service_user
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <!-- 插入一条月嫂信息 -->
- <insert id="insertSelective" parameterType="com.ygj.yuemum.domain.maternitymatron.JlServiceUser">
- insert into jl_service_user
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="password != null">
- password,
- </if>
- <if test="truename != null">
- truename,
- </if>
- <if test="mobile_phone != null">
- mobile_phone,
- </if>
- <if test="status != null">
- status,
- </if>
- <if test="last_login_time != null">
- last_login_time,
- </if>
- <if test="last_login_ip != null">
- last_login_ip,
- </if>
- <if test="salt != null">
- salt,
- </if>
- <if test="token != null">
- token,
- </if>
- <if test="zone_code != null">
- zone_code,
- </if>
- <if test="updated_at != null">
- updated_at,
- </if>
- <if test="stock_status != null">
- stock_status,
- </if>
- <if test="usertype != null">
- usertype
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="password != null">
- #{password,jdbcType=VARCHAR},
- </if>
- <if test="truename != null">
- #{truename,jdbcType=VARCHAR},
- </if>
- <if test="mobile_phone != null">
- #{mobile_phone,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- #{status,jdbcType=VARCHAR},
- </if>
- <if test="last_login_time != null">
- #{last_login_time,jdbcType=DATE},
- </if>
- <if test="last_login_ip != null">
- #{last_login_ip,jdbcType=VARCHAR},
- </if>
- <if test="salt != null">
- #{salt,jdbcType=VARCHAR},
- </if>
- <if test="token != null">
- #{token,jdbcType=VARCHAR},
- </if>
- <if test="zone_code != null">
- #{zone_code,jdbcType=VARCHAR},
- </if>
- <if test="updated_at != null">
- #{updated_at,jdbcType=DATE},
- </if>
- <if test="stock_status != null">
- #{stock_status,jdbcType=INTEGER},
- </if>
- <if test="usertype != null">
- #{usertype,jdbcType=VARCHAR}
- </if>
- </trim>
- </insert>
- <!-- 根据id更新一条月嫂信息 -->
- <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.domain.maternitymatron.JlServiceUser">
- update jl_service_user
- <set>
- <if test="password != null">
- password = #{password,jdbcType=VARCHAR},
- </if>
- <if test="truename != null">
- truename = #{truename,jdbcType=VARCHAR},
- </if>
- <if test="mobile_phone != null">
- mobile_phone = #{mobile_phone,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- status = #{status,jdbcType=VARCHAR},
- </if>
- <if test="last_login_time != null">
- last_login_time = #{last_login_time,jdbcType=DATE},
- </if>
- <if test="last_login_ip != null">
- last_login_ip = #{last_login_ip,jdbcType=VARCHAR},
- </if>
- <if test="salt != null">
- salt = #{salt,jdbcType=VARCHAR},
- </if>
- <if test="token != null">
- token = #{token,jdbcType=VARCHAR},
- </if>
- <if test="zone_code != null">
- zone_code = #{zone_code,jdbcType=VARCHAR},
- </if>
- <if test="updated_at != null">
- updated_at = #{updated_at,jdbcType=DATE},
- </if>
- <if test="stock_status != null">
- stock_status = #{stock_status,jdbcType=INTEGER},
- </if>
- <if test="usertype != null">
- usertype = #{usertype,jdbcType=VARCHAR}
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- </mapper>
|