84 lines
3.1 KiB
XML
84 lines
3.1 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.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>
|
|
|
|
|
|
<select id="getComOptList">
|
|
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>
|
|
<![CDATA[and yq is not null and yq <> '']]>
|
|
</where>
|
|
order by optsort
|
|
</select>
|
|
|
|
<insert id="add">
|
|
insert into com_opt(
|
|
<if test="bz != null and bz !=''">bz,</if>
|
|
yq,xxdh,xxlb,xxqz,lx
|
|
)values(
|
|
<if test="bz != null and bz !=''">#{bz},</if>
|
|
#{yq},#{xxdh},#{xxlb},#{xxqz},#{lx}
|
|
)
|
|
</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>
|
|
|
|
<delete id="delete">
|
|
delete from com_opt where yq = #{yq} and xxdh = #{xxdh}
|
|
</delete>
|
|
|
|
<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>
|
|
|
|
</mapper>
|