51 lines
1.9 KiB
XML
Raw Normal View History

2025-08-18 17:48:46 +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.XmValMapper">
<select id="getXmValList" resultType="com.czlis.common.core.domain.entity.lis.XmVal">
select * from xm_val where yq=#{yq}
</select>
<select id="getXmVal" resultType="com.czlis.common.core.domain.entity.lis.XmVal">
select * from xm_val where yq = #{yq} and xmdh = #{xmdh}
</select>
<select id="getXmValValue" resultType="com.czlis.common.core.domain.entity.lis.XmVal">
select TOP 1 * from xm_val
<where>
<if test="yq != null and yq != ''">
and yq = #{yq}
</if>
<if test="xmdh != null and xmdh != ''">
and xmdh = #{xmdh}
</if>
<if test="csjg != null and csjg != ''">
and qz = #{csjg}
</if>
</where>
</select>
<select id="getXmValJgbz" resultType="com.czlis.common.core.domain.entity.lis.XmVal">
select TOP 1 jgbz from xm_val
<where>
<if test="yq != null and yq != ''">
and yq = #{yq}
</if>
<if test="xmdh != null and xmdh != ''">
and xmdh = #{xmdh}
</if>
<!-- 动态 OR 条件块:多条件时用 OR 连接,单条件时自动转为 AND -->
<trim prefix="AND (" suffix=")" prefixOverrides="OR">
<if test="csjg != null and csjg != ''">
OR qz = #{csjg}
</if>
<if test="csjg1 != null and csjg1 != ''">
OR qz = #{csjg1}
</if>
<if test="csjg2 != null and csjg2 != ''">
OR qz = #{csjg2}
</if>
</trim>
</where>
</select>
</mapper>