租赁管理
This commit is contained in:
@@ -0,0 +1,102 @@
|
||||
<?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.mhd.basic.domain.lease.repository.mapper.LeaseMapper">
|
||||
|
||||
<resultMap type="com.mhd.basic.domain.lease.repository.po.LeasePO" id="LeaseResult">
|
||||
<!-- 租赁相关字段 -->
|
||||
<result property="id" column="id" />
|
||||
<result property="organizationId" column="organization_id" />
|
||||
<result property="organizationName" column="organization_name" />
|
||||
<result property="topOrganizationId" column="top_organization_id" />
|
||||
<result property="cargoOwnerName" column="cargo_owner_name" />
|
||||
<result property="leaseType" column="lease_type" />
|
||||
<result property="leaseArea" column="lease_area" />
|
||||
<result property="startDate" column="start_date" />
|
||||
<result property="endDate" column="end_date" />
|
||||
<result property="remark" column="remark" />
|
||||
<!-- 继承自BaseVOEntity的字段 -->
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createByName" column="create_by_name" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateByName" column="update_by_name" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectLeasePo">
|
||||
select
|
||||
id,
|
||||
organization_id,
|
||||
organization_name,
|
||||
top_organization_id,
|
||||
cargo_owner_name,
|
||||
lease_type,
|
||||
lease_area,
|
||||
start_date,
|
||||
end_date,
|
||||
remark,
|
||||
create_time,
|
||||
create_by,
|
||||
create_by_name,
|
||||
update_time,
|
||||
update_by,
|
||||
update_by_name,
|
||||
del_flag
|
||||
from lease
|
||||
</sql>
|
||||
|
||||
<sql id="selectLeasePo1">
|
||||
<where>
|
||||
<!-- 租赁查询条件 -->
|
||||
<if test="organizationId != null ">
|
||||
and organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="topOrganizationId != null ">
|
||||
and top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
<if test="organizationName != null and organizationName != ''">
|
||||
and organization_name like concat('%', #{organizationName}, '%')
|
||||
</if>
|
||||
<if test="cargoOwnerName != null and cargoOwnerName != ''">
|
||||
and cargo_owner_name like concat('%', #{cargoOwnerName}, '%')
|
||||
</if>
|
||||
<if test="leaseType != null and leaseType != ''">
|
||||
and lease_type = #{leaseType}
|
||||
</if>
|
||||
<if test="leaseArea != null ">
|
||||
and lease_area = #{leaseArea}
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
and remark like concat('%', #{remark}, '%')
|
||||
</if>
|
||||
|
||||
<!-- 创建和更新相关条件 -->
|
||||
<if test="createByName != null and createByName != ''">
|
||||
and create_by_name like concat('%', #{createByName}, '%')
|
||||
</if>
|
||||
<if test="updateByName != null and updateByName != ''">
|
||||
and update_by_name like concat('%', #{updateByName}, '%')
|
||||
</if>
|
||||
<!-- 时间范围查询(如果需要) -->
|
||||
<if test="startDate != null and endDate != null">
|
||||
and start_date >= #{startDate} and start_date <= #{endDate}
|
||||
</if>
|
||||
|
||||
<!-- 删除标记 -->
|
||||
<choose>
|
||||
<when test="delFlag != null"> and del_flag = #{delFlag} </when>
|
||||
<otherwise> and del_flag = 1 </otherwise>
|
||||
</choose>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="queryList" parameterType="com.mhd.basic.domain.lease.repository.po.LeasePO" resultMap="LeaseResult">
|
||||
<include refid="selectLeasePo"/>
|
||||
<include refid="selectLeasePo1"/>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user