Răsfoiți Sursa

构建工程建设查询方法

DESKTOP-2K9OVK9\siwei 3 zile în urmă
părinte
comite
ef555e9e1c

+ 96 - 0
siwei-modules/siwei-apply/src/main/resources/mapper/zrzysite/ZrzysiteConstructMapper.xml

@@ -0,0 +1,96 @@
+<?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.siwei.apply.mapper.zrzysite.ZrzysiteConstructMapper">
+
+    <resultMap id="ZrzysiteConstructResult" type="com.siwei.apply.domain.zrzysite.ZrzysiteConstruct">
+        <id column="SQBH" property="sqbh"/>
+        <result column="ZSBH" property="zsbh"/>
+        <result column="FZRQ" property="fzrq"/>
+        <result column="ATTACHMENT" property="attachment"/>
+        <result column="XMDM" property="xmdm"/>
+        <result column="XMMC" property="xmmc"/>
+        <result column="ZZRL" property="zzrl"/>
+        <result column="GCMC" property="gcmc"/>
+        <result column="YDWZ" property="ydwz"/>
+        <result column="JSGM" property="jsgm"/>
+        <result column="BZ" property="bz"/>
+        <result column="XDDW" property="xddw"/>
+        <result column="FADW" property="fadw"/>
+    </resultMap>
+
+    <sql id="selectColumns">
+        SQBH, ZSBH, FZRQ, ATTACHMENT, XMDM, XMMC, ZZRL, GCMC, YDWZ, JSGM, BZ, XDDW, FADW
+    </sql>
+
+    <select id="selectList" parameterType="com.siwei.apply.domain.vo.zrzysite.ZrzysiteConstructFilterVo"
+            resultMap="ZrzysiteConstructResult">
+        SELECT
+        <include refid="selectColumns"/>
+        FROM RES.ZRZYSITE_CONSTRUCT__001012_003
+        <where>
+            <if test="sqbh != null and sqbh != ''">
+                AND SQBH = #{sqbh}
+            </if>
+            <if test="xmdm != null and xmdm != ''">
+                AND XMDM = #{xmdm}
+            </if>
+            <if test="xmmc != null and xmmc != ''">
+                AND XMMC LIKE '%' || #{xmmc} || '%'
+            </if>
+            <if test="gcmc != null and gcmc != ''">
+                AND GCMC LIKE '%' || #{gcmc} || '%'
+            </if>
+            <if test="keyword != null and keyword != ''">
+                AND (XMMC LIKE '%' || #{keyword} || '%'
+                  OR XMDM LIKE '%' || #{keyword} || '%'
+                  OR GCMC LIKE '%' || #{keyword} || '%')
+            </if>
+        </where>
+        ORDER BY FZRQ DESC
+    </select>
+
+    <select id="selectById" parameterType="string" resultMap="ZrzysiteConstructResult">
+        SELECT
+        <include refid="selectColumns"/>
+        FROM RES.ZRZYSITE_CONSTRUCT__001012_003
+        WHERE SQBH = #{sqbh}
+    </select>
+
+    <select id="selectCount" parameterType="com.siwei.apply.domain.vo.zrzysite.ZrzysiteConstructFilterVo"
+            resultType="int">
+        SELECT COUNT(*)
+        FROM RES.ZRZYSITE_CONSTRUCT__001012_003
+        <where>
+            <if test="sqbh != null and sqbh != ''">
+                AND SQBH = #{sqbh}
+            </if>
+            <if test="xmdm != null and xmdm != ''">
+                AND XMDM = #{xmdm}
+            </if>
+            <if test="xmmc != null and xmmc != ''">
+                AND XMMC LIKE '%' || #{xmmc} || '%'
+            </if>
+            <if test="gcmc != null and gcmc != ''">
+                AND GCMC LIKE '%' || #{gcmc} || '%'
+            </if>
+            <if test="keyword != null and keyword != ''">
+                AND (XMMC LIKE '%' || #{keyword} || '%'
+                  OR XMDM LIKE '%' || #{keyword} || '%'
+                  OR GCMC LIKE '%' || #{keyword} || '%')
+            </if>
+        </where>
+    </select>
+
+    <select id="selectByXmdmList" resultMap="ZrzysiteConstructResult">
+        SELECT
+        <include refid="selectColumns"/>
+        FROM RES.ZRZYSITE_CONSTRUCT__001012_003
+        WHERE XMDM IN
+        <foreach collection="xmdmList" item="xmdm" open="(" separator="," close=")">
+            #{xmdm}
+        </foreach>
+    </select>
+
+</mapper>