更改拉黑和就诊卡sql语句,添加deleted=0字段
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
<if test="cardNo != null and cardNo != null">
|
||||
or card_no = #{cardNo}
|
||||
</if>
|
||||
AND deleted = 0
|
||||
</select>
|
||||
<select id="selectAllCardCount" parameterType="com.guahao.h5.user.model.UserCardVo" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
@@ -19,6 +20,7 @@
|
||||
FROM
|
||||
user_card
|
||||
WHERE user_id = #{userId}
|
||||
AND deleted = 0
|
||||
</select>
|
||||
|
||||
<!--根据用户id查询所有就诊卡-->
|
||||
@@ -44,6 +46,7 @@
|
||||
user_card
|
||||
WHERE
|
||||
user_id =#{userId}
|
||||
AND deleted = 0
|
||||
<if test="id != null and id !=''">
|
||||
AND id = #{id}
|
||||
</if>
|
||||
@@ -87,6 +90,7 @@
|
||||
<if test="cardNo != null and cardNo !=''">
|
||||
AND card_no = #{cardNo}
|
||||
</if>
|
||||
AND deleted = 0
|
||||
</select>
|
||||
|
||||
<!--根据用户id查询所有就诊卡-->
|
||||
@@ -112,6 +116,7 @@
|
||||
user_card
|
||||
WHERE
|
||||
user_id =#{userId}
|
||||
AND deleted = 0
|
||||
</select>
|
||||
<select id="queryUserCardListByPatientid" resultType="com.guahao.h5.user.model.UserCardVo">
|
||||
SELECT
|
||||
@@ -137,16 +142,17 @@
|
||||
<if test="cardNo != null and cardNo !=''">
|
||||
AND card_no = #{patientid}
|
||||
</if>
|
||||
AND deleted = 0
|
||||
</select>
|
||||
|
||||
<select id="queryUserCardDefaltByOpenid" resultType="com.guahao.h5.yb.model.IDVO">
|
||||
SELECT c.id_no,c.name from user_card c,user_info i where i.openid = #{openid} AND c.user_id = i.user_id and c.is_yes = '0'
|
||||
SELECT c.id_no,c.name from user_card c,user_info i where i.openid = #{openid} AND c.user_id = i.user_id and c.is_yes = '0' AND c.deleted = 0
|
||||
</select>
|
||||
<select id="selectByPatientId" resultType="com.guahao.h5.user.model.UserCardVo">
|
||||
select * from user_card where patient_id = #{patientId}
|
||||
select * from user_card where patient_id = #{patientId} AND deleted = 0
|
||||
</select>
|
||||
<select id="selectByUserId" resultType="java.lang.String">
|
||||
select card_no from user_card where user_id = #{uid}
|
||||
select card_no from user_card where user_id = #{uid} AND deleted = 0
|
||||
</select>
|
||||
|
||||
<!--新增就诊卡-->
|
||||
@@ -278,6 +284,7 @@
|
||||
c.utime = now()
|
||||
WHERE c.user_id = #{userId}
|
||||
AND c.is_yes = '0'
|
||||
AND c.deleted = 0
|
||||
</update>
|
||||
|
||||
<!--设置默认卡-->
|
||||
@@ -287,6 +294,7 @@
|
||||
c.utime = now()
|
||||
WHERE c.user_id = #{userId}
|
||||
AND c.is_yes = '1'
|
||||
AND c.deleted = 0
|
||||
</update>
|
||||
|
||||
<!--设置默认卡-->
|
||||
@@ -297,6 +305,7 @@
|
||||
WHERE c.user_id = #{userId}
|
||||
AND c.is_yes = '1'
|
||||
AND c.card_no = #{cardNo}
|
||||
AND c.deleted = 0
|
||||
</update>
|
||||
<!--不设置默认卡-->
|
||||
<update id="updateIsYesAll" parameterType="com.guahao.h5.user.model.UserCardVo">
|
||||
@@ -304,7 +313,7 @@
|
||||
SET c.is_yes = '1',
|
||||
c.utime = now()
|
||||
WHERE c.user_id = #{userId}
|
||||
|
||||
AND c.deleted = 0
|
||||
</update>
|
||||
|
||||
<!--删除就诊卡-->
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
WHERE user_id = #{userId}
|
||||
</select>
|
||||
<select id="isBlack" resultType="java.lang.Integer">
|
||||
select black from blacklist where user_id = #{userId}
|
||||
select black from blacklist where user_id = #{userId} and deleted = 0
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user