orcal
杂项
and EBOARD_CERTIFICATECODE like '%${certificateCode}%'
and regexp_like(EBOARD_CERTIFICATECODE ,
substr(SMP_MATERIALBATCH, 0, 6)
SYSDATE
XML文件:头
<?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.gwm.lms.asm.outStockGuid.mapper.GuidProductStockMapper">
</mapper>
Mybatis基本用法
<resultMap id="BatchVo" type="com.gwm.lms.asm.outStockGuid.entity.BatchVo">
<result column="SMP_MATERIALNAME" jdbcType="VARCHAR" property="productName" />
<result column="SMP_MATERIALNUM" jdbcType="DECIMAL" property="alreadyNumber" />
</resultMap>
<sql id="Select_Field">
SMP_MATERIALNAME,
SMP_MATERIALNUM
</sql>
<sql id="Base_Where_Clause">
<where>
<trim prefixOverrides="and">
<if test="id!= null ">
and BOARD_ID = #{id}
</if>
<if test="batchCode!=null and batchCode!=''">
and BOARD_BATCHCODE = #{batchCode}
</if>
</trim>
</where>
</sql>
<select id="select" resultMap="GzDetailMap" parameterType="com.gwm.lms.asm.stock.entity.GzDetailEntity">
SELECT GZ02_ID
FROM GZ02_DETAIL LEFT JOIN GZ01_TYPE ON GZ02_DETAIL.GZ01_ID = GZ01_TYPE.GZ01_ID
<include refid="Base_Where_Clause" />
</select>
<update id="updateById" parameterType="com.gwm.lms.asm.stock.entity.GzDetailEntity">
update 表名
<set>
<if test="id!= null">
GZ02_ID = #{id},
</if>
</set>
</update>
<insert id="insert" parameterType="com.gwm.lms.asm.stock.entity.GzDetailEntity">
INSERT INTO GZ02_DETAIL
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id!= null">
GZ02_ID,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id!= null">
#{id},
</if>
</trim>
</insert>
<delete id="deleteById" parameterType="java.lang.String">
DELETE
FROM GZ02_DETAIL
WHERE GZ02_ID = #{id}
</delete>