|
|
@@ -16,16 +16,17 @@
|
|
|
<result column="DELETE_MAN_NAME" jdbcType="VARCHAR" property="deleteManName" />
|
|
|
<result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime" />
|
|
|
<result column="UNIT_TYPE" jdbcType="VARCHAR" property="unitType" />
|
|
|
+ <result column="MEMO" jdbcType="VARCHAR" property="memo" />
|
|
|
</resultMap>
|
|
|
<sql id="columns">
|
|
|
CARRIER_UNIT_NO, CARRIER_UNIT_NAME, MNEMONIC_CODE, VALID_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME,
|
|
|
CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, DELETE_MAN_NO, DELETE_MAN_NAME,
|
|
|
- DELETE_TIME, UNIT_TYPE
|
|
|
+ DELETE_TIME, UNIT_TYPE, MEMO
|
|
|
</sql>
|
|
|
<sql id="columns_alias">
|
|
|
t.CARRIER_UNIT_NO, t.CARRIER_UNIT_NAME, t.MNEMONIC_CODE, t.VALID_FLAG, t.CREATE_MAN_NO,
|
|
|
t.CREATE_MAN_NAME, t.CREATE_TIME, t.UPDATE_MAN_NO, t.UPDATE_MAN_NAME, t.UPDATE_TIME,
|
|
|
- t.DELETE_MAN_NO, t.DELETE_MAN_NAME, t.DELETE_TIME, t.UNIT_TYPE
|
|
|
+ t.DELETE_MAN_NO, t.DELETE_MAN_NAME, t.DELETE_TIME, t.UNIT_TYPE, t.MEMO
|
|
|
</sql>
|
|
|
<sql id="select">
|
|
|
SELECT <include refid="columns"/> FROM METER_BASE_UNIT_DIRECT
|
|
|
@@ -77,6 +78,9 @@
|
|
|
<if test="unitType != null and unitType != ''">
|
|
|
and UNIT_TYPE = #{unitType}
|
|
|
</if>
|
|
|
+ <if test="memo != null and memo != ''">
|
|
|
+ and MEMO = #{memo}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
<sql id="whereLike">
|
|
|
@@ -123,6 +127,9 @@
|
|
|
<if test="unitType != null and unitType != ''">
|
|
|
and UNIT_TYPE LIKE '%${unitType}%'
|
|
|
</if>
|
|
|
+ <if test="memo != null and memo != ''">
|
|
|
+ and MEMO LIKE '%${memo}%'
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
|
@@ -171,18 +178,23 @@
|
|
|
<if test="unitType != null and unitType != ''">
|
|
|
or UNIT_TYPE = #{unitType}
|
|
|
</if>
|
|
|
+ <if test="memo != null and memo != ''">
|
|
|
+ or MEMO = #{memo}
|
|
|
+ </if>
|
|
|
</delete>
|
|
|
<insert id="insert" parameterType="com.steerinfo.baseinfo.meterbaseunitdirect.model.MeterBaseUnitDirect">
|
|
|
insert into METER_BASE_UNIT_DIRECT (CARRIER_UNIT_NO, CARRIER_UNIT_NAME, MNEMONIC_CODE,
|
|
|
VALID_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME,
|
|
|
CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME,
|
|
|
UPDATE_TIME, DELETE_MAN_NO, DELETE_MAN_NAME,
|
|
|
- DELETE_TIME, UNIT_TYPE)
|
|
|
+ DELETE_TIME, UNIT_TYPE, MEMO
|
|
|
+ )
|
|
|
values (#{carrierUnitNo,jdbcType=VARCHAR}, #{carrierUnitName,jdbcType=VARCHAR}, #{mnemonicCode,jdbcType=VARCHAR},
|
|
|
#{validFlag,jdbcType=VARCHAR}, #{createManNo,jdbcType=VARCHAR}, #{createManName,jdbcType=VARCHAR},
|
|
|
#{createTime,jdbcType=TIMESTAMP}, #{updateManNo,jdbcType=VARCHAR}, #{updateManName,jdbcType=VARCHAR},
|
|
|
#{updateTime,jdbcType=TIMESTAMP}, #{deleteManNo,jdbcType=VARCHAR}, #{deleteManName,jdbcType=VARCHAR},
|
|
|
- #{deleteTime,jdbcType=TIMESTAMP}, #{unitType,jdbcType=VARCHAR})
|
|
|
+ #{deleteTime,jdbcType=TIMESTAMP}, #{unitType,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR}
|
|
|
+ )
|
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.steerinfo.baseinfo.meterbaseunitdirect.model.MeterBaseUnitDirect">
|
|
|
insert into METER_BASE_UNIT_DIRECT
|
|
|
@@ -229,6 +241,9 @@
|
|
|
<if test="unitType != null">
|
|
|
UNIT_TYPE,
|
|
|
</if>
|
|
|
+ <if test="memo != null">
|
|
|
+ MEMO,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="carrierUnitNo != null">
|
|
|
@@ -273,6 +288,9 @@
|
|
|
<if test="unitType != null">
|
|
|
#{unitType,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="memo != null">
|
|
|
+ #{memo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKey" parameterType="com.steerinfo.baseinfo.meterbaseunitdirect.model.MeterBaseUnitDirect">
|
|
|
@@ -289,7 +307,8 @@
|
|
|
DELETE_MAN_NO = #{deleteManNo,jdbcType=VARCHAR},
|
|
|
DELETE_MAN_NAME = #{deleteManName,jdbcType=VARCHAR},
|
|
|
DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
|
|
|
- UNIT_TYPE = #{unitType,jdbcType=VARCHAR}
|
|
|
+ UNIT_TYPE = #{unitType,jdbcType=VARCHAR},
|
|
|
+ MEMO = #{memo,jdbcType=VARCHAR}
|
|
|
where CARRIER_UNIT_NO = #{carrierUnitNo,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.baseinfo.meterbaseunitdirect.model.MeterBaseUnitDirect">
|
|
|
@@ -334,6 +353,9 @@
|
|
|
<if test="unitType != null">
|
|
|
UNIT_TYPE = #{unitType,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="memo != null">
|
|
|
+ MEMO = #{memo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where CARRIER_UNIT_NO = #{carrierUnitNo,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
@@ -356,7 +378,8 @@
|
|
|
VALID_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME,
|
|
|
CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME,
|
|
|
UPDATE_TIME, DELETE_MAN_NO, DELETE_MAN_NAME,
|
|
|
- DELETE_TIME, UNIT_TYPE)
|
|
|
+ DELETE_TIME, UNIT_TYPE, MEMO
|
|
|
+ )
|
|
|
( <foreach collection="list" item="item" separator="union all">
|
|
|
select
|
|
|
#{item.carrierUnitNo,jdbcType=VARCHAR},
|
|
|
@@ -364,7 +387,8 @@
|
|
|
#{item.validFlag,jdbcType=VARCHAR}, #{item.createManNo,jdbcType=VARCHAR}, #{item.createManName,jdbcType=VARCHAR},
|
|
|
#{item.createTime,jdbcType=TIMESTAMP}, #{item.updateManNo,jdbcType=VARCHAR}, #{item.updateManName,jdbcType=VARCHAR},
|
|
|
#{item.updateTime,jdbcType=TIMESTAMP}, #{item.deleteManNo,jdbcType=VARCHAR}, #{item.deleteManName,jdbcType=VARCHAR},
|
|
|
- #{item.deleteTime,jdbcType=TIMESTAMP}, #{item.unitType,jdbcType=VARCHAR} from dual
|
|
|
+ #{item.deleteTime,jdbcType=TIMESTAMP}, #{item.unitType,jdbcType=VARCHAR}, #{item.memo,jdbcType=VARCHAR}
|
|
|
+ from dual
|
|
|
</foreach> )
|
|
|
</insert>
|
|
|
<update id="batchUpdate" parameterType="java.util.List">
|
|
|
@@ -426,6 +450,10 @@
|
|
|
<foreach collection="list" item="item" index="index" separator=" " open="case CARRIER_UNIT_NO" close="end">
|
|
|
when #{item.carrierUnitNo,jdbcType=VARCHAR} then #{item.unitType,jdbcType=VARCHAR}
|
|
|
</foreach>
|
|
|
+ ,MEMO=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case CARRIER_UNIT_NO" close="end">
|
|
|
+ when #{item.carrierUnitNo,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
where CARRIER_UNIT_NO in
|
|
|
<foreach collection="list" index="index" item="item" separator="," open="(" close=")">
|
|
|
#{item.carrierUnitNo,jdbcType=VARCHAR}
|
|
|
@@ -441,8 +469,8 @@
|
|
|
<!-- 友情提示!!!-->
|
|
|
<!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
|
|
|
<select id="GetNewID" parameterType="java.lang.String" resultType="java.lang.String">
|
|
|
- SELECT LPAD(NVL(MAX(TO_NUMBER(SUBSTR(CARRIER_UNIT_NO, LENGTH(CARRIER_UNIT_NO) -3))),0) + 1,4,'0') CARRIER_UNIT_NO
|
|
|
- FROM METER_BASE_UNIT_DIRECT where instr(CARRIER_UNIT_NO, to_char(sysdate, 'yyyyMMdd')) > 0
|
|
|
+ SELECT LPAD(NVL(MAX(TO_NUMBER(SUBSTR(CARRIER_UNIT_NO, LENGTH(CARRIER_UNIT_NO) - 4))),0) + 1,5,'0') CARRIER_UNIT_NO
|
|
|
+ FROM METER_BASE_UNIT_DIRECT
|
|
|
</select>
|
|
|
|
|
|
<select id="selectForUpdate" parameterType="java.util.HashMap" resultMap="BaseResultMap">
|
|
|
@@ -452,7 +480,7 @@
|
|
|
and CARRIER_UNIT_NO != #{carrierUnitNo}
|
|
|
</if>
|
|
|
<if test="carrierUnitName != null and carrierUnitName != ''">
|
|
|
- and CARRIER_UNIT_NAME = #{carrierUnitName}
|
|
|
+ and CARRIER_UNIT_NAME = #{matterName}
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|