You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
2.3 KiB
XML

<?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="org.dromara.dms.mapper.DmsBillsMaintDetailProjectMapper">
<resultMap type="DmsBillsMaintDetailProjectVo" id="DmsBillsMaintDetailProjectResult">
<result property="maintDetailProjectId" column="maint_detail_project_id" />
<result property="billsMaintDetailId" column="bills_maint_detail_id" />
<result property="maintProjectId" column="maint_project_id" />
<result property="maintProjectName" column="maint_project_name" />
<result property="maintProjectDesc" column="maint_project_desc" />
<result property="maintProjectStatus" column="maint_project_status" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectDmsBillsMaintDetailProjectVo">
select
dbmdp.maint_detail_project_id,
dbmdp.bills_maint_detail_id,
dbmdp.maint_project_id,
COALESCE(dbmdp.maint_project_name, dbmp.maint_project_name) as maint_project_name,
COALESCE(dbmdp.maint_project_desc, dbmp.maint_project_desc) as maint_project_desc,
dbmdp.maint_project_status,
dbmdp.remark,
dbmdp.create_time
from
dms_bills_maint_detail_project dbmdp
left join dms_base_maint_project dbmp on dbmdp.maint_project_id = dbmp.maint_project_id
</sql>
<select id="selectDmsBillsMaintDetailProjectWithProjectName" parameterType="DmsBillsMaintDetailProject" resultMap="DmsBillsMaintDetailProjectResult">
<include refid="selectDmsBillsMaintDetailProjectVo"/>
<where>
<if test="maintDetailProjectId != null"> and dbmdp.maint_detail_project_id = #{maintDetailProjectId}</if>
<if test="billsMaintDetailId != null"> and dbmdp.bills_maint_detail_id = #{billsMaintDetailId}</if>
<if test="maintProjectId != null"> and dbmdp.maint_project_id = #{maintProjectId}</if>
<if test="maintProjectStatus != null and maintProjectStatus != ''"> and dbmdp.maint_project_status = #{maintProjectStatus}</if>
</where>
order by dbmdp.create_time desc
</select>
</mapper>