Dao

@Repository
public interface CustomerDAO {
    public void create(CustomerModel cm);
    public void update(CustomerModel cm);
    public void delete(CustomerModel cm);
    
    public CustomerModel getByUuid(int uuid);
    
    public List<CustomerModel> getByCondition(CustomerQueryModel cqm);
            
}

实体

public class CustomerModel {
    private Integer uuid;
    private String customerId;
    private String pwd;
    private String showName;
    private String trueName;
    private String registerTime;

}

<?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.exayong.architecture1.customermgr.dao.CustomerDAO">
    <insert id="create" parameterType="CM">
        insert into
        tbl_customer(customerId,pwd,showName,trueName,registerTime)values(#{customerId},#{pwd},#{showName},#{trueName},#{registerTime})
    </insert>
    <update id="update" parameterType="CM">
        update tbl_customer set
        customerId=#{customerId},pwd=#{pwd},showName=#{showName},trueName=#{trueName},registerTime=#{registerTime}
        where uuid=#{uuid}
    </update>

<delete id="delete" parameterType="Int">
        delete from tbl customer where uuid=#{uuid}

</delete>

<select id="getByUuid" parameterType="Int" resultType="CM">
        select * from tbl_customer where uuid=#{_uuid}

</select>
    <select id="getByCondition" parameterType="CQM" resultType="CM">
        select * from tbl_customer
        <where>
            <if test="uuid=null &amp;&amp; uuid >0">
                and uuid=#{_uuid}

</if>
            <if test="customerId=null">
                and customerId=#{customerId}

</if>
            <if test="showName=null">
                and showName=#{showName}
            </if>
        </where>

</select>
</mapper>

最新文章

  1. Linux下C语言编程实现spwd函数
  2. mysql create db utf8 character
  3. go 入门之环境搭建-Windows
  4. 前端开发规范之html编码规范
  5. ActiveMQ集成到Spring
  6. Owasp Top 10 Security Risks for 2014
  7. 组态Log4j(非常具体的)
  8. vuethink 配置
  9. k8s-jenkins 自动化1
  10. HBuilder git使用-环境配置
  11. .net core 2.x - 日志 - to elasticsearch - (2)
  12. C# 把byte[]输出为图片文件
  13. Jenkins配置自动化构建
  14. 树莓派操控SG90舵机
  15. MySQL主从常见的架构
  16. raise语句
  17. PSR2规范
  18. TortoiseGit学习系列之TortoiseGit基本操作拉取项目(图文详解)
  19. 【转+修改】容联云通讯api调用短信发送调用
  20. [翻译] TLMotionEffect 重力感应

热门文章

  1. linux常用命令及系统常见符号
  2. catalan 递推
  3. jQuery -- touch事件之滑动判断(左右上下方向)
  4. css对于文字过长加省略号
  5. scrapy-redis(一)
  6. 1.numpy_overview
  7. 『计算机视觉』Mask-RCNN_锚框生成
  8. Python-Selenium中chromeDriver限制图片和Javascript加载
  9. 笔记react router 4(一)
  10. 导出csv文件数字会自动变科学计数法的解决方法