|
@@ -20,9 +20,9 @@ public interface MzVisitTableMapper {
|
|
|
* @param patientId 病人编号
|
|
|
* @return
|
|
|
*/
|
|
|
- @Select("select top 1rtrim(patient_id) patient_id,times,rtrim(visit_dept_code) visit_dept_code,rtrim(doctor_code) doctor_code,visit_date,rtrim(icd_code) icd_code," +
|
|
|
+ @Select("select top 1rtrim(patient_id) patient_id,times,rtrim(visit_dept_code) visit_dept_code,rtrim(doctor_code) doctor_code,visit_date,icd_code=isnull(nullif(icd_code_new,''), rtrim(icd_code))," +
|
|
|
"receipt_no,order_no,req_fee,cancel_mark,error_mark,rtrim(op_id) op_id,op_day,rtrim(req_dept_code) req_dept_code,rtrim(req_doctor) req_doctor,windows_no," +
|
|
|
- "first_or_not,receive_flag,sick_date,rtrim(icd_text) icd_text,rtrim(symptom) symptom,jz_flag,responce_type,dwmc,gh_serial_no from ${tableName} WITH(NOLOCK) where " +
|
|
|
+ "first_or_not,receive_flag,sick_date,icd_text=isnull(nullif(icd_text_new,''), rtrim(icd_text)),rtrim(symptom) symptom,jz_flag,responce_type,dwmc,gh_serial_no,icd_code_new,icd_text_new from ${tableName} WITH(NOLOCK) where " +
|
|
|
"patient_id= #{patientId,jdbcType=VARCHAR} order by times desc")
|
|
|
MzVisitTable selectLastMzVisitTableByPatientId(@Param("patientId") String patientId,@Param("tableName") String tableName);
|
|
|
|
|
@@ -32,11 +32,12 @@ public interface MzVisitTableMapper {
|
|
|
* @return
|
|
|
*/
|
|
|
@Insert("INSERT INTO mz_visit_table(patient_id,times,visit_dept_code,doctor_code,visit_date,icd_code,receipt_no,order_no,req_fee,cancel_mark,error_mark,op_id,op_day,req_dept_code,req_doctor," +
|
|
|
- "windows_no,first_or_not,receive_flag,sick_date,icd_text,symptom,jz_flag,responce_type,dwmc,gh_serial_no)" +
|
|
|
+ "windows_no,first_or_not,receive_flag,sick_date,icd_text,symptom,jz_flag,responce_type,dwmc,gh_serial_no,icd_code_new,icd_text_new)" +
|
|
|
" VALUES (#{patientId,jdbcType=CHAR},#{times,jdbcType=INTEGER},#{visitDeptCode,jdbcType=CHAR},#{doctorCode,jdbcType=CHAR},#{visitDate,jdbcType=TIMESTAMP},#{icdCode,jdbcType=CHAR}," +
|
|
|
"#{receiptNo,jdbcType=TINYINT},#{orderNo,jdbcType=TINYINT},#{reqFee,jdbcType=DOUBLE},#{cancelMark,jdbcType=INTEGER},#{errorMark,jdbcType=INTEGER},#{opId,jdbcType=VARCHAR}," +
|
|
|
"#{opDay,jdbcType=TIMESTAMP},#{reqDeptCode,jdbcType=INTEGER},#{reqDoctor,jdbcType=INTEGER},#{windowsNo,jdbcType=TINYINT},#{firstOrNot,jdbcType=CHAR}," +
|
|
|
- "#{receiveFlag,jdbcType=CHAR},#{sickDate,jdbcType=TIMESTAMP},#{icdText,jdbcType=CHAR},#{symptom,jdbcType=VARCHAR},#{jzFlag,jdbcType=CHAR},#{responceType,jdbcType=VARCHAR},#{dwmc,jdbcType=VARCHAR},#{ghSerialNo,jdbcType=INTEGER})")
|
|
|
+ "#{receiveFlag,jdbcType=CHAR},#{sickDate,jdbcType=TIMESTAMP},#{icdText,jdbcType=CHAR},#{symptom,jdbcType=VARCHAR},#{jzFlag,jdbcType=CHAR}" +
|
|
|
+ ",#{responceType,jdbcType=VARCHAR},#{dwmc,jdbcType=VARCHAR},#{ghSerialNo,jdbcType=INTEGER},#{icdCodeNew}, #{icdTextNew})")
|
|
|
int insertMzVisitTable(MzVisitTable mzVisitTable);
|
|
|
|
|
|
|
|
@@ -73,9 +74,9 @@ public interface MzVisitTableMapper {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- @Select("select rtrim(patient_id) patient_id,times,rtrim(visit_dept_code) visit_dept_code,rtrim(doctor_code) doctor_code,visit_date,rtrim(icd_code) icd_code," +
|
|
|
+ @Select("select rtrim(patient_id) patient_id,times,rtrim(visit_dept_code) visit_dept_code,rtrim(doctor_code) doctor_code,visit_date,icd_code=isnull(nullif(icd_code_new,''), rtrim(icd_code))," +
|
|
|
"receipt_no,order_no,req_fee,cancel_mark,error_mark,rtrim(op_id) op_id,op_day,rtrim(req_dept_code) req_dept_code,rtrim(req_doctor) req_doctor,windows_no," +
|
|
|
- "first_or_not,receive_flag,sick_date,rtrim(icd_text) icd_text,rtrim(symptom) symptom,jz_flag,responce_type,dwmc,gh_serial_no from ${tableName} WITH(NOLOCK) where " +
|
|
|
+ "first_or_not,receive_flag,sick_date,icd_text=isnull(nullif(icd_text_new,''), rtrim(icd_text)),rtrim(symptom) symptom,jz_flag,responce_type,dwmc,gh_serial_no,icd_code_new,icd_text_new from ${tableName} WITH(NOLOCK) where " +
|
|
|
"patient_id= #{patientId,jdbcType=VARCHAR} and times = #{times}")
|
|
|
MzVisitTable selectByPatientIdAndTimes(@Param("patientId") String patientId,@Param("times") Integer times,@Param("tableName") String tableName);
|
|
|
|
|
@@ -88,9 +89,9 @@ public interface MzVisitTableMapper {
|
|
|
* @param tableName
|
|
|
* @return
|
|
|
*/
|
|
|
- @Select("select rtrim(patient_id) patient_id,times,rtrim(visit_dept_code) visit_dept_code,rtrim(doctor_code) doctor_code,visit_date,rtrim(icd_code) icd_code," +
|
|
|
+ @Select("select rtrim(patient_id) patient_id,times,rtrim(visit_dept_code) visit_dept_code,rtrim(doctor_code) doctor_code,visit_date,icd_code=isnull(nullif(icd_code_new,''), rtrim(icd_code))," +
|
|
|
"receipt_no,order_no,req_fee,cancel_mark,error_mark,rtrim(op_id) op_id,op_day,rtrim(req_dept_code) req_dept_code,rtrim(req_doctor) req_doctor,windows_no," +
|
|
|
- "first_or_not,receive_flag,sick_date,rtrim(icd_text) icd_text,rtrim(symptom) symptom,jz_flag,responce_type,dwmc,gh_serial_no from ${tableName} WITH(NOLOCK) where " +
|
|
|
+ "first_or_not,receive_flag,sick_date, icd_text=isnull(nullif(icd_text_new,''), rtrim(icd_text)),rtrim(symptom) symptom,jz_flag,responce_type,dwmc,gh_serial_no,icd_code_new,icd_text_new from ${tableName} WITH(NOLOCK) where " +
|
|
|
"op_day>= #{beginTime} and op_day < #{endTime}")
|
|
|
List<MzVisitTable> selectByDateRages(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime, @Param("tableName") String tableName);
|
|
|
|
|
@@ -99,7 +100,7 @@ public interface MzVisitTableMapper {
|
|
|
* @param tableName
|
|
|
* @return
|
|
|
*/
|
|
|
- @Select("select rtrim(icd_code) icd_code,count(1) num from ${tableName} WITH(NOLOCK) GROUP BY icd_code")
|
|
|
+ @Select("select icd_code=isnull(nullif(icd_code_new,''), rtrim(icd_code)),count(1) num from ${tableName} WITH(NOLOCK) GROUP BY icd_code")
|
|
|
List<Map<String,Object>> selectIcdNum(@Param("tableName") String tableName);
|
|
|
|
|
|
}
|