|
|
|
@@ -0,0 +1,70 @@ |
|
|
|
<?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.WxRentContractFreePeriodMapper"> |
|
|
|
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxRentContractFreePeriod"> |
|
|
|
<id column="id" jdbcType="BIGINT" property="id"/> |
|
|
|
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> |
|
|
|
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> |
|
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> |
|
|
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> |
|
|
|
<result column="start_date" jdbcType="TIMESTAMP" property="startDate"/> |
|
|
|
<result column="end_date" jdbcType="TIMESTAMP" property="endDate"/> |
|
|
|
<result column="rent_contract_id" jdbcType="BIGINT" property="rentContractId"/> |
|
|
|
<result column="year_index" jdbcType="INTEGER" property="yearIndex"/> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<sql id="allColumns"> |
|
|
|
`id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`start_date`,`end_date`,`rent_contract_id`,`year_index` |
|
|
|
</sql> |
|
|
|
|
|
|
|
<sql id="dynamicWhereConditions"> |
|
|
|
where 1=1 |
|
|
|
<if test=" null != id ">and `id` = #{id}</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 != rentContractId ">and `rent_contract_id` = #{rentContractId}</if> |
|
|
|
<if test=" null != yearIndex ">and `year_index` = #{yearIndex}</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.WxRentContractFreePeriod" resultMap="BaseResultMap"> |
|
|
|
select |
|
|
|
<include refid="allColumns"/> |
|
|
|
from wx_rent_contract_free_period |
|
|
|
<include refid="dynamicWhereConditions"/> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectById" parameterType="HashMap" resultMap="BaseResultMap"> |
|
|
|
select |
|
|
|
<include refid="allColumns"/> |
|
|
|
from wx_rent_contract_free_period where id = #{id} and `tenant_id` = #{tenantId} |
|
|
|
</select> |
|
|
|
|
|
|
|
<insert id="inertPeriods" parameterType="HashMap"> |
|
|
|
INSERT INTO wx_rent_contract_free_period ( |
|
|
|
<include refid="allColumns"/> |
|
|
|
) |
|
|
|
VALUES |
|
|
|
<foreach collection="list" item="item" index="index" separator=","> |
|
|
|
( |
|
|
|
#{item.id},#{item.tenantId},#{item.parentTenantId},#{item.createTime},#{item.updateTime}, |
|
|
|
#{item.startDate},#{item.endDate},#{item.rentContractId},#{item.yearIndex} |
|
|
|
) |
|
|
|
</foreach> |
|
|
|
</insert> |
|
|
|
|
|
|
|
<delete id="deleteByContract" parameterType="com.iformall.domain.po.WxRentContractFreePeriod"> |
|
|
|
delete from wx_rent_contract_free_period where `rent_contract_id` = #{rentContractId} |
|
|
|
</delete> |
|
|
|
</mapper> |
|
|
|
|