|
|
@@ -1,286 +0,0 @@
|
|
|
-<?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="jp.yamoto.farm.crm.biz.master.mapper.MastOksMapper">
|
|
|
-
|
|
|
- <resultMap type="MastOks" id="MastOksResult">
|
|
|
- <result property="oksCd" column="oks_cd"/>
|
|
|
- <result property="oksMei" column="oks_mei"/>
|
|
|
- <result property="oksMeiKn" column="oks_mei_kn"/>
|
|
|
- <result property="tenwabango" column="tenwabango"/>
|
|
|
- <result property="mailAddress" column="mail_address"/>
|
|
|
- <result property="haisiFlg" column="haisi_flg"/>
|
|
|
- <result property="haisiDt" column="haisi_dt"/>
|
|
|
- <result property="haisiRiyu" column="haisi_riyu"/>
|
|
|
- <result property="createBy" column="create_by"/>
|
|
|
- <result property="createTime" column="create_time"/>
|
|
|
- <result property="updateBy" column="update_by"/>
|
|
|
- <result property="updateTime" column="update_time"/>
|
|
|
- <result property="createPgId" column="create_pg_id"/>
|
|
|
- <result property="updatePgId" column="update_pg_id"/>
|
|
|
- <result property="version" column="version"/>
|
|
|
- <result property="todoFuken" column="todo_fuken"/>
|
|
|
- <result property="shikuChoson" column="shiku_choson"/>
|
|
|
- <result property="banchiIka" column="banchi_ika"/>
|
|
|
- <result property="yubenbango" column="yubenbango"/>
|
|
|
- <result property="nokaCd" column="noka_cd"/>
|
|
|
- </resultMap>
|
|
|
-
|
|
|
- <sql id="selectMastOksVo">
|
|
|
- select
|
|
|
- oks_cd,
|
|
|
- oks_mei,
|
|
|
- oks_mei_kn,
|
|
|
- tenwabango,
|
|
|
- mail_address,
|
|
|
- haisi_flg,
|
|
|
- haisi_dt,
|
|
|
- haisi_riyu,
|
|
|
- create_time,
|
|
|
- create_by,
|
|
|
- create_pg_id,
|
|
|
- update_time,
|
|
|
- update_by,
|
|
|
- update_pg_id,
|
|
|
- version,
|
|
|
- todo_fuken,
|
|
|
- shiku_choson,
|
|
|
- banchi_ika,
|
|
|
- yubenbango,
|
|
|
- noka_cd
|
|
|
- from mast_okyakusama
|
|
|
- </sql>
|
|
|
-
|
|
|
- <select id="selectList" parameterType="MastOks" resultMap="MastOksResult">
|
|
|
- <include refid="selectMastOksVo"/>
|
|
|
- <where>
|
|
|
- <if test="oksCd != null and oksCd != ''">
|
|
|
- and oks_cd = #{oksCd}
|
|
|
- </if>
|
|
|
- <if test="oksMei != null and oksMei != ''">
|
|
|
- and oks_mei like '%' || #{oksMei} || '%'
|
|
|
- </if>
|
|
|
- <if test="haisiFlg != null">
|
|
|
- and haisi_flg = #{haisiFlg}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- order by oks_cd asc
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectById" parameterType="String" resultMap="MastOksResult">
|
|
|
- <include refid="selectMastOksVo"/>
|
|
|
- where oks_cd = #{oksCd}
|
|
|
- </select>
|
|
|
-
|
|
|
- <insert id="insert" parameterType="MastOks">
|
|
|
- insert into mast_okyakusama
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="oksCd != null">
|
|
|
- oks_cd,
|
|
|
- </if>
|
|
|
- <if test="oksMei != null">
|
|
|
- oks_mei,
|
|
|
- </if>
|
|
|
- <if test="oksMeiKn != null">
|
|
|
- oks_mei_kn,
|
|
|
- </if>
|
|
|
- <if test="tenwabango != null">
|
|
|
- tenwabango,
|
|
|
- </if>
|
|
|
- <if test="mailAddress != null">
|
|
|
- mail_address,
|
|
|
- </if>
|
|
|
- <if test="todoFuken != null">
|
|
|
- todo_fuken,
|
|
|
- </if>
|
|
|
- <if test="shikuChoson != null">
|
|
|
- shiku_choson,
|
|
|
- </if>
|
|
|
- <if test="banchiIka != null">
|
|
|
- banchi_ika,
|
|
|
- </if>
|
|
|
- <if test="yubenbango != null">
|
|
|
- yubenbango,
|
|
|
- </if>
|
|
|
- <if test="nokaCd != null">
|
|
|
- noka_cd,
|
|
|
- </if>
|
|
|
- <if test="haisiFlg != null">
|
|
|
- haisi_flg,
|
|
|
- </if>
|
|
|
- <if test="haisiDt != null">
|
|
|
- haisi_dt,
|
|
|
- </if>
|
|
|
- <if test="haisiRiyu != null">
|
|
|
- haisi_riyu,
|
|
|
- </if>
|
|
|
- <if test="version != null">
|
|
|
- version,
|
|
|
- </if>
|
|
|
- <if test="createBy != null">
|
|
|
- create_by,
|
|
|
- </if>
|
|
|
- <if test="createTime != null">
|
|
|
- create_time,
|
|
|
- </if>
|
|
|
- <if test="createPgId != null">
|
|
|
- create_pg_id,
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="oksCd != null">
|
|
|
- #{oksCd},
|
|
|
- </if>
|
|
|
- <if test="oksMei != null">
|
|
|
- #{oksMei},
|
|
|
- </if>
|
|
|
- <if test="oksMeiKn != null">
|
|
|
- #{oksMeiKn},
|
|
|
- </if>
|
|
|
- <if test="tenwabango != null">
|
|
|
- #{tenwabango},
|
|
|
- </if>
|
|
|
- <if test="mailAddress != null">
|
|
|
- #{mailAddress},
|
|
|
- </if>
|
|
|
- <if test="todoFuken != null">
|
|
|
- #{todoFuken},
|
|
|
- </if>
|
|
|
- <if test="shikuChoson != null">
|
|
|
- #{shikuChoson},
|
|
|
- </if>
|
|
|
- <if test="banchiIka != null">
|
|
|
- #{banchiIka},
|
|
|
- </if>
|
|
|
- <if test="yubenbango != null">
|
|
|
- #{yubenbango},
|
|
|
- </if>
|
|
|
- <if test="nokaCd != null">
|
|
|
- #{nokaCd},
|
|
|
- </if>
|
|
|
- <if test="haisiFlg != null">
|
|
|
- #{haisiFlg},
|
|
|
- </if>
|
|
|
- <if test="haisiDt != null">
|
|
|
- #{haisiDt},
|
|
|
- </if>
|
|
|
- <if test="haisiRiyu != null">
|
|
|
- #{haisiRiyu},
|
|
|
- </if>
|
|
|
- <if test="version != null">
|
|
|
- #{version},
|
|
|
- </if>
|
|
|
- <if test="createBy != null">
|
|
|
- #{createBy},
|
|
|
- </if>
|
|
|
- <if test="createTime != null">
|
|
|
- #{createTime},
|
|
|
- </if>
|
|
|
- <if test="createPgId != null">
|
|
|
- #{createPgId},
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
-
|
|
|
- <!-- 修正6:更新语句表名改为mast_oks -->
|
|
|
- <update id="update" parameterType="MastOks">
|
|
|
- update mast_okyakusama
|
|
|
- <trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="oksCd != null">
|
|
|
- oks_cd = #{oksCd},
|
|
|
- </if>
|
|
|
- <if test="oksMei != null">
|
|
|
- oks_mei = #{oksMei},
|
|
|
- </if>
|
|
|
- <if test="oksMeiKn != null">
|
|
|
- oks_mei_kn = #{oksMeiKn},
|
|
|
- </if>
|
|
|
- <if test="tenwabango != null">
|
|
|
- tenwabango = #{tenwabango},
|
|
|
- </if>
|
|
|
- <if test="mailAddress != null">
|
|
|
- mail_address = #{mailAddress},
|
|
|
- </if>
|
|
|
- <if test="todoFuken != null">
|
|
|
- todo_fuken = #{todoFuken},
|
|
|
- </if>
|
|
|
- <if test="shikuChoson != null">
|
|
|
- shiku_choson = #{shikuChoson},
|
|
|
- </if>
|
|
|
- <if test="banchiIka != null">
|
|
|
- banchi_ika = #{banchiIka},
|
|
|
- </if>
|
|
|
- <if test="yubenbango != null">
|
|
|
- yubenbango = #{yubenbango},
|
|
|
- </if>
|
|
|
- <if test="nokaCd != null">
|
|
|
- noka_cd = #{nokaCd},
|
|
|
- </if>
|
|
|
- <if test="haisiFlg != null">
|
|
|
- haisi_flg = #{haisiFlg},
|
|
|
- </if>
|
|
|
- <if test="haisiDt != null">
|
|
|
- haisi_dt = #{haisiDt},
|
|
|
- </if>
|
|
|
- <if test="haisiRiyu != null">
|
|
|
- haisi_riyu = #{haisiRiyu},
|
|
|
- </if>
|
|
|
- <if test="version != null">
|
|
|
- version = #{version} + 1,
|
|
|
- </if>
|
|
|
- <if test="updateBy != null">
|
|
|
- update_by = #{updateBy},
|
|
|
- </if>
|
|
|
- <if test="updateTime != null">
|
|
|
- update_time = #{updateTime},
|
|
|
- </if>
|
|
|
- <if test="updatePgId != null">
|
|
|
- update_pg_id = #{updatePgId},
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- where
|
|
|
- oks_cd = #{oksCd}
|
|
|
- and version = #{version}
|
|
|
- </update>
|
|
|
-
|
|
|
- <select id="getOksCdCount" parameterType="String" resultType="java.lang.Integer">
|
|
|
- SELECT
|
|
|
- count(1)
|
|
|
- FROM
|
|
|
- mast_okyakusama
|
|
|
- <where>
|
|
|
- <if test="oksCd != null and oksCd != ''">
|
|
|
- and oks_cd = #{oksCd}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- </select>
|
|
|
-
|
|
|
- <delete id="deleteById" parameterType="String">
|
|
|
- delete
|
|
|
- from
|
|
|
- mast_okyakusama
|
|
|
- where oks_cd = #{oksCd}
|
|
|
- </delete>
|
|
|
-
|
|
|
- <update id="deleteLogicByIdAndVersion" parameterType="MastOks">
|
|
|
- update
|
|
|
- mast_okyakusama
|
|
|
- set
|
|
|
- haisi_flg = 1,
|
|
|
- version = version + 1,
|
|
|
- <if test="updateBy != null">
|
|
|
- update_by = #{updateBy},
|
|
|
- </if>
|
|
|
- <if test="updateTime != null">
|
|
|
- update_time = #{updateTime}
|
|
|
- </if>
|
|
|
- <where>
|
|
|
- <if test="oksCd != null and oksCd != ''">
|
|
|
- and oks_cd = #{oksCd}
|
|
|
- </if>
|
|
|
- and version = #{version}
|
|
|
- and haisi_flg = 0
|
|
|
- </where>
|
|
|
- </update>
|
|
|
-</mapper>
|