dimensional-health-interrog.../target/classes/mapper/GiftMapper.xml

65 lines
2.2 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.four.patient.mapper.GiftMapper">
<insert id="insertGiftLog">
insert into gift_record(
<if test="null!=giverId and ''!=giverId">giver_id,</if>
<if test="null!=giftId and giftId!=''"> gift_id,</if>
gift_giving_time)
values (
<if test="null!=giverId and ''!=giverId">#{giverId},</if>
<if test="null!=giftId and ''!=giftId">#{giftId},</if>
#{giftGivingTime}
)
</insert>
<update id="updPatientMoney">
update sys_user set
<if test="null!=userMoney and ''!=userMoney">user_money=#{patientMoney}</if>
where user_id=#{userid}
</update>
<update id="updDoctorMoney">
update sys_user set
<if test="null!=userMoney and ''!=userMoney">user_money=#{doctorMoney}</if>
where user_id=#{userId}
</update>
<select id="ShowGiftAll" resultType="com.four.common.duck.gift.Gift">
select
gift_id,
gift_name,
gift_photo,
gift_price
from gift
</select>
<select id="findByGiftId" resultType="com.four.common.duck.gift.Gift">
select gift_id,
gift_name,
gift_photo,
gift_price
from gift
<where>
<if test="null!=gift_id and ''!=gift_id">
and gift_id = #{giftId}
</if>
</where>
</select>
<select id="findByRegistration" resultType="com.four.common.duck.interrogation.RegistrationInformation">
select user_id from registration_information
<where>
<if test="null!=registration_information_id and ''!=registration_information_id">
and registration_information_id=#{registrationInformationId}
</if>
</where>
</select>
<select id="findByUserId" resultType="com.four.common.duck.my.User">
select user_id,
user_money
from sys_user
</select>
</mapper>