|
|
@@ -38,6 +38,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="doctorType2Confirm" column="doctor_type2_confirm" />
|
|
|
<result property="doctorType2Sign" column="doctor_type2_sign" />
|
|
|
<result property="storeOrderId" column="store_order_id" />
|
|
|
+ <result property="isTemplate" column="is_template" />
|
|
|
+ <result property="userCommitment" column="user_commitment" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectFsUserInformationCollectionVo">
|
|
|
@@ -45,12 +47,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
, doctor_confirm, create_time, update_time,doctor_id,company_user_id
|
|
|
,package_id,pay_type,amount,is_package,user_confirm2,package_order_code,package_order_id
|
|
|
,status,user_advice,doctor_advice,doctor_sign,doctor_confirm_time,sex,user_name,user_phone_four
|
|
|
- ,allergy,remark,patient_id,doctor_type2_id,doctor_type2_confirm,doctor_type2_sign,store_order_id from fs_user_information_collection
|
|
|
+ ,allergy,remark,patient_id,doctor_type2_id,doctor_type2_confirm,doctor_type2_sign,store_order_id,is_template,
|
|
|
+ user_commitment from fs_user_information_collection
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectFsUserInformationCollectionList" parameterType="FsUserInformationCollection" resultMap="FsUserInformationCollectionResult">
|
|
|
<include refid="selectFsUserInformationCollectionVo"/>
|
|
|
<where>
|
|
|
+ <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
|
|
|
<if test="questionId != null "> and question_id = #{questionId}</if>
|
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
|
|
<if test="jsonInfo != null and jsonInfo != ''"> and json_info = #{jsonInfo}</if>
|
|
|
@@ -59,6 +63,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="packageOrderId != null "> and package_order_id = #{packageOrderId}</if>
|
|
|
<if test="storeOrderId != null "> and store_order_id = #{storeOrderId}</if>
|
|
|
<if test="packageOrderCode != null and packageOrderCode !=''"> and package_order_code = #{packageOrderCode}</if>
|
|
|
+ <if test="isTemplate != null "> and is_template = #{isTemplate}</if>
|
|
|
+ <if test="isTemplate == null "> and is_template != -1</if>
|
|
|
+ <if test="userCommitment != null and userCommitment != ''"> and user_commitment like concat('%', #{userCommitment},'%')</if>
|
|
|
</where>
|
|
|
order by id desc
|
|
|
</select>
|
|
|
@@ -68,15 +75,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectFsUserInformationCollectionByUserId" parameterType="Long" resultMap="FsUserInformationCollectionResult">
|
|
|
- <include refid="selectFsUserInformationCollectionVo"/>
|
|
|
- where user_id = #{userId}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectByUserId" parameterType="Long" resultMap="FsUserInformationCollectionResult">
|
|
|
- <include refid="selectFsUserInformationCollectionVo"/>
|
|
|
- where user_id = #{userId}
|
|
|
- </select>
|
|
|
|
|
|
<select id="selectByOrderCode" parameterType="String" resultMap="FsUserInformationCollectionResult">
|
|
|
<include refid="selectFsUserInformationCollectionVo"/>
|
|
|
@@ -102,17 +100,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="maps.doctorType2Confirm != null"> and fui.doctor_type2_confirm = #{maps.doctorType2Confirm}</if>
|
|
|
<if test="maps.packageOrderCode != null and maps.packageOrderCode != ''"> and fui.package_order_code = #{maps.packageOrderCode}</if>
|
|
|
<if test="maps.patientName != null and maps.patientName != ''"> and fp.patient_name like concat(#{maps.patientName},"%")</if>
|
|
|
+ <if test="maps.isTemplate != null "> and fui.is_template = #{maps.isTemplate}</if>
|
|
|
+ <if test="maps.isTemplate == null "> and is_template != -1</if>
|
|
|
order by id desc
|
|
|
</select>
|
|
|
<select id="selectFsUserInformationCollectionByDoctorType1"
|
|
|
resultType="com.fs.his.domain.FsUserInformationCollection">
|
|
|
select fui.*,fp.patient_name as patientName from fs_user_information_collection fui left join fs_patient fp on fui.patient_id = fp.patient_id
|
|
|
- <where>
|
|
|
- <if test="maps.doctorId != null and maps.doctorId != ''"> and fui.doctor_id = #{maps.doctorId}</if>
|
|
|
+ where fui.user_confirm = 1
|
|
|
+ <if test="maps.doctorId != null and maps.doctorId != ''"> and fui.doctor_id = #{maps.doctorId}</if>
|
|
|
<if test="maps.doctorConfirm != null"> and fui.doctor_confirm = #{maps.doctorConfirm}</if>
|
|
|
<if test="maps.packageOrderCode != null and maps.packageOrderCode != ''"> and fui.package_order_code = #{maps.packageOrderCode}</if>
|
|
|
<if test="maps.patientName != null and maps.patientName != ''"> and fp.patient_name like concat(#{maps.patientName},"%")</if>
|
|
|
- </where>
|
|
|
+ <if test="maps.isTemplate != null "> and fui.is_template = #{maps.isTemplate}</if>
|
|
|
+ <if test="maps.isTemplate == null "> and is_template != -1</if>
|
|
|
order by id desc
|
|
|
</select>
|
|
|
<select id="selectFsUserInformationCollectionByOrderCode"
|
|
|
@@ -160,6 +161,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
WHERE fso.status > 1
|
|
|
AND fuic.doctor_type2_confirm = 0
|
|
|
AND fso.pay_time <= NOW() - INTERVAL 1 HOUR
|
|
|
+ AND fuic.is_template != -1
|
|
|
GROUP BY fuic.id
|
|
|
</select>
|
|
|
<select id="selectListByUserConfirmStatus" resultType="com.fs.his.domain.FsUserInformationCollection">
|
|
|
@@ -198,9 +200,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
fuic.doctor_type2_sign,
|
|
|
fuic.store_order_id
|
|
|
FROM fs_user_information_collection fuic
|
|
|
- WHERE fuic.user_confirm = 1 AND fuic.doctor_confirm = 0 AND fuic.user_confirm_time <= NOW() - INTERVAL 1 HOUR
|
|
|
+ WHERE fuic.user_confirm = 1 AND fuic.doctor_confirm = 0 AND fuic.user_confirm_time <= NOW() - INTERVAL 1 HOUR AND fuic.is_template != -1
|
|
|
GROUP BY fuic.id
|
|
|
</select>
|
|
|
+ <select id="selectFsUserInformationCollectionAllById"
|
|
|
+ resultType="com.fs.his.vo.FsUserInformationCollectionAllVO">
|
|
|
+ select uic.id, uic.question_id, uic.user_id, uic.json_info, uic.user_confirm,uic.user_confirm_time
|
|
|
+ , uic.doctor_confirm, uic.create_time, uic.update_time,uic.doctor_id,uic.company_user_id
|
|
|
+ ,uic.package_id,uic.pay_type,uic.amount,uic.is_package,uic.user_confirm2,uic.package_order_code,uic.package_order_id
|
|
|
+ ,uic.status,uic.user_advice,uic.doctor_advice,uic.doctor_sign,uic.doctor_confirm_time,uic.sex,uic.user_name,uic.user_phone_four
|
|
|
+ ,uic.allergy,uic.remark,uic.patient_id,uic.doctor_type2_id,uic.doctor_type2_confirm,uic.doctor_type2_sign,
|
|
|
+ uic.store_order_id,uic.is_template,uic.user_commitment,
|
|
|
+ d1.doctor_name AS doctor_name ,d2.doctor_name AS doctor_type2_name,
|
|
|
+ cu.nick_name AS company_user_name,fp.package_name as package_name,fpa.patient_name AS patient_name,fpa.id_card AS patient_id_card
|
|
|
+ from fs_user_information_collection uic
|
|
|
+ LEFT JOIN fs_doctor d1 ON uic.doctor_id = d1.doctor_id
|
|
|
+ LEFT JOIN fs_doctor d2 ON uic.doctor_type2_id = d2.doctor_id
|
|
|
+ LEFT JOIN company_user cu ON uic.company_user_id = cu.user_id
|
|
|
+ LEFT JOIN fs_package fp ON uic.package_id = fp.package_id
|
|
|
+ LEFT JOIN fs_patient fpa ON uic.patient_id = fpa.patient_id
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
|
|
|
<insert id="insertFsUserInformationCollection" parameterType="FsUserInformationCollection" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into fs_user_information_collection
|
|
|
@@ -237,6 +257,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="doctorType2Confirm != null">doctor_type2_confirm,</if>
|
|
|
<if test="doctorType2Sign != null">doctor_type2_sign,</if>
|
|
|
<if test="storeOrderId != null">store_order_id,</if>
|
|
|
+ <if test="isTemplate != null">is_template,</if>
|
|
|
+ <if test="userCommitment != null">user_commitment,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="questionId != null">#{questionId},</if>
|
|
|
@@ -271,6 +293,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="doctorType2Confirm != null">#{doctorType2Confirm},</if>
|
|
|
<if test="doctorType2Sign != null">#{doctorType2Sign},</if>
|
|
|
<if test="storeOrderId != null">#{storeOrderId},</if>
|
|
|
+ <if test="isTemplate != null">#{isTemplate},</if>
|
|
|
+ <if test="userCommitment != null">#{userCommitment},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
@@ -309,6 +333,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="doctorType2Confirm != null">doctor_type2_confirm = #{doctorType2Confirm},</if>
|
|
|
<if test="doctorType2Sign != null">doctor_type2_sign = #{doctorType2Sign},</if>
|
|
|
<if test="storeOrderId != null">store_order_id = #{storeOrderId},</if>
|
|
|
+ <if test="isTemplate != null">is_template = #{isTemplate},</if>
|
|
|
+ <if test="userCommitment != null and userCommitment != ''">user_commitment = #{userCommitment},</if>
|
|
|
</trim>
|
|
|
where id = #{id}
|
|
|
</update>
|