| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- <?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="cn.com.goldenwater.dcproj.dao.OlBisInspOrgDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.OlBisInspOrg" id="bisInspOrgResultMap">
- <result property="orgId" column="ORG_ID"/>
- <result property="orgPid" column="ORG_PID"/>
- <result property="orgNm" column="ORG_NM"/>
- <result property="rlcode" column="RLCODE"/>
- <result property="inTm" column="IN_TM"/>
- <result property="upTm" column="UP_TM"/>
- <result property="adCode" column="AD_CODE"/>
- <result property="pblmLogo" column="PBLM_LOGO"/>
- <result property="quoteOrgId" column="QUOTE_ORG_ID"/>
- <result property="orgType" column="ORG_TYPE"/>
- </resultMap>
- <sql id="table_columns">
- ORG_ID,
- ORG_PID,
- ORG_NM,
- RLCODE,IN_TM,UP_TM,AD_CODE,PBLM_LOGO,QUOTE_ORG_ID,
- ORG_TYPE
- </sql>
- <sql id="entity_properties">
- #{orgId},
- #{orgPid},
- #{orgNm},
- #{rlcode},#{inTm},#{upTm},#{adCode},#{pblmLogo},#{quoteOrgId},
- #{orgType}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="orgPid != null and orgPid != ''">and ORG_PID = #{orgPid}</if>
- <if test="orgNm != null and orgNm != ''">and ORG_NM = #{orgNm}</if>
- <if test="rlcode != null and rlcode != ''">and RLCODE = #{rlcode}</if>
- <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
- <if test="pblmLogo != null and pblmLogo != ''">and PBLM_LOGO = #{pblmLogo}</if>
- <if test="quoteOrgId != null and quoteOrgId != ''">and QUOTE_ORG_ID = #{quoteOrgId}</if>
- <if test="orgType != null and orgType != ''">and ORG_TYPE = #{orgType}</if>
- </trim>
- </sql>
- <select id="selectMax" resultType="java.lang.String" parameterType="java.lang.String">
- select max(cast(g.org_id as SIGNED) ) as org_id from bis_insp_org g order by g.org_id desc
- </select>
- <select id="get" resultMap="bisInspOrgResultMap" parameterType="java.lang.String">
- select
- <include refid="table_columns"/>
- from BIS_INSP_ORG where ORG_ID = #{id}
- </select>
- <select id="getBy" resultMap="bisInspOrgResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_ORG
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="bisInspOrgResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_ORG
- </select>
- <select id="findList" resultMap="bisInspOrgResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_ORG
- <include refid="page_where"/>
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from BIS_INSP_ORG
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.OlBisInspOrg">
- insert into BIS_INSP_ORG(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from BIS_INSP_ORG where ORG_ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.OlBisInspOrg">
- delete from BIS_INSP_ORG
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update BIS_INSP_ORG set flag_valid = 0 where ORG_ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.OlBisInspOrg">
- update BIS_INSP_ORG
- <trim prefix="set" suffixOverrides=",">
- <if test="orgPid != null and orgPid != ''">ORG_PID = #{orgPid},</if>
- <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
- <if test="rlcode != null and rlcode != ''">RLCODE = #{rlcode},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="pblmLogo != null and pblmLogo != ''">PBLM_LOGO = #{pblmLogo},</if>
- <if test="quoteOrgId != null and quoteOrgId != ''">QUOTE_ORG_ID = #{quoteOrgId},</if>
- <if test="orgType != null and orgType != ''">ORG_TYPE = #{orgType},</if>
- </trim>
- <where>ORG_ID = #{orgId}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.OlBisInspOrg">
- update BIS_INSP_ORG
- <trim prefix="set" suffixOverrides=",">
- <if test="orgPid != null and orgPid != ''">ORG_PID = #{orgPid},</if>
- <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
- <if test="rlcode != null and rlcode != ''">RLCODE = #{rlcode},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="pblmLogo != null and pblmLogo != ''">PBLM_LOGO = #{pblmLogo},</if>
- <if test="quoteOrgId != null and quoteOrgId != ''">QUOTE_ORG_ID = #{quoteOrgId},</if>
- <if test="orgType != null and orgType != ''">ORG_TYPE = #{orgType},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <select id="getByPid" resultMap="bisInspOrgResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_ORG WHERE ORG_PID = #{pid}
- <if test="province !=null and province !=''">
- and rlcode=#{province}
- </if>
- order by org_id
- </select>
- <select id="getById" resultMap="bisInspOrgResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_ORG WHERE ORG_ID = #{id}
- <if test="province !=null and province !=''">
- and rlcode=#{province}
- </if>
- order by org_id
- </select>
- <select id="getOrgList" resultMap="bisInspOrgResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_ORG WHERE length(org_id) = 3
- <if test="relCode !=null and relCode !=''">
- and rlcode like '${relCode}%'
- </if>
- </select>
- <select id="getNodeOne" resultMap="bisInspOrgResultMap">
- select * from BIS_INSP_ORG where 1=1
- <if test="currentOrgId != null and currentOrgId != ''">and org_id= #{currentOrgId}</if>
- <if test="currentOrgId == null or currentOrgId == ''">and org_pid= 1</if>
- order by org_id
- </select>
- <select id="getNodeNext" resultMap="bisInspOrgResultMap">
- select * from BIS_INSP_ORG where org_pid = #{pid} order by org_id
- </select>
- </mapper>
|