123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- <?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.caimei.modules.user.dao.CmAdminMobileMapper">
- <resultMap type="com.caimei.modules.user.entity.CmAdminMobile" id="CmAdminMobileResult">
- <result property="id" column="id" />
- <result property="type" column="type" />
- <result property="mobile" column="mobile" />
- <result property="enabledStatus" column="enabledStatus" />
- <result property="delFlag" column="delFlag" />
- <result property="updateTime" column="updateTime" />
- <result property="createTime" column="createTime" />
- </resultMap>
- <sql id="selectCmAdminMobileVo">
- select
- cm_admin_mobile.id,
- cm_admin_mobile.type,
- cm_admin_mobile.mobile,
- cm_admin_mobile.enabledStatus,
- cm_admin_mobile.delFlag,
- cm_admin_mobile.updateTime,
- cm_admin_mobile.createTime
- </sql>
- <select id="getByCmAdminMobile" parameterType="com.caimei.modules.user.entity.CmAdminMobile" resultMap="CmAdminMobileResult">
- <include refid="selectCmAdminMobileVo"/>
- from cm_admin_mobile AS cm_admin_mobile
- <where> cm_admin_mobile.delFlag = 0
- <if test="id != null "> and cm_admin_mobile.id = #{id}</if>
- <if test="type != null and type != ''"> and cm_admin_mobile.type = #{type}</if>
- <if test="mobile != null and mobile != ''"> and cm_admin_mobile.mobile = #{mobile}</if>
- <if test="enabledStatus != null and enabledStatus != ''"> and cm_admin_mobile.enabledStatus = #{enabledStatus}</if>
- <if test="updateTime != null "> and cm_admin_mobile.updateTime = #{updateTime}</if>
- <if test="createTime != null "> and cm_admin_mobile.createTime = #{createTime}</if>
- </where>
- group by cm_admin_mobile.id
- order by cm_admin_mobile.createTime desc
- limit 0,1
- </select>
- <select id="getCmAdminMobileList" parameterType="com.caimei.modules.user.entity.CmAdminMobile" resultMap="CmAdminMobileResult">
- <include refid="selectCmAdminMobileVo"/>
- from cm_admin_mobile AS cm_admin_mobile
- <where> cm_admin_mobile.delFlag = 0
- <if test="id != null and id != ''">
- and cm_admin_mobile.id
- <if test="id.toUpperCase().indexOf('=')==-1">
- = #{id}
- </if>
- <if test="id.toUpperCase().indexOf('=')!=-1">
- <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
- <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
- <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
- #{idIn}
- </foreach>
- </if>
- </if>
- <if test="type != null and type != ''"> and cm_admin_mobile.type = #{type}</if>
- <if test="mobile != null and mobile != ''"> and cm_admin_mobile.mobile = #{mobile}</if>
- <if test="enabledStatus != null and enabledStatus != ''"> and cm_admin_mobile.enabledStatus = #{enabledStatus}</if>
- <if test="updateTime != null "> and cm_admin_mobile.updateTime = #{updateTime}</if>
- <if test="createTime != null "> and cm_admin_mobile.createTime = #{createTime}</if>
- </where>
- group by cm_admin_mobile.id
- order by cm_admin_mobile.createTime desc
- </select>
- <select id="getCount" parameterType="com.caimei.modules.user.entity.CmAdminMobile" resultType="int">
- select count(1)
- from cm_admin_mobile AS cm_admin_mobile
- <where> cm_admin_mobile.delFlag = 0
- <if test="id != null "> and cm_admin_mobile.id = #{id}</if>
- <if test="type != null and type != ''"> and cm_admin_mobile.type = #{type}</if>
- <if test="mobile != null and mobile != ''"> and cm_admin_mobile.mobile = #{mobile}</if>
- <if test="enabledStatus != null and enabledStatus != ''"> and cm_admin_mobile.enabledStatus = #{enabledStatus}</if>
- <if test="updateTime != null "> and cm_admin_mobile.updateTime = #{updateTime}</if>
- <if test="createTime != null "> and cm_admin_mobile.createTime = #{createTime}</if>
- </where>
- </select>
- <select id="getCmAdminMobileById" parameterType="String" resultMap="CmAdminMobileResult">
- <include refid="selectCmAdminMobileVo"/>
- from cm_admin_mobile AS cm_admin_mobile
- where cm_admin_mobile.delFlag = 0 and cm_admin_mobile.id = #{id}
- </select>
- <select id="getById" parameterType="com.caimei.modules.user.entity.CmAdminMobile" resultType="String">
- select id
- from cm_admin_mobile AS cm_admin_mobile
- <where> cm_admin_mobile.delFlag = 0
- <if test="id != null "> and cm_admin_mobile.id = #{id}</if>
- <if test="type != null and type != ''"> and cm_admin_mobile.type = #{type}</if>
- <if test="mobile != null and mobile != ''"> and cm_admin_mobile.mobile = #{mobile}</if>
- <if test="enabledStatus != null and enabledStatus != ''"> and cm_admin_mobile.enabledStatus = #{enabledStatus}</if>
- <if test="updateTime != null "> and cm_admin_mobile.updateTime = #{updateTime}</if>
- <if test="createTime != null "> and cm_admin_mobile.createTime = #{createTime}</if>
- </where>
- group by cm_admin_mobile.id
- limit 0,1
- </select>
- <insert id="addCmAdminMobile" parameterType="com.caimei.modules.user.entity.CmAdminMobile" useGeneratedKeys="true" keyProperty="id">
- insert into cm_admin_mobile
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null and id != ''">id,</if>
- <if test="type != null and type != ''">type,</if>
- <if test="mobile != null and mobile != ''">mobile,</if>
- <if test="enabledStatus != null and enabledStatus != ''">enabledStatus,</if>
- <if test="delFlag != null">delFlag,</if>
- <if test="updateTime != null">updateTime,</if>
- <if test="createTime != null">createTime,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null and id != ''">#{id},</if>
- <if test="type != null and type != ''">#{type},</if>
- <if test="mobile != null and mobile != ''">#{mobile},</if>
- <if test="enabledStatus != null and enabledStatus != ''">#{enabledStatus},</if>
- <if test="delFlag != null">#{delFlag},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="createTime != null">#{createTime},</if>
- </trim>
- </insert>
- <update id="updateCmAdminMobile" parameterType="com.caimei.modules.user.entity.CmAdminMobile">
- update cm_admin_mobile
- <trim prefix="SET" suffixOverrides=",">
- <if test="type != null and type != ''">type = #{type},</if>
- <if test="mobile != null and mobile != ''">mobile = #{mobile},</if>
- <if test="enabledStatus != null and enabledStatus != ''">enabledStatus = #{enabledStatus},</if>
- <if test="delFlag != null">delFlag = #{delFlag},</if>
- <if test="updateTime != null">updateTime = #{updateTime},</if>
- <if test="createTime != null">createTime = #{createTime},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="delCmAdminMobileById" parameterType="String">
- delete
- from cm_admin_mobile where id = #{id}
- </delete>
- <delete id="delCmAdminMobile" parameterType="com.caimei.modules.user.entity.CmAdminMobile">
- delete
- from cm_admin_mobile AS cm_admin_mobile
- <where>
- <if test="id != null "> and cm_admin_mobile.id = #{id}</if>
- <if test="type != null and type != ''"> and cm_admin_mobile.type = #{type}</if>
- <if test="mobile != null and mobile != ''"> and cm_admin_mobile.mobile = #{mobile}</if>
- <if test="enabledStatus != null and enabledStatus != ''"> and cm_admin_mobile.enabledStatus = #{enabledStatus}</if>
- <if test="delFlag != null "> and cm_admin_mobile.delFlag = #{delFlag}</if>
- <if test="updateTime != null "> and cm_admin_mobile.updateTime = #{updateTime}</if>
- <if test="createTime != null "> and cm_admin_mobile.createTime = #{createTime}</if>
- </where>
- </delete>
- </mapper>
|