| | |
| | | <id column="id" property="id" jdbcType="BIGINT" />
|
| | | <result column="account" property="account" jdbcType="VARCHAR" />
|
| | | <result column="extractTime" property="extractTime" jdbcType="BIGINT" />
|
| | | <result column="receiveTime" property="receiveTime" jdbcType="TIMESTAMP" />
|
| | | |
| | | <result column="ip" property="ip" jdbcType="VARCHAR" />
|
| | | <result column="money" property="money" jdbcType="DECIMAL" />
|
| | | <result column="name" property="name" jdbcType="VARCHAR" />
|
| | |
| | |
|
| | | </resultMap>
|
| | | <sql id="Base_Column_List">
|
| | | id,account,extractTime,ip,money,name,reason,state,type,uid,sid,adminId
|
| | | id,account,extractTime,ip,money,name,reason,state,type,uid,sid,adminId,receiveTime
|
| | | </sql>
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long">
|
| | |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.Extract"
|
| | | useGeneratedKeys="true" keyProperty="id">
|
| | | insert into yeshi_ec_extract (id,
|
| | | account,extractTime,ip,money,name,reason,state,type,uid,sid,adminId)
|
| | | account,extractTime,ip,money,name,reason,state,type,uid,sid,adminId,receiveTime)
|
| | | values
|
| | | (#{id,jdbcType=BIGINT},
|
| | | #{account,jdbcType=VARCHAR},
|
| | |
| | | #{type,jdbcType=INTEGER},
|
| | | #{userInfo.id,jdbcType=BIGINT},
|
| | | #{system.id,jdbcType=BIGINT}
|
| | | #{adminId,jdbcType=BIGINT}
|
| | | #{adminId,jdbcType=BIGINT},
|
| | | #{receiveTime,jdbcType=TIMESTAMP}
|
| | | )
|
| | | </insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.Extract"
|
| | |
| | | <if test="system != null">
|
| | | adminId,
|
| | | </if>
|
| | | |
| | | <if test="receiveTime != null">
|
| | | receiveTime,
|
| | | </if>
|
| | | |
| | | |
| | | |
| | | |
| | |
|
| | | </trim>
|
| | | <trim prefix="values (" suffix=")" suffixOverrides=",">
|
| | |
| | | <if test="system != null">
|
| | | #{adminId,jdbcType=BIGINT},
|
| | | </if>
|
| | | |
| | | <if test="receiveTime != null">
|
| | | #{receiveTime,jdbcType=TIMESTAMP},
|
| | | </if>
|
| | | |
| | | |
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.Extract">
|
| | |
| | | <if test="system != null">
|
| | | adminId = #{adminId,jdbcType=BIGINT},
|
| | | </if>
|
| | | |
| | | <if test="receiveTime != null">
|
| | | #{receiveTime,jdbcType=TIMESTAMP},
|
| | | </if>
|
| | | |
| | | |
| | | </set>
|
| | | where id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | |
| | | =#{adminId,jdbcType=BIGINT},
|
| | | sid
|
| | | =
|
| | | #{system.id,jdbcType=BIGINT}
|
| | | #{system.id,jdbcType=BIGINT},
|
| | | receiveTime
|
| | | =#{receiveTime,jdbcType=TIMESTAMP}
|
| | | where id =
|
| | | #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | |
| | | NULL,ss.money,0) + u.my_hongBao+IF( dd.`money` IS NOT NULL,dd.money,0)
|
| | | +IF( cc.`money` IS NOT NULL,cc.money,0) AS totalmoney FROM
|
| | | yeshi_ec_user u
|
| | | LEFT JOIN (SELECT h.uid,SUM(h.money) AS money FROM yeshi_ec_hongbao h
|
| | | WHERE h.state=3 AND h.uid = #{uid,jdbcType=BIGINT} GROUP BY h.uid)s ON
|
| | | LEFT JOIN (SELECT h.hb_uid as uid,SUM(h.hb_money) AS money FROM yeshi_ec_hongbao_v2 h
|
| | | WHERE h.hb_state=3 AND h.hb_uid = #{uid,jdbcType=BIGINT} GROUP BY h.hb_uid)s ON
|
| | | u.id=s.uid
|
| | | LEFT JOIN (SELECT SUM(t.`money`)AS money,t.uid FROM yeshi_ec_extract t
|
| | | WHERE (t.state=0 OR t.state=1) AND t.`uid`=#{uid,jdbcType=BIGINT}
|
| | |
| | | SELECT IFNULL(COUNT(et.id), 0)AS total,IFNULL(SUM(CASE WHEN et.state =
|
| | | 1 THEN 1 ELSE 0 END),0) AS succeed,IFNULL(SUM(CASE WHEN et.state = 2
|
| | | THEN 1 ELSE 0 END),0) AS fails
|
| | | FROM yeshi_ec_extract et WHERE (et.state=1 OR et.state= 2) AND |
| | | <![CDATA[
|
| | | FROM_UNIXTIME(et.extractTime/1000) >=CURDATE();
|
| | | ]]>
|
| | | FROM yeshi_ec_extract et
|
| | | LEFT JOIN `yeshi_ec_extract_audit_record` ar ON ar.`extractId` = et.`id`
|
| | | WHERE ar.`id` IS NOT NULL |
| | | AND FROM_UNIXTIME(ar.`auditTime`/1000,'%y%m%d') = CURDATE()
|
| | | </select>
|
| | |
|
| | | <select id="getTodayTotalSuccessMoney" resultType="java.math.BigDecimal">
|
| | | SELECT IFNULL(ROUND(SUM(money),2) ,0) AS moneys
|
| | | FROM yeshi_ec_extract et WHERE et.state=1 AND |
| | | <![CDATA[
|
| | | FROM_UNIXTIME(et.extractTime/1000) >=CURDATE();
|
| | | ]]>
|
| | | FROM yeshi_ec_extract et |
| | | LEFT JOIN `yeshi_ec_extract_audit_record` ar ON ar.`extractId` = et.`id`
|
| | | WHERE et.state=1 AND ar.`id` IS NOT NULL |
| | | AND FROM_UNIXTIME(ar.`auditTime`/1000,'%y%m%d') = CURDATE()
|
| | | </select>
|
| | |
|
| | | <select id="countTotalSuccess" resultType="java.util.HashMap">
|