yxh
10 天以前 9df73858bc61e0e268113f5f79a8934e970a4f74
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<?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.smartor.mapper.MedicalHistoryBadyMapper">
 
    <resultMap type="com.smartor.domain.MedicalHistoryBady" id="MedicalHistoryBadyResult">
            <result property="id" column="id"/>
            <result property="procreate" column="procreate"/>
            <result property="gestationIllnesses" column="gestation_illnesses"/>
            <result property="familyHistory" column="family_history"/>
            <result property="surgicalHistory" column="surgical_history"/>
            <result property="birthAge" column="birth_age"/>
            <result property="birthWeight" column="birth_weight"/>
            <result property="outCorrectAge" column="out_correct_age"/>
            <result property="outWeight" column="out_weight"/>
            <result property="allergy" column="allergy"/>
            <result property="feed" column="feed"/>
            <result property="pid" column="pid"/>
    </resultMap>
 
    <sql id="selectMedicalHistoryBadyVo">
        select id, procreate, gestation_illnesses, family_history, surgical_history, birth_age, birth_weight, out_correct_age, out_weight, allergy, feed, pid
        from medical_history_bady
    </sql>
 
    <select id="selectMedicalHistoryBadyList" parameterType="com.smartor.domain.MedicalHistoryBady"
            resultMap="MedicalHistoryBadyResult">
        <include refid="selectMedicalHistoryBadyVo"/>
        <where>
            del_flag=0
                        <if test="procreate != null  and procreate != ''">
                            and procreate = #{procreate}
                        </if>
                        <if test="gestationIllnesses != null  and gestationIllnesses != ''">
                            and gestation_illnesses = #{gestationIllnesses}
                        </if>
                        <if test="familyHistory != null  and familyHistory != ''">
                            and family_history = #{familyHistory}
                        </if>
                        <if test="surgicalHistory != null  and surgicalHistory != ''">
                            and surgical_history = #{surgicalHistory}
                        </if>
                        <if test="birthAge != null  and birthAge != ''">
                            and birth_age = #{birthAge}
                        </if>
                        <if test="birthWeight != null  and birthWeight != ''">
                            and birth_weight = #{birthWeight}
                        </if>
                        <if test="outCorrectAge != null  and outCorrectAge != ''">
                            and out_correct_age = #{outCorrectAge}
                        </if>
                        <if test="outWeight != null  and outWeight != ''">
                            and out_weight = #{outWeight}
                        </if>
                        <if test="allergy != null  and allergy != ''">
                            and allergy = #{allergy}
                        </if>
                        <if test="feed != null  and feed != ''">
                            and feed = #{feed}
                        </if>
                        <if test="pid != null ">
                            and pid = #{pid}
                        </if>
        </where>
    </select>
 
    <select id="selectMedicalHistoryBadyById" parameterType="Long"
            resultMap="MedicalHistoryBadyResult">
            <include refid="selectMedicalHistoryBadyVo"/>
            where id = #{id}
    </select>
 
    <insert id="insertMedicalHistoryBady" parameterType="com.smartor.domain.MedicalHistoryBady"            useGeneratedKeys="true" keyProperty="id">
        insert into medical_history_bady
        <trim prefix="(" suffix=")" suffixOverrides=",">
                    <if test="procreate != null">procreate,
                    </if>
                    <if test="gestationIllnesses != null">gestation_illnesses,
                    </if>
                    <if test="familyHistory != null">family_history,
                    </if>
                    <if test="surgicalHistory != null">surgical_history,
                    </if>
                    <if test="birthAge != null">birth_age,
                    </if>
                    <if test="birthWeight != null">birth_weight,
                    </if>
                    <if test="outCorrectAge != null">out_correct_age,
                    </if>
                    <if test="outWeight != null">out_weight,
                    </if>
                    <if test="allergy != null">allergy,
                    </if>
                    <if test="feed != null">feed,
                    </if>
                    <if test="pid != null">pid,
                    </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                    <if test="procreate != null">#{procreate},
                    </if>
                    <if test="gestationIllnesses != null">#{gestationIllnesses},
                    </if>
                    <if test="familyHistory != null">#{familyHistory},
                    </if>
                    <if test="surgicalHistory != null">#{surgicalHistory},
                    </if>
                    <if test="birthAge != null">#{birthAge},
                    </if>
                    <if test="birthWeight != null">#{birthWeight},
                    </if>
                    <if test="outCorrectAge != null">#{outCorrectAge},
                    </if>
                    <if test="outWeight != null">#{outWeight},
                    </if>
                    <if test="allergy != null">#{allergy},
                    </if>
                    <if test="feed != null">#{feed},
                    </if>
                    <if test="pid != null">#{pid},
                    </if>
        </trim>
    </insert>
 
    <update id="updateMedicalHistoryBady" parameterType="com.smartor.domain.MedicalHistoryBady">
        update medical_history_bady
        <trim prefix="SET" suffixOverrides=",">
                    <if test="procreate != null">procreate =
                        #{procreate},
                    </if>
                    <if test="gestationIllnesses != null">gestation_illnesses =
                        #{gestationIllnesses},
                    </if>
                    <if test="familyHistory != null">family_history =
                        #{familyHistory},
                    </if>
                    <if test="surgicalHistory != null">surgical_history =
                        #{surgicalHistory},
                    </if>
                    <if test="birthAge != null">birth_age =
                        #{birthAge},
                    </if>
                    <if test="birthWeight != null">birth_weight =
                        #{birthWeight},
                    </if>
                    <if test="outCorrectAge != null">out_correct_age =
                        #{outCorrectAge},
                    </if>
                    <if test="outWeight != null">out_weight =
                        #{outWeight},
                    </if>
                    <if test="allergy != null">allergy =
                        #{allergy},
                    </if>
                    <if test="feed != null">feed =
                        #{feed},
                    </if>
                    <if test="pid != null">pid =
                        #{pid},
                    </if>
        </trim>
        where id = #{id}
    </update>
 
                <update id="deleteMedicalHistoryBadyById" parameterType="Long">
        update medical_history_bady
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1
        </trim>
        where  id = #{id}
    </update>
 
                            <update id="deleteMedicalHistoryBadyByIds" parameterType="String">
        update  medical_history_bady
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1
        </trim>
        where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </update>
 
 
 
 
</mapper>