| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <?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.AttInspTypeDutyDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.AttInspTypeDuty" id="attInspTypeDutyResultMap">
- <result property="dutyDep" column="DUTY_DEP"/>
- <result property="ptype" column="PTYPE"/>
- <result property="orgId" column="ORG_ID"/>
- </resultMap>
- <sql id="table_columns">
- DUTY_DEP,
- PTYPE,
- ORG_ID
- </sql>
- <sql id="entity_properties">
- #{dutyDep},
- #{ptype},
- #{orgId}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="dutyDep != null and dutyDep != ''">
- and DUTY_DEP = #{dutyDep}
- </if>
- <if test="ptype != null and ptype != ''">
- and PTYPE = #{ptype}
- </if>
- <if test="orgId != null and orgId != ''">
- and ORG_ID = #{orgId}
- </if>
- and DATA_STAT='0'
- </trim>
- </sql>
- <select id="get" resultMap="attInspTypeDutyResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from ATT_INSP_TYPE_DUTY where ID = #{id}
- </select>
- <select id="getBy" resultMap="attInspTypeDutyResultMap">
- select
- <include refid="table_columns"/>
- from ATT_INSP_TYPE_DUTY
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="attInspTypeDutyResultMap">
- select
- <include refid="table_columns"/>
- from ATT_INSP_TYPE_DUTY
- </select>
- <select id="findList" resultMap="attInspTypeDutyResultMap">
- select
- <include refid="table_columns"/>
- from ATT_INSP_TYPE_DUTY
- <include refid="page_where"/>
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from ATT_INSP_TYPE_DUTY
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttInspTypeDuty">
- insert into ATT_INSP_TYPE_DUTY(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- update ATT_INSP_TYPE_DUTY set DATA_STAT='9' where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttInspTypeDuty">
- update ATT_INSP_TYPE_DUTY set DATA_STAT='9'
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update ATT_INSP_TYPE_DUTY set DATA_STAT = '9' where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttInspTypeDuty">
- update ATT_INSP_TYPE_DUTY
- <trim prefix="set" suffixOverrides=",">
- <if test="dutyDep != null and dutyDep != ''">DUTY_DEP
- = #{dutyDep},
- </if>
- <if test="ptype != null and ptype != ''">PTYPE
- = #{ptype},
- </if>
- <if test="orgId != null and orgId != ''">ORG_ID
- = #{orgId},
- </if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttInspTypeDuty">
- update ATT_INSP_TYPE_DUTY
- <trim prefix="set" suffixOverrides=",">
- <if test="dutyDep != null and dutyDep != ''">DUTY_DEP
- = #{dutyDep},
- </if>
- <if test="ptype != null and ptype != ''">PTYPE
- = #{ptype},
- </if>
- <if test="orgId != null and orgId != ''">ORG_ID
- = #{orgId},
- </if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <select id="arrayByOrgId" resultType="java.lang.String">
- SELECT DISTINCT DUTY_DEP FROM ATT_INSP_TYPE_DUTY where ORG_ID = #{adCode}
- </select>
- </mapper>
|