123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- <?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.cibe.dao.CibeBlessingCompoDao">
-
- <sql id="cibeBlessingCompoColumns">
- a.id AS "id",
- a.userId AS "userId",
- a.mobile AS "mobile",
- a.blessNum AS "blessNum",
- a.blessCode AS "blessCode",
- a.getWay AS "getWay",
- a.getTime AS "getTime",
- a.activeNum AS "activeNum",
- a.activeStartTime AS "activeStartTime",
- a.activeEndTime AS "activeEndTime",
- a.openStatus AS "openStatus",
- a.prizeType AS "prizeType",
- a.prizeDescribe AS "prizeDescribe",
- a.money AS "money",
- a.goPrize AS "goPrize"
- </sql>
-
- <sql id="cibeBlessingCompoJoins">
- </sql>
-
- <select id="get" resultType="CibeBlessingCompo">
- SELECT
- <include refid="cibeBlessingCompoColumns"/>
- FROM cibe_blessing_compo a
- <include refid="cibeBlessingCompoJoins"/>
- WHERE a.id = #{id}
- </select>
-
- <select id="findList" resultType="CibeBlessingCompo">
- SELECT
- a.*,cu.userType AS "userType",cu.userName AS "userName",cu.address AS "address"
- FROM cibe_blessing_compo a
- LEFT JOIN cibe_user cu ON cu.userId = a.userId
- <where>
-
- <if test="userId != null and userId != ''">
- AND a.userId = #{userId}
- </if>
- <if test="mobile != null and mobile != ''">
- AND a.mobile = #{mobile}
- </if>
- <if test="blessCode != null and blessCode != ''">
- AND a.blessCode = #{blessCode}
- </if>
- <if test="getWay != null and getWay != ''">
- AND a.getWay = #{getWay}
- </if>
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- </otherwise>
- </choose>
- </select>
-
- <select id="findAllList" resultType="CibeBlessingCompo">
- SELECT
- <include refid="cibeBlessingCompoColumns"/>
- FROM cibe_blessing_compo a
- <include refid="cibeBlessingCompoJoins"/>
- <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="CibeBlessingCompo" keyProperty="id" useGeneratedKeys="true">
- INSERT INTO cibe_blessing_compo(
- userId,
- mobile,
- blessNum,
- blessCode,
- getWay,
- getTime,
- activeNum,
- activeStartTime,
- activeEndTime,
- openStatus,
- prizeType,
- prizeDescribe,
- money,
- goPrize
- ) VALUES (
- #{userId},
- #{mobile},
- #{blessNum},
- #{blessCode},
- #{getWay},
- #{getTime},
- #{activeNum},
- #{activeStartTime},
- #{activeEndTime},
- #{openStatus},
- #{prizeType},
- #{prizeDescribe},
- #{money},
- #{goPrize}
- )
- </insert>
-
- <update id="update">
- UPDATE cibe_blessing_compo SET
- mobile = #{mobile},
- blessNum = #{blessNum},
- blessCode = #{blessCode},
- getWay = #{getWay},
- getTime = #{getTime},
- activeNum = #{activeNum},
- activeStartTime = #{activeStartTime},
- activeEndTime = #{activeEndTime},
- openStatus = #{openStatus},
- prizeType = #{prizeType},
- prizeDescribe = #{prizeDescribe},
- money = #{money},
- goPrize = #{goPrize}
- WHERE id = #{id}
- </update>
- <update id="updateLottery">
- UPDATE cibe_blessing_compo SET
- goPrize = 1
- WHERE id = #{id}
- </update>
-
- <delete id="delete">
- DELETE FROM cibe_blessing_compo
- WHERE id = #{id}
- </delete>
-
- </mapper>
|