123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- <?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.CmMallOrganizeDao">
-
- <sql id="cmMallOrganizeColumns">
- a.id AS "id",
- a.organizeName AS "organizeName",
- a.organizeLinkName AS "organizeLinkName",
- a.mobile AS "mobile",
- a.status AS "status",
- a.contactNumber AS "contactNumber",
- a.systemName AS "systemName",
- a.systemImage AS "systemImage",
- a.introduction AS "introduction",
- a.afterSale AS "afterSale",
- a.shoppingNotes AS "shoppingNotes",
- a.updateTime AS "updateTime",
- a.addTime AS "addTime",
- a.delFlag AS "delFlag"
- </sql>
-
- <sql id="cmMallOrganizeJoins">
- </sql>
-
- <select id="get" resultType="CmMallOrganize">
- SELECT
- <include refid="cmMallOrganizeColumns"/>
- FROM cm_mall_organize a
- <include refid="cmMallOrganizeJoins"/>
- WHERE a.id = #{id}
- </select>
-
- <select id="findList" resultType="CmMallOrganize">
- SELECT
- <include refid="cmMallOrganizeColumns"/>
- FROM cm_mall_organize a
- <include refid="cmMallOrganizeJoins"/>
- <where>
- id > 2
- <if test="organizeName != null and organizeName != ''">
- AND a.organizeName = #{organizeName}
- </if>
- <if test="organizeLinkName != null and organizeLinkName != ''">
- AND a.organizeLinkName = #{organizeLinkName}
- </if>
- <if test="mobile != null and mobile != ''">
- AND a.mobile = #{mobile}
- </if>
- <if test="status != null and status != ''">
- AND a.status = #{status}
- </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="CmMallOrganize">
- SELECT
- <include refid="cmMallOrganizeColumns"/>
- FROM cm_mall_organize a
- <include refid="cmMallOrganizeJoins"/>
- <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="CmMallOrganize" keyProperty="id" useGeneratedKeys="true">
- INSERT INTO cm_mall_organize(
- organizeName,
- organizeLinkName,
- mobile,
- status,
- contactNumber,
- systemName,
- systemImage,
- introduction,
- afterSale,
- shoppingNotes,
- updateTime,
- addTime,
- delFlag
- ) VALUES (
- #{organizeName},
- #{organizeLinkName},
- #{mobile},
- #{status},
- #{contactNumber},
- #{systemName},
- #{systemImage},
- #{introduction},
- #{afterSale},
- #{shoppingNotes},
- NOW(),
- NOW(),
- 0
- )
- </insert>
-
- <update id="update">
- UPDATE cm_mall_organize SET
- organizeName = #{organizeName},
- organizeLinkName = #{organizeLinkName},
- mobile = #{mobile},
- status = #{status},
- contactNumber = #{contactNumber},
- systemName = #{systemName},
- systemImage = #{systemImage},
- introduction = #{introduction},
- afterSale = #{afterSale},
- shoppingNotes = #{shoppingNotes},
- updateTime = NOW()
- WHERE id = #{id}
- </update>
- <update id="updateByStatus">
- UPDATE cm_mall_organize SET
- status = #{status},
- updateTime = NOW()
- WHERE id = #{organizeId}
- </update>
- <select id="findOrganizeMobileOnly" resultType="com.caimei.modules.weisha.entity.CmMallOrganize">
- SELECT
- <include refid="cmMallOrganizeColumns"/>
- FROM cm_mall_organize a
- WHERE a.mobile = #{mobile} AND a.delFlag = 0
- <if test="id != null">
- AND a.id != #{id}
- </if>
- </select>
-
- </mapper>
|