lis8.0/liswork/src/main/resources/mapper/XmKnowledgeMapper.xml

104 lines
4.4 KiB
XML
Raw Normal View History

2025-11-20 18:13:09 +08:00
<?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.czlis.liswork.mapper.xtwh.XmKnowledgeMapper">
<select id="query" resultType="com.czlis.common.core.domain.entity.lis.XmKnowledge">
select * from xm_knowledge
<where>
<if test="xmid != null and xmid != ''"> and xmid = #{xmid}</if>
<if test="xmdh != null and xmdh != ''"> and xmdh = #{xmdh}</if>
<if test="xmmc != null and xmmc != ''"> and xmmc like '%'+#{xmdh}+'%' </if>
<if test="inputData != null and inputData !=''">and (xmdh like '%'+#{inputData}+'%' or xmmc like '%'+#{inputData}+'%' or zjf like '%'+#{inputData}+'%')</if>
</where>
</select>
<insert id="add">
insert into xm_knowledge(
<if test="xmdh != null and xmdh != ''">xmdh,</if>
<if test="xmmc != null and xmmc != ''">xmmc,</if>
<if test="xmlb != null and xmlb != ''">xmlb,</if>
<if test="xmz != null and xmz != ''">xmz,</if>
<if test="dw != null and dw != ''">dw,</if>
<if test="cksx != null">cksx,</if>
<if test="ckxx != null">ckxx,</if>
<if test="dyckz != null and dyckz !=''">dyckz,</if>
<if test="dyxh != null">dyxh,</if>
<if test="jsgs != null and jsgs !=''">jsgs,</if>
<if test="lcyy != null and lcyy !=''">lcyy,</if>
<if test="bz != null and bz !=''">bz,</if>
<if test="zjf != null and zjf !=''">zjf,</if>
<if test="xsbz != null and xsbz !=''">xsbz,</if>
xmid
)values(
<if test="xmdh != null and xmdh != ''">#{xmdh},</if>
<if test="xmmc != null and xmmc != ''">#{xmmc},</if>
<if test="xmlb != null and xmlb != ''">#{xmlb},</if>
<if test="xmz != null and xmz != ''">#{xmz},</if>
<if test="dw != null and dw != ''">#{dw},</if>
<if test="cksx != null">#{cksx},</if>
<if test="ckxx != null">#{ckxx},</if>
<if test="dyckz != null and dyckz !=''">#{dyckz},</if>
<if test="dyxh != null">#{dyxh},</if>
<if test="jsgs != null and jsgs !=''">#{jsgs},</if>
<if test="lcyy != null and lcyy !=''">#{lcyy},</if>
<if test="bz != null and bz !=''">#{bz},</if>
<if test="zjf != null and zjf !=''">#{zjf},</if>
<if test="xsbz != null and xsbz !=''">#{xsbz},</if>
#{xmid}
)
</insert>
<update id="update">
update xm_knowledge
<set>
<if test="xmdh != null and xmdh != ''">xmdh = #{xmdh},</if>
<if test="xmmc != null and xmmc != ''">xmmc = #{xmmc},</if>
<if test="xmlb != null and xmlb != ''">xmlb = #{xmlb},</if>
<if test="xmz != null and xmz != ''">xmz = #{xmz},</if>
<if test="dw != null and dw != ''">dw = #{dw},</if>
<if test="cksx != null">cksx = #{cksx},</if>
<if test="ckxx != null">ckxx = #{ckxx},</if>
<if test="dyckz != null and dyckz !=''">dyckz = #{dyckz},</if>
<if test="dyxh != null">dyxh = #{dyxh},</if>
<if test="jsgs != null and jsgs !=''">jsgs = #{jsgs},</if>
<if test="lcyy != null and lcyy !=''">lcyy = #{lcyy},</if>
<if test="bz != null and bz !=''">bz = #{bz},</if>
<if test="zjf != null and zjf !=''">zjf = #{zjf},</if>
<if test="xsbz != null and xsbz !=''">xsbz = #{xsbz},</if>
xmid = #{xmid}
</set>
where xmid = #{xmid}
</update>
<delete id="delete">
delete from xm_knowledge where xmid = #{xmid}
</delete>
<select id="queryDetail" resultType="map">
select reserve_info.reserve,
xm_textresult.yq,
xm_textresult.xmdh,
xm_textresult.xh,
(case xm_textresult.reserve when '1' then yxjs else cjyy end) as textresult,
xm_textresult.zd
from
(select '1' as reserve
union all
select 'H' as reserve
union all
select 'L' as reserve
union all
select 'P' as reserve
union all
select 'Q' as reserve
union all
select 'J' as reserve) reserve_info
left outer join xm_textresult on xm_textresult.reserve = reserve_info.reserve and xm_textresult.xmdh = #{xmdh}
order by reserve_info.reserve
</select>
</mapper>