<?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.brilliance.isc.mda.dao.GimGffMapper"> <resultMap type="com.brilliance.isc.bo.Gimgff" id="BaseResultMap"> <result property="inr" column="INR" jdbcType="VARCHAR"/> <result property="ctlcod" column="CTLCOD" jdbcType="VARCHAR"/> <result property="begdat" column="BEGDAT" jdbcType="TIMESTAMP"/> <result property="enddat" column="ENDDAT" jdbcType="TIMESTAMP"/> <result property="usr" column="USR" jdbcType="VARCHAR"/> <result property="updtyp" column="UPDTYP" jdbcType="VARCHAR"/> <result property="ctlflg" column="CTLFLG" jdbcType="VARCHAR"/> </resultMap> <insert id="insert"> insert into GIMGFF(INR, CTLCOD, BEGDAT, ENDDAT, USR, UPDTYP, CTLFLG) values (#{inr}, #{ctlcod}, now(), str_to_date('2299-12-31 23:59:00','%Y-%m-%d %H:%i:%s'), #{usr}, #{updtyp}, #{ctlflg}) </insert> <update id="update"> update GIMGFF <set> ENDDAT = now(), </set> where INR= #{inr} </update> <select id="selectFCount" resultType="java.lang.Integer"> select count(1) from gimgff where date_format(enddat,'%Y-%m-%d') = '2299-12-31' and ctlflg = 'G' and ctlcod = '1' </select> <select id="selectCtlcodU" resultType="java.lang.String"> select ctlcod from gimgff where date_format(enddat,'%Y-%m-%d') = '2299-12-31' and ctlflg = 'U' limit 1 </select> <select id="queryByIdU" resultType="com.brilliance.isc.bo.Gimgff"> select inr,ctlcod,begdat,enddat,usr,updtyp,ctlflg from gimgff where ctlflg='U' and date_format(ENDDAT, '%Y-%m-%d')='2299-12-31' ORDER BY length(INR) desc, inr DESC </select> <select id="queryByIdG" resultType="com.brilliance.isc.bo.Gimgff"> select inr,ctlcod,begdat,enddat,usr,updtyp,ctlflg from gimgff where ctlflg='G' and date_format(ENDDAT, '%Y-%m-%d')='2299-12-31' ORDER BY length(INR) DESC, inr DESC </select> <select id="queryAllByLimit" resultType="com.brilliance.isc.bo.Gimgff"> select inr,ctlcod,begdat,enddat,usr,updtyp,ctlflg from gimgff where ctlflg='U' ORDER BY length(inr) DESC, inr DESC </select> <select id="queryAllByLmt" resultType="com.brilliance.isc.bo.Gimgff"> select inr,ctlcod,begdat,enddat,usr,updtyp,ctlflg from gimgff where ctlflg='G' ORDER BY length(inr) DESC, inr DESC </select> <select id="seleme" resultType="java.lang.Integer"> select count(1) from gimgff where date_format(ENDDAT,'%Y%m%d')='22991231' and CTLFLG = 'U' and CTLCOD = #{ctlcod} </select> </mapper>