|
|
|
@@ -296,6 +296,51 @@ |
|
|
|
select s.type from wx_rent_contract r left join wx_shop s on(s.id = r.`shop_id`) |
|
|
|
where r.id = #{id} |
|
|
|
</select> |
|
|
|
|
|
|
|
<resultMap id="contractMap" type="com.iformall.domain.vo.WxRentPropertyContractVo"> |
|
|
|
<id column="id" property="id"/> |
|
|
|
<result column="contract_number" property="contractNumber"/> |
|
|
|
<result column="shop_number" property="shopNumber"/> |
|
|
|
<result column="merchant_name" property="merchantName"/> |
|
|
|
<result column="rent_info" property="rentInfo"/> |
|
|
|
<result column="rental_start_date" property="rentalStartDate"/> |
|
|
|
<result column="rental_end_date" property="rentalEndDate"/> |
|
|
|
<result column="rent_price" property="rentPrice"/> |
|
|
|
<result column="property_price" property="propertyPrice"/> |
|
|
|
<result column="type" property="type"/> |
|
|
|
<result column="status" property="status"/> |
|
|
|
<result column="apply_status" property="applyStatus"/> |
|
|
|
<result column="operation_type" property="operationType"/> |
|
|
|
<result column="rent_shop_type" property="rentShopType"/> |
|
|
|
|
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<select id="listContractVo" parameterType="com.iformall.domain.vo.WxRentPropertyContractVo" resultMap="contractMap"> |
|
|
|
select rc.id,rc.merchant_name,rc.rental_start_date,rc.rental_end_date,rc.`status`, |
|
|
|
rc.price as rent_price,rc.contract_number,s.shop_number shopNumber, |
|
|
|
rc.type,rc.apply_status,rc.rent_shop_type,rc.rent_info rentInfo,pc.price as property_price |
|
|
|
from wx_rent_contract rc inner join wx_property_contract pc on rc.id=pc.rent_contract_id |
|
|
|
left join wx_shop s on rc.shop_id=s.id |
|
|
|
<where> |
|
|
|
rc.tenant_id=#{tenantId} |
|
|
|
<if test=" null != merchantName and merchantName!=''">and rc.`merchant_name` like |
|
|
|
concat('%',#{merchantName},'%') |
|
|
|
</if> |
|
|
|
<if test=" null != shopNumber and shopNumber!='' and null != rentShopType and rentShopType==1"> |
|
|
|
and json_extract(rc.rent_info,'$[*].shopNumber') like concat('%',#{shopNumber},'%') |
|
|
|
</if> |
|
|
|
<if test=" null != shopNumber and shopNumber!='' and null != rentShopType and rentShopType==2"> |
|
|
|
and s.`shop_number` like concat('%',#{shopNumber},'%') |
|
|
|
</if> |
|
|
|
<if test=" null != status ">and rc.`status` = #{status}</if> |
|
|
|
<if test=" null != type ">and rc.`type` = #{type}</if> |
|
|
|
<if test=" null != rentShopType ">and rc.`rent_shop_type` = #{rentShopType}</if> |
|
|
|
<if test=" null != applyStatus ">and rc.`apply_status` = #{applyStatus}</if> |
|
|
|
<if test=" null != operationType ">and rc.`operation_type` = #{operationType}</if> |
|
|
|
</where> |
|
|
|
<if test=" null != sortColumns">order by ${sortColumns}</if> |
|
|
|
<if test=" null == sortColumns">order by rc.id desc</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
</mapper> |