场景模型测试工具
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
scmy/psdc-business/src/main/resources/mapper/business/PrivateKeyMapper.xml

77 lines
2.6 KiB

<?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.psdc.mapper.PrivateKeyMapper">
<resultMap type="com.psdc.entity.PrivateKey" id="PrivateKeyMap">
<result property="id" column="id" />
<result property="publicKey" column="public_key" />
<result property="privateKey" column="private_key" />
<result property="keyUnit" column="key_unit" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<select id="queryAllByLimit" resultMap="PrivateKeyMap">
SELECT * FROM private_key
<where>
<if test="keyUnit != null and keyUnit != ''">
key_unit Like CONCAT("%",#{keyUnit},"%")
</if>
</where>
Limit #{pageCurrent}, #{pageSize}
</select>
<select id="selectAll" resultMap="PrivateKeyMap">
SELECT * FROM private_key
</select>
<select id="selectOne" resultMap="PrivateKeyMap">
SELECT * FROM private_key Where id = ${id}
</select>
<select id="selectCount" resultType="java.lang.Long">
Select COUNT(1) From private_key
<where>
<if test="keyUnit != null and keyUnit != ''">
key_unit Like CONCAT("%",#{keyUnit},"%")
</if>
</where>
</select>
<!--新增数据-->
<insert id="insert" >
Insert into private_key(private_key,public_key,key_unit,create_time,update_time)
values (#{privateKey},#{publicKey},#{keyUnit},#{createTime},#{updateTime})
</insert>
<!-- 更新数据 -->
<update id="update">
Update private_key
<set>
<if test="id != null and id != ''">
id = #{id},
</if>
<if test="privateKey != null and privateKey != ''">
private_key = #{privateKey},
</if>
<if test="publicKey != null and publicKey != ''">
public_key = #{publicKey},
</if>
<if test="keyUnit != null and keyUnit != ''">
key_unit = #{keyUnit},
</if>
<if test="createTime != null and createTime != ''">
create_time = #{createTime},
</if>
<if test="updateTime != null and updateTime != ''">
update_time = #{updateTime},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from private_key where id = #{id}
</delete>
</mapper>