|
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.iformall.mapper.WxBillDailyMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxBillDaily">
- <id column="id" jdbcType="BIGINT" property="id" />
- <result column="receive_pay" jdbcType="BIGINT" property="receivePay"/>
- <result column="pay" jdbcType="BIGINT" property="pay"/>
- <result column="receive_date" jdbcType="TIMESTAMP" property="receiveDate" />
- <result column="pay_date" jdbcType="TIMESTAMP" property="payDate" />
- <result column="createtime" jdbcType="TIMESTAMP" property="createtime" />
- <result column="expired_day" jdbcType="INTEGER" property="expiredDay" />
- <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
- <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
- <result column="owe" jdbcType="BIGINT" property="owe"/>
- <result column="status" jdbcType="INTEGER" property="status" />
- <result column="apply_status" jdbcType="INTEGER" property="applyStatus"/>
- <result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/>
- <result column="apply_update_time" jdbcType="INTEGER" property="applyUpdateTime"/>
- <result column="is_del" jdbcType="INTEGER" property="isDel" />
- <result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
- <result column="user_id" jdbcType="BIGINT" property="userId" />
- <result column="shop_id" jdbcType="BIGINT" property="shopId" />
- <result column="shop_name" jdbcType="VARCHAR" property="shopName" />
- <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" />
- <result column="type" jdbcType="INTEGER" property="type" />
- <result column="rent_shop_type" jdbcType="INTEGER" property="rentShopType"/>
- <result column="pay_way" jdbcType="INTEGER" property="payWay"/>
- <result column="price_detail" jdbcType="VARCHAR" property="priceDetail"/>
-
- <result column="starttime" property="starttime"/>
- <result column="endtime" property="endtime"/>
- <result column="freeze" property="freeze"/>
- <result column="build_way" property="buildWay"/>
- <result column="service_charge_pay" property="serviceChargePay"/>
- </resultMap>
-
- <sql id="allColumns">
- `id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`,`apply_status`,`apply_pay_img`,`apply_update_time`,
- `tenant_id`,`parent_tenant_id`,`owe`,`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`shop_name`,`updatetime`,`type`,
- `rent_shop_type`,`pay_way`,`price_detail`,`starttime`,`endtime`,freeze,build_way,service_charge_pay
- </sql>
-
- <sql id="dynamicWhereConditions">
- where 1 = 1
- <if test=" null != id "> and `id` = #{id} </if>
- <if test=" null != receivePay "> and `receive_pay` = #{receivePay} </if>
- <if test=" null != pay "> and `pay` = #{pay} </if>
- <if test=" null != receiveDate "> and `receive_date` = #{receiveDate} </if>
- <if test=" null != payDate "> and `pay_date` = #{payDate} </if>
- <if test=" null != createtime "> and `createtime` = #{createtime} </if>
- <if test=" null != expiredDay "> and `expired_day` = #{expiredDay} </if>
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and `parent_tenant_id` = #{parentTenantId}
- </if>
- <if test=" null != owe "> and `owe` = #{owe} </if>
- <if test=" null != status "> and `status` = #{status} </if>
- <if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if>
- <if test=" null != isDel "> and `is_del` = #{isDel} </if>
- <if test=" null != merchantId "> and `merchant_id` = #{merchantId} </if>
- <if test=" null != userId "> and `user_id` = #{userId} </if>
- <if test=" null != updatetime "> and `updatetime` = #{updatetime} </if>
- <if test=" null != type "> and `type` = #{type} </if>
- <if test=" null != rentShopType ">and `rent_shop_type` = #{rentShopType}</if>
- <if test=" null != payWay ">and `pay_way` = #{payWay}</if>
- <if test=" null != buildWay ">and `build_way` = #{buildWay}</if>
-
- <if test=" null != ids ">
- and id in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- <if test=" null != sortColumns"> order by ${sortColumns} </if>
- </sql>
-
- <select id="findList" parameterType="com.iformall.domain.po.WxBillDaily" resultMap="BaseResultMap">
- select <include refid="allColumns" /> from wx_bill_daily
- <include refid="dynamicWhereConditions" />
- </select>
-
- <select id="queryBillDailyList" parameterType="com.iformall.domain.po.WxBillDaily" resultMap="BaseResultMap">
- select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day` ,
- case when br.status=1 then br.owe else 0 end owe,br.`status`,m.`name` merchant_name,
- br.`updatetime`,br.`merchant_id`,br.shop_id,br.shop_name,br.type,br.`rent_shop_type`,br.pay_way,br.price_detail,
- br.`starttime`,br.`endtime`,br.`build_way`,br.freeze,br.service_charge_pay,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`
- from wx_bill_daily br left join wx_merchant m on br.merchant_id=m.id
- <where>
- <if test=" null != freeze ">and br.`freeze` = #{freeze}</if>
- <if test=" null != id ">and br.`id` = #{id}</if>
- <if test=" null != merchantId ">and br.`merchant_id` = #{merchantId}</if>
- <if test=" null != merchantName and ''!=merchantName ">and m.`name` like concat('%',#{merchantName},'%')</if>
- <if test=" null != status ">and br.`status` = #{status}</if>
- <if test=" null != applyStatus ">and br.`apply_status` = #{applyStatus}</if>
- <if test=" null != isDel ">and br.`is_del` = #{isDel}</if>
- <if test=" null != type ">and br.`type` = #{type}</if>
- <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if>
- <if test=" null != payWay ">and br.`pay_way` = #{payWay}</if>
- <if test=" null != starttime and null!=endtime ">and br.`receive_date` between #{starttime} and #{endtime}
- </if>
- <if test=" null != buildWay ">and br.`build_way` = #{buildWay}</if>
-
-
- </where>
-
- <if test=" null != sortColumns"> order by ${sortColumns} </if>
- <if test=" null == sortColumns">order by id desc</if>
- </select>
-
- <update id="updateNotPaidStatus" parameterType="hashmap">
- update wx_bill_daily set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date)
- where status!=#{paid}
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and `parent_tenant_id` = #{parentTenantId}
- </if>
- and DATEDIFF(now(),receive_date)>0
- </update>
-
- <update id="updateWaitPayStatus" parameterType="hashmap">
- update wx_bill_daily set status=#{waitPay} where status!=#{paid}
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and `parent_tenant_id` = #{parentTenantId}
- </if>
- and DATEDIFF(now(),receive_date) <=0
- </update>
-
-
-
-
-
- </mapper>
|