|
@@ -4,40 +4,50 @@
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
<resultMap id="BaseResultMap" type="com.diagbot.entity.Plan">
|
|
|
- <id column="id" property="id" />
|
|
|
- <result column="is_deleted" property="isDeleted" />
|
|
|
- <result column="gmt_create" property="gmtCreate" />
|
|
|
- <result column="gmt_modified" property="gmtModified" />
|
|
|
- <result column="creator" property="creator" />
|
|
|
- <result column="modifier" property="modifier" />
|
|
|
- <result column="hospital_id" property="hospitalId" />
|
|
|
- <result column="plan_name" property="planName" />
|
|
|
- <result column="plan_code" property="planCode" />
|
|
|
- <result column="plan_status" property="planStatus" />
|
|
|
- <result column="remark" property="remark" />
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <result column="is_deleted" property="isDeleted"/>
|
|
|
+ <result column="gmt_create" property="gmtCreate"/>
|
|
|
+ <result column="gmt_modified" property="gmtModified"/>
|
|
|
+ <result column="creator" property="creator"/>
|
|
|
+ <result column="modifier" property="modifier"/>
|
|
|
+ <result column="hospital_id" property="hospitalId"/>
|
|
|
+ <result column="plan_name" property="planName"/>
|
|
|
+ <result column="plan_code" property="planCode"/>
|
|
|
+ <result column="plan_status" property="planStatus"/>
|
|
|
+ <result column="remark" property="remark"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="getPlanInfoPageAll" resultType="com.diagbot.dto.PlanInfoPageDTO">
|
|
|
SELECT
|
|
|
- id as id,
|
|
|
- hospital_id as hospitalId,
|
|
|
- plan_name as planName,
|
|
|
- plan_code as planCode,
|
|
|
- plan_status as planStatus
|
|
|
- FROM tran_plan u
|
|
|
- WHERE u.is_deleted = 'N'
|
|
|
+ u.id AS id,
|
|
|
+ u.hospital_id AS hospitalId,
|
|
|
+ u.plan_name AS planName,
|
|
|
+ u.plan_code AS planCode,
|
|
|
+ u.plan_status AS planStatus,
|
|
|
+ u.gmt_create AS gmtCreate,
|
|
|
+ GROUP_CONCAT(
|
|
|
+ pd.NAME
|
|
|
+ ORDER BY
|
|
|
+ pd.order_no ASC
|
|
|
+ ) AS planDetail
|
|
|
+ FROM
|
|
|
+ tran_plan u,
|
|
|
+ tran_plan_detail pd
|
|
|
+ WHERE
|
|
|
+ u.is_deleted = 'N'
|
|
|
+ AND pd.is_deleted = 'N'
|
|
|
<if test="hospitalId !=null">
|
|
|
- and hospital_id =#{hospitalId}
|
|
|
+ and u.hospital_id =#{hospitalId}
|
|
|
</if>
|
|
|
+ AND pd.plan_id = u.id
|
|
|
+ AND pd.parent_id = -1
|
|
|
<if test="planName != null and planName =''">
|
|
|
AND UPPER(u.plan_name) LIKE CONCAT('%', UPPER(trim(#{planName})), '%')
|
|
|
</if>
|
|
|
<if test="planCode != null and planCode != ''">
|
|
|
AND u.plan_code = #{planCode}
|
|
|
</if>
|
|
|
- <if test="planStatus != null">
|
|
|
- AND u.plan_status = #{planStatus}
|
|
|
- </if>
|
|
|
- ORDER BY gmt_create DESC
|
|
|
+ GROUP BY u.id
|
|
|
+ ORDER BY gmtCreate DESC
|
|
|
</select>
|
|
|
</mapper>
|