|
|
@ -12,4 +12,78 @@
|
|
|
|
MEMO, MDTRT_SETL_TYPE, DRUGTRACINFO, APPLY_NO, SETTLE_NO, SICK_ID, MATERIAL_SPEC,
|
|
|
|
MEMO, MDTRT_SETL_TYPE, DRUGTRACINFO, APPLY_NO, SETTLE_NO, SICK_ID, MATERIAL_SPEC,
|
|
|
|
MATERIAL_CERTIFICATE_NO, MODEL_NUMBER, FACTORY_NAME, UNIT
|
|
|
|
MATERIAL_CERTIFICATE_NO, MODEL_NUMBER, FACTORY_NAME, UNIT
|
|
|
|
</sql>
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="getList" resultType="com.glxp.mipsdl.entity.hlfyyy.VA010">
|
|
|
|
|
|
|
|
SELECT
|
|
|
|
|
|
|
|
CODE
|
|
|
|
|
|
|
|
FROM
|
|
|
|
|
|
|
|
v_a013
|
|
|
|
|
|
|
|
WHERE
|
|
|
|
|
|
|
|
1 = 1
|
|
|
|
|
|
|
|
<!-- 业务类型条件 -->
|
|
|
|
|
|
|
|
<if test="req.busType != null">
|
|
|
|
|
|
|
|
<if test="req.busType == 'YPCF002'">
|
|
|
|
|
|
|
|
AND REMARK ='门诊'
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="req.busType != 'YPCF002'">
|
|
|
|
|
|
|
|
AND REMARK !='门诊'
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 时间范围条件 -->
|
|
|
|
|
|
|
|
<if test="req.startTime != null and req.endTime != null">
|
|
|
|
|
|
|
|
AND
|
|
|
|
|
|
|
|
<choose>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<when test="req.databaseProductName == 'MySql'">
|
|
|
|
|
|
|
|
<![CDATA[
|
|
|
|
|
|
|
|
STR_TO_DATE(PRESCRIBEDATE, '%Y-%m-%d %H:%i:%s') >= #{req.startTime}
|
|
|
|
|
|
|
|
AND STR_TO_DATE(PRESCRIBEDATE, '%Y-%m-%d %H:%i:%s') < #{req.endTime}
|
|
|
|
|
|
|
|
]]>
|
|
|
|
|
|
|
|
</when>
|
|
|
|
|
|
|
|
<when test="req.databaseProductName == 'Oracle'">
|
|
|
|
|
|
|
|
<![CDATA[
|
|
|
|
|
|
|
|
PRESCRIBEDATE >= TO_TIMESTAMP(#{req.startTime}, 'YYYY-MM-DD HH24:MI:SS')
|
|
|
|
|
|
|
|
AND PRESCRIBEDATE < TO_TIMESTAMP(#{req.endTime}, 'YYYY-MM-DD HH24:MI:SS')
|
|
|
|
|
|
|
|
]]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</when>
|
|
|
|
|
|
|
|
</choose>
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 其他条件 -->
|
|
|
|
|
|
|
|
<if test="req.code != null and req.code != ''">
|
|
|
|
|
|
|
|
AND ( CODE = #{req.code} or APPLY_NO = #{req.code})
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="req.fromCorpName != null and req.fromCorpName != ''">
|
|
|
|
|
|
|
|
AND DEPTNAME = #{req.fromCorpName}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="req.key != null and req.key != ''">
|
|
|
|
|
|
|
|
<if test="req.databaseProductName == 'MySql'">
|
|
|
|
|
|
|
|
AND (
|
|
|
|
|
|
|
|
CODE LIKE CONCAT('%', #{req.key}, '%')
|
|
|
|
|
|
|
|
OR APPLY_NO LIKE CONCAT('%', #{req.key}, '%')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="req.databaseProductName == 'Oracle'">
|
|
|
|
|
|
|
|
AND (
|
|
|
|
|
|
|
|
CODE like '%' || #{req.key} || '%'
|
|
|
|
|
|
|
|
or APPLY_NO like '%' || #{req.key} || '%'
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<!-- 分组和排序 -->
|
|
|
|
|
|
|
|
GROUP BY CODE
|
|
|
|
|
|
|
|
<!-- ORDER BY-->
|
|
|
|
|
|
|
|
<!-- <choose>-->
|
|
|
|
|
|
|
|
<!-- <when test="req.databaseProductName == 'MySql'">-->
|
|
|
|
|
|
|
|
<!-- PRESCRIBEDATE DESC-->
|
|
|
|
|
|
|
|
<!-- </when>-->
|
|
|
|
|
|
|
|
<!-- <when test="req.databaseProductName == 'Oracle'">-->
|
|
|
|
|
|
|
|
<!-- PRESCRIBEDATE DESC-->
|
|
|
|
|
|
|
|
<!-- </when>-->
|
|
|
|
|
|
|
|
<!-- </choose>-->
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
</mapper>
|
|
|
|
</mapper>
|
|
|
|