2025-06-24 18:01:25 +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.interfaceCommon.mapper.ComOptMapper" >
<select id= "getComOptOne" >
select * from com_opt where yq = #{yq} and xxdh = #{xxdh}
</select>
<select id= "getComOptValue" >
select xxqz from com_opt where yq = #{yq} and xxdh = #{xxdh}
</select>
2025-09-17 18:02:11 +08:00
<select id= "getComOptList" >
2025-09-15 15:29:38 +08:00
select * from com_opt
<where >
<if test= "yq != null and yq != ''" > and yq = #{yq}</if>
<if test= "xxdh != null and xxdh != ''" > and xxdh = #{xxdh}</if>
<if test= "xxlb != null and xxlb != ''" > and xxlb = #{xxlb}</if>
<if test= "xxqz != null and xxqz != ''" > and xxqz = #{xxqz}</if>
2025-09-17 18:02:11 +08:00
<![CDATA[and yq is not null and yq <> '']]>
2025-09-15 15:29:38 +08:00
</where>
2025-09-17 18:02:11 +08:00
order by optsort
2025-09-15 15:29:38 +08:00
</select>
<insert id= "add" >
insert into com_opt(
<if test= "bz != null and bz !=''" > bz,</if>
2025-09-17 18:02:11 +08:00
yq,xxdh,xxlb,xxqz,lx
2025-09-15 15:29:38 +08:00
)values(
<if test= "bz != null and bz !=''" > #{bz},</if>
2025-09-17 18:02:11 +08:00
#{yq},#{xxdh},#{xxlb},#{xxqz},#{lx}
2025-09-15 15:29:38 +08:00
)
</insert>
<update id= "update" >
update com_opt set
<if test= "xxlb != null and xxlb !=''" > xxlb = #{xxlb},</if>
<if test= "bz != null and bz !=''" > bz = #{bz},</if>
xxqz = #{xxqz}
where yq = #{yq} and xxdh = #{xxdh}
</update>
2025-06-24 18:01:25 +08:00
2025-09-15 15:29:38 +08:00
<delete id= "delete" >
delete from com_opt where yq = #{yq} and xxdh = #{xxdh}
</delete>
2025-06-24 18:01:25 +08:00
2025-09-17 18:02:11 +08:00
<select id= "getComOptTemplate" resultType= "com.czlis.common.core.domain.entity.lis.ComOptTemplate" >
select * from com_opt_template
<where >
<if test= "comtype != null and comtype !=''" > and comtype = #{comtype}</if>
<if test= "optcode != null and optcode !=''" > and optcode = #{optcode}</if>
</where>
</select>
<insert id= "addTemplate" >
insert into com_opt_template(
opttype,comtype,optcode,optdefault,optSort,scope
)values(
#{opttype},#{comtype},#{optcode},#{optdefault},#{optSort},#{scope}
)
</insert>
<update id= "updateTemplate" >
update com_opt_template set
<if test= "opttype != null and opttype !=''" > opttype = #{opttype}</if>
<if test= "comtype != null and comtype !=''" > comtype = #{comtype}</if>
<if test= "optcode != null and opttype !=''" > optcode = #{optcode}</if>
<if test= "optdefault != null and optdefault !=''" > optdefault = #{optdefault}</if>
<if test= "optSort != null" > optSort = #{optSort}</if>
<if test= "scope != null and scope != ''" > scope = #{scope}</if>
</update>
<select id= "queryTree" resultType= "map" >
< ![CDATA[
select (case a.lx when '1' then (select dict_label from sys_dict_data where a.yq = dict_value and dict_type = 'lis_opt_type') when '2' then a.yq else '' end),a.lx from (select distinct yq,lx from com_opt where yq is not null and yq < > '') a
union
select yq,'2' from lab_instr where useflag = '0'
order by lx
]]>
</select>
2025-06-24 18:01:25 +08:00
</mapper>