123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <?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.weisha.dao.CmOrganizeBuyerDao">
-
- <sql id="cmOrganizeBuyerColumns">
- a.id AS "id",
- a.organizeId AS "organizeId",
- a.name AS "name",
- a.mobile AS "mobile",
- a.invitationCode AS "invitationCode",
- a.status AS "status",
- a.nickName AS "nickName",
- a.openid AS "openid",
- a.addTime AS "addTime",
- a.invitationCodeTime AS "invitationCodeTime",
- a.bindTime AS "bindTime",
- a.updateTime AS "updateTime",
- a.delFlag AS "delFlag"
- </sql>
-
- <sql id="cmOrganizeBuyerJoins">
- </sql>
-
- <select id="get" resultType="CmOrganizeBuyer">
- SELECT
- <include refid="cmOrganizeBuyerColumns"/>
- FROM cm_organize_buyer a
- <include refid="cmOrganizeBuyerJoins"/>
- WHERE a.id = #{id}
- </select>
-
- <select id="findList" resultType="CmOrganizeBuyer">
- SELECT
- <include refid="cmOrganizeBuyerColumns"/>
- FROM cm_organize_buyer a
- <where>
- a.delFlag = 0
- AND a.organizeId = #{organizeId}
- <if test="name != null and name != ''">
- AND a.name LIKE
- <if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
- <if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
- </if>
- <if test="mobile != null and mobile != ''">
- AND a.mobile = #{mobile}
- </if>
- <if test="status != null and status != ''">
- AND a.status = #{status}
- </if>
- <if test="startTime != null">
- AND a.addTime <![CDATA[ > ]]> #{startTime}
- </if>
- <if test="endTime != null">
- AND a.addTime <![CDATA[ < ]]> #{endTime}
- </if>
- <if test="invitationCode != null and invitationCode != ''">
- AND a.invitationCode = #{invitationCode}
- </if>
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- ORDER BY a.addTime DESC
- </otherwise>
- </choose>
- </select>
-
- <select id="findAllList" resultType="CmOrganizeBuyer">
- SELECT
- <include refid="cmOrganizeBuyerColumns"/>
- FROM cm_organize_buyer a
- <include refid="cmOrganizeBuyerJoins"/>
- <where>
-
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- </otherwise>
- </choose>
- </select>
-
- <insert id="insert" parameterType="CmOrganizeBuyer" keyProperty="id" useGeneratedKeys="true">
- INSERT INTO cm_organize_buyer(
- organizeId,
- name,
- mobile,
- invitationCode,
- status,
- nickName,
- openid,
- addTime,
- invitationCodeTime,
- bindTime,
- updateTime,
- delFlag
- ) VALUES (
- #{organizeId},
- #{name},
- #{mobile},
- #{invitationCode},
- #{status},
- #{nickName},
- #{openid},
- #{addTime},
- #{invitationCodeTime},
- #{bindTime},
- #{updateTime},
- #{delFlag}
- )
- </insert>
-
- <update id="update">
- UPDATE cm_organize_buyer SET
- name = #{name},
- mobile = #{mobile},
- invitationCode = #{invitationCode},
- status = #{status},
- nickName = #{nickName},
- openid = #{openid},
- invitationCodeTime = #{invitationCodeTime},
- bindTime = #{bindTime},
- updateTime = #{updateTime},
- delFlag = #{delFlag}
- WHERE id = #{id}
- </update>
- <select id="findByMobile" resultType="com.caimei.modules.weisha.entity.CmOrganizeBuyer">
- SELECT
- <include refid="cmOrganizeBuyerColumns"/>
- FROM cm_organize_buyer a
- WHERE a.mobile = #{mobile} AND delFlag = 0
- </select>
-
- </mapper>
|