| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- <?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">
- <!-- namespace必须指向DAO接口 -->
- <mapper namespace="com.jpsoft.employment.modules.base.dao.TemplateOptionDAO">
- <resultMap id="TemplateOptionMap" type="com.jpsoft.employment.modules.base.entity.TemplateOption">
- <id property="id" column="id_"/>
- <result property="templateId" column="template_id"/>
- <result property="serialNum" column="serial_num"/>
- <result property="name" column="name_"/>
- <result property="budgetRevenue" column="budget_revenue"/>
- <result property="index" column="index_"/>
- <result property="createTime" column="create_time"/>
- <result property="updateTime" column="update_time"/>
- <result property="createBy" column="create_by"/>
- <result property="updateBy" column="update_by"/>
- <result property="delFlag" column="del_flag"/>
- <result property="departmentIds" column="department_ids"/>
- <result property="isSum" column="is_sum"/>
- <result property="incomeTimeRange" column="income_time_range" />
- <result property="incomeType" column="income_type" />
- <result property="endDate" column="end_date" />
- <result property="chargePerson" column="charge_person" />
- <result property="curBudgetRevenue" column="cur_budget_revenue" />
- <result property="isCountSummary" column="is_count_summary" />
- </resultMap>
- <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.TemplateOption">
- <!--
- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
- select sys_guid() from dual
- </selectKey>
- -->
- <![CDATA[
- insert into base_template_option
- (id_,template_id,serial_num,name_,budget_revenue,index_,create_time,update_time,
- create_by,update_by,del_flag,department_ids,is_sum,income_time_range,income_type,
- end_date,charge_person,cur_budget_revenue,is_count_summary)
- values
- (
- #{id,jdbcType=VARCHAR}
- ,#{templateId,jdbcType=VARCHAR}
- ,#{serialNum,jdbcType=VARCHAR}
- ,#{name,jdbcType=VARCHAR}
- ,#{budgetRevenue,jdbcType=NUMERIC}
- ,#{index,jdbcType= NUMERIC }
- ,#{createTime,jdbcType= TIMESTAMP }
- ,#{updateTime,jdbcType= TIMESTAMP }
- ,#{createBy,jdbcType=VARCHAR}
- ,#{updateBy,jdbcType=VARCHAR}
- ,#{delFlag,jdbcType= NUMERIC }
- ,#{departmentIds,jdbcType=VARCHAR}
- ,#{isSum,jdbcType= NUMERIC }
- ,#{incomeTimeRange,jdbcType=VARCHAR}
- ,#{incomeType,jdbcType=VARCHAR}
- ,#{endDate,jdbcType= TIMESTAMP }
- ,#{chargePerson,jdbcType=VARCHAR}
- ,#{curBudgetRevenue,jdbcType= NUMERIC }
- ,#{isCountSummary,jdbcType= NUMERIC }
- )
- ]]>
- </insert>
- <delete id="delete" parameterType="string">
- delete from base_template_option where id_=#{id,jdbcType=VARCHAR}
- </delete>
- <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.TemplateOption">
- update base_template_option
- <set>
- <if test="templateId!=null">
- template_id=#{templateId,jdbcType=VARCHAR},
- </if>
- <if test="serialNum!=null">
- serial_num=#{serialNum,jdbcType=VARCHAR},
- </if>
- <if test="name!=null">
- name_=#{name,jdbcType=VARCHAR},
- </if>
- <if test="budgetRevenue!=null">
- budget_revenue=#{budgetRevenue,jdbcType=NUMERIC},
- </if>
- <if test="index!=null">
- index_=#{index,jdbcType= NUMERIC },
- </if>
- <if test="createTime!=null">
- create_time=#{createTime,jdbcType= TIMESTAMP },
- </if>
- <if test="updateTime!=null">
- update_time=#{updateTime,jdbcType= TIMESTAMP },
- </if>
- <if test="createBy!=null">
- create_by=#{createBy,jdbcType=VARCHAR},
- </if>
- <if test="updateBy!=null">
- update_by=#{updateBy,jdbcType=VARCHAR},
- </if>
- <if test="delFlag!=null">
- del_flag=#{delFlag,jdbcType= NUMERIC },
- </if>
- <if test="departmentIds!=null">
- department_ids=#{departmentIds,jdbcType=VARCHAR},
- </if>
- <if test="isSum!=null">
- is_sum=#{isSum,jdbcType= NUMERIC },
- </if>
- <if test="incomeTimeRange!=null">
- income_time_range=#{incomeTimeRange,jdbcType=VARCHAR},
- </if>
- <if test="incomeType!=null">
- income_type=#{incomeType,jdbcType=VARCHAR},
- </if>
- <if test="endDate!=null">
- end_date=#{endDate,jdbcType= TIMESTAMP },
- </if>
- <if test="chargePerson!=null">
- charge_person=#{chargePerson,jdbcType=VARCHAR},
- </if>
- <if test="curBudgetRevenue!=null">
- cur_budget_revenue=#{curBudgetRevenue,jdbcType= NUMERIC },
- </if>
- <if test="isCountSummary!=null">
- is_count_summary=#{isCountSummary,jdbcType= NUMERIC },
- </if>
- </set>
- where id_=#{id}
- </update>
- <select id="get" parameterType="string" resultMap="TemplateOptionMap">
- select * from base_template_option where id_=#{0}
- </select>
- <select id="exist" parameterType="string" resultType="int">
- select count(*) from base_template_option where id_=#{0}
- </select>
- <select id="list" resultMap="TemplateOptionMap">
- select * from base_template_option
- </select>
- <select id="findLastIndexByTemplateId" resultType="java.lang.String">
- select index_ from base_template_option
- where del_flag=false
- and template_id=#{templateId}
- order by index_ desc
- limit 1
- </select>
- <select id="findByTemplateId" resultMap="TemplateOptionMap">
- select * from base_template_option
- where del_flag=false
- and template_id=#{templateId}
- order by index_ asc
- </select>
- <select id="findByTemplateIdAndLen" resultMap="TemplateOptionMap">
- select * from base_template_option
- where del_flag=false
- and template_id=#{templateId}
- and length(serial_num)=#{length}
- order by index_ asc
- </select>
- <select id="search" parameterType="hashmap" resultMap="TemplateOptionMap">
- <![CDATA[
- select * from base_template_option
- ]]>
- <where>
- del_flag=false
- <if test="searchParams.id != null">
- and ID_ like #{searchParams.id}
- </if>
- </where>
- <foreach item="sort" collection="sortList" open="order by" separator=",">
- ${sort.name} ${sort.order}
- </foreach>
- </select>
- <select id="findByConditions" parameterType="hashmap" resultMap="TemplateOptionMap">
- <![CDATA[
- select * from base_template_option
- ]]>
- <where>
- del_flag=false
- <if test="searchParams.templateId != null">
- and template_id = #{searchParams.templateId}
- </if>
- <if test="searchParams.departmentId != null">
- and department_ids like #{searchParams.departmentId}
- </if>
- </where>
- order by index_ asc
- </select>
- <select id="findByTemplateIdAndNum" resultMap="TemplateOptionMap">
- SELECT * FROM base_template_option
- WHERE del_flag=false and template_id=#{templateId}
- and serial_num LIKE #{serialNum}
- and length(serial_num)=#{length}
- order by index_ asc
- </select>
- </mapper>
|