诊疗记录
This commit is contained in:
@@ -8,10 +8,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="id" column="id" />
|
||||
<result property="treatId" column="treat_id" />
|
||||
<result property="sheepId" column="sheep_id" />
|
||||
<result property="sheepNo" column="sheep_no"/>
|
||||
<result property="datetime" column="datetime" />
|
||||
<result property="sheepType" column="sheep_type" />
|
||||
<result property="gender" column="gender" />
|
||||
<result property="monthAge" column="month_age"/>
|
||||
<result property="parity" column="parity" />
|
||||
<result property="diseasePName" column="disease_pname"/>
|
||||
<result property="diseaseName" column="disease_name"/>
|
||||
<result property="diseasePid" column="disease_pid" />
|
||||
<result property="diseaseId" column="disease_id" />
|
||||
<result property="result" column="result" />
|
||||
@@ -19,30 +23,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="enddate" column="enddate" />
|
||||
<result property="treatDay" column="treat_day" />
|
||||
<result property="sheepfoldId" column="sheepfold_id" />
|
||||
<result property="sheepfold" column="sheepfold_name"/>
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDiagnosisVo">
|
||||
select id, treat_id, sheep_id, datetime, sheep_type, gender, parity, disease_pid, disease_id, result, begindate, enddate, treat_day, sheepfold_id, create_by, create_time from sw_diagnosis
|
||||
select sd.id, treat_id, sheep_id, sd.datetime, sheep_type, sd.gender,sd.month_age,sd.parity, disease_pid, disease_id,
|
||||
result, begindate, enddate, treat_day, sd.sheepfold_id, sd.create_by, sd.create_time,
|
||||
sf.bs_manage_tags sheep_no,sf.sheepfold_name ,
|
||||
s2.name disease_pname,s1.name disease_name
|
||||
from sw_diagnosis sd
|
||||
left join sheep_file sf on sf.id = sd.sheep_id
|
||||
left join sw_disease s1 on sd.disease_id = s1.id
|
||||
left join sw_disease s2 on sd.disease_pid = s2.id
|
||||
|
||||
</sql>
|
||||
|
||||
<select id="selectDiagnosisList" parameterType="Diagnosis" resultMap="DiagnosisResult">
|
||||
<include refid="selectDiagnosisVo"/>
|
||||
<where>
|
||||
<if test="sheepId != null "> and sheep_id = #{sheepId}</if>
|
||||
<if test="sheepId != null "> and sd.sheep_id = #{sheepId}</if>
|
||||
<if test="sheepNo != null"> and sf.bs_manage_tags like concat('%', #{sheepNo}, '%')</if>
|
||||
<if test="params.beginDatetime != null and params.beginDatetime != '' and params.endDatetime != null and params.endDatetime != ''"> and datetime between #{params.beginDatetime} and #{params.endDatetime}</if>
|
||||
<if test="diseasePid != null "> and disease_pid = #{diseasePid}</if>
|
||||
<if test="diseaseId != null "> and disease_id = #{diseaseId}</if>
|
||||
<if test="result != null "> and result = #{result}</if>
|
||||
<if test="treatDay != null "> and treat_day = #{treatDay}</if>
|
||||
<if test="sheepfoldId != null "> and sheepfold_id = #{sheepfoldId}</if>
|
||||
<if test="sheepfoldId != null "> and sd.sheepfold_id = #{sheepfoldId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDiagnosisById" parameterType="Long" resultMap="DiagnosisResult">
|
||||
<include refid="selectDiagnosisVo"/>
|
||||
where id = #{id}
|
||||
where sd.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertDiagnosis" parameterType="Diagnosis" useGeneratedKeys="true" keyProperty="id">
|
||||
|
||||
Reference in New Issue
Block a user