123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- <?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">
- <!-- 命名,每一个映射对象不一样
- namespace:必须与对应的接口全类名一致
- -->
- <mapper namespace="com.iamberry.wechat.service.mapper.PlaceWithDrawalsLogsMapper">
-
- <sql id="allField" >
- w.PLACE_WITHDRAWALS_ID id,
- w.PLACE_OPENID openid,
- w.PLACE_WITHDRAWALS_PLACE_ID placeId,
- w.PLACE_WITHDRAWALS_NUM withDrawalsNum,
- w.PLACE_WITHDRAWALS_NAME withDrawalsName,
- w.PLACE_LOGS_TEL tel,
- w.PLACE_LOGS_CREATE_DATE createDate,
- w.PLACE_ACCOUNT_NO accountNo,
- w.PLACE_BANK_LOCAL bankLocal,
- w.PLACE_STATUS status
- </sql>
-
- <select id="getOneWithDrawalsLogs" parameterType="integer" resultType="PlaceWithDrawalsLogs">
- SELECT
- <include refid="allField"/>
- FROM tb_iamberry_place_withdrawals_logs w WHERE w.PLACE_WITHDRAWALS_ID = #{id}
- </select>
-
- <select id="selectAll" resultType="PlaceWithDrawalsLogs" parameterType="PlaceWithDrawalsLogs">
- select
- <include refid="allField"/>
- from tb_iamberry_place_withdrawals_logs w
- <where>
- <if test="openid!=null and openid!=''" >
- w.PLACE_OPENID=#{openid}
- </if>
- <if test="placeId!=null and placeId!=''" >
- and w.PLACE_WITHDRAWALS_PLACE=#{placeId}
- </if>
- <if test="tel!=null and tel!=''" >
- and w.PLACE_LOGS_TELR=#{tel}
- </if>
- </where>
- order by w.PLACE_LOGS_CREATE_DATE DESC
- <if test="page!=null and page.recordBegin>0 and page.pageSize>0 ">
- limit ${page.recordBegin},${page.pageSize}
- </if>
- <if test="page!=null and page.recordBegin==0 and page.pageSize>0 ">
- limit ${page.pageSize}
- </if>
- </select>
- <select id="selectAllMore" resultType="PlaceWithDrawalsLogs" parameterType="PlaceWithDrawalsLogs">
- select
- <include refid="allField"/>,
- (select role_name from tb_iamberry_place_role where role_id=p.place_role_id ) roleName,
- p.place_name name
- from tb_iamberry_place_withdrawals_logs w
- left join tb_iamberry_place_info p
- on p.place_id=w.place_withdrawals_place_id
- <where>
- <if test="openid!=null and openid!=''" >
- w.PLACE_OPENID=#{openid}
- </if>
- <if test="placeId!=null and placeId!=''" >
- and w.PLACE_WITHDRAWALS_PLACE_id=#{placeId}
- </if>
- <if test="tel!=null and tel!=''" >
- and w.PLACE_LOGS_TELR=#{tel}
- </if>
- <if test="status!=null and status!=''" >
- and w.PLACE_STATUS=${status}
- </if>
- <if test="name!=null and name!=''" >
- and p.place_name like CONCAT('%',#{name},'%')
- </if>
- <if test="beginDate!=null and beginDate!=''">
- and w.place_logs_create_date > #{beginDate}
- </if>
- <if test="endDate!=null and endDate!=''">
- and w.place_logs_create_date < #{endDate}
- </if>
- </where>
- order by PLACE_LOGS_CREATE_DATE DESC
- <if test="page!=null and page.recordBegin>0 and page.pageSize>0 ">
- limit ${page.recordBegin},${page.pageSize}
- </if>
- <if test="page!=null and page.recordBegin==0 and page.pageSize>0 ">
- limit ${page.pageSize}
- </if>
- </select>
-
- <select id="getAllCount" resultType="integer">
- select count(PLACE_WITHDRAWALS_ID) from tb_iamberry_place_withdrawals_logs
- <where>
- <if test="openid!=null and openid!=''" >
- PLACE_OPENID=#{openid}
- </if>
- <if test="placeId!=null and placeId!=''" >
- and PLACE_WITHDRAWALS_PLACE_ID=#{placeId}
- </if>
- <if test="tel!=null and tel!=''" >
- and PLACE_LOGS_TEL=#{tel}
- </if>
- <if test="status!=null and status!=''" >
- and PLACE_STATUS=${status}
- </if>
- </where>
-
- </select>
-
- <select id="getAllCountMore" resultType="integer">
- select count(PLACE_WITHDRAWALS_ID) from tb_iamberry_place_withdrawals_logs w
- left join tb_iamberry_place_info p
- on p.place_id=w.place_withdrawals_place_id
- <where>
- <if test="openid!=null and openid!=''" >
- and w.PLACE_OPENID=#{openid}
- </if>
- <if test="placeId!=null and placeId!=''" >
- and w.PLACE_WITHDRAWALS_PLACE_ID=#{placeId}
- </if>
- <if test="tel!=null and tel!=''" >
- and w.PLACE_LOGS_TEL=#{tel}
- </if>
- <if test="status!=null and status!=''" >
- and w.PLACE_STATUS=${status}
- </if>
- <if test="name!=null and name!=''" >
- and p.place_name like CONCAT('%',#{name},'%')
- </if>
- <if test="beginDate!=null and beginDate!=''">
- and w.place_logs_create_date > #{beginDate}
- </if>
- <if test="endDate!=null and endDate!=''">
- and w.place_logs_create_date < #{endDate}
- </if>
- </where>
- </select>
-
-
- <select id="getApplyCount" resultType="integer">
- select count(PLACE_WITHDRAWALS_ID) from tb_iamberry_place_withdrawals_logs
- where DATE_FORMAT(place_logs_create_date,'%Y%m')=#{dateMonth}
- and place_openid=#{id}
- and place_status in(1,2)
- </select>
- <insert id="insert">
- insert into
- tb_iamberry_place_withdrawals_logs(
- PLACE_OPENID ,
- PLACE_WITHDRAWALS_PLACE_ID ,
- PLACE_WITHDRAWALS_NUM ,
- PLACE_WITHDRAWALS_NAME ,
- PLACE_LOGS_TEL ,
- PLACE_LOGS_CREATE_DATE ,
- PLACE_ACCOUNT_NO ,
- PLACE_BANK_LOCAL ,
- REMARK ,
- PLACE_STATUS
- )
- values(
- #{openid},
- #{placeId},
- #{withDrawalsNum},
- #{withDrawalsName},
- #{tel},
- #{createDate},
- #{accountNo},
- #{bankLocal},
- #{remark},
- #{status}
- )
- </insert>
-
- <update id="update" >
- update tb_iamberry_place_withdrawals_logs
- <set>
- <if test="status>0">
- PLACE_STATUS =#{status},
- </if>
- <if test="remark!=null and remark!=''">
- REMARK =#{remark}
- </if>
- </set>
- WHERE place_withdrawals_id = ${id}
- </update>
-
-
- <delete id="delete" parameterType="integer">
- delete from tb_iamberry_place_withdrawals_logs
- WHERE place_withdrawals_id = #{id}
- </delete>
- <select id="getTotalMoneyByPlaceId" parameterType="Integer" resultType="Integer">
- select sum(PLACE_WITHDRAWALS_NUM) toTalMoney from tb_iamberry_place_withdrawals_logs
- where PLACE_WITHDRAWALS_PLACE_ID = #{id} and PLACE_STATUS =2
- </select>
- <select id="selectAllMoney" parameterType="PlaceWithDrawalsLogs" resultType="Integer">
- SELECT
- IFNULL(sum(PLACE_WITHDRAWALS_NUM),0) toTalMoney
- FROM
- tb_iamberry_place_withdrawals_logs
- WHERE
- PLACE_WITHDRAWALS_PLACE_ID = #{placeId}
- and PLACE_STATUS = #{status}
- </select>
- </mapper>
|