Merge branch 'develop_3' into 'develop_master'

Develop 3

See merge request !40
This commit is contained in:
super_liu
2021-07-21 11:15:31 +00:00
18 changed files with 818 additions and 14 deletions
@@ -0,0 +1,164 @@
<?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.adc.da.slrs.sarBussStandAttrInfo.dao.SarBussStandAttrInfoDao">
<!-- Result Map-->
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarBussStandAttrInfo.entity.SarBussStandAttrInfo" >
<result column="id" property="id" />
<result column="stand_id" property="standId" />
<result column="creation_user" property="creationUser" />
<result column="valid_flag" property="validFlag" />
<result column="creation_time" property="creationTime" />
<result column="modify_time" property="modifyTime" />
</resultMap>
<!-- SAR_BUSS_STAND_ATTR_INFO table all fields -->
<sql id="Base_Column_List" >
id, stand_id, creation_user, valid_flag, creation_time, modify_time
</sql>
<!-- 查询条件 -->
<sql id="Base_Where_Clause">
where 1=1
<trim suffixOverrides="," >
<if test="id != null" >
and id ${idOperator} #{id}
</if>
<if test="standId != null" >
and stand_id ${standIdOperator} #{standId}
</if>
<if test="creationUser != null" >
and creation_user ${creationUserOperator} #{creationUser}
</if>
<if test="validFlag != null" >
and valid_flag ${validFlagOperator} #{validFlag}
</if>
<if test="creationTime != null" >
and creation_time ${creationTimeOperator} #{creationTime}
</if>
<if test="creationTime1 != null" >
and creation_time &gt;= #{creationTime1}
</if>
<if test="creationTime2 != null" >
and creation_time &lt;= #{creationTime2}
</if>
<if test="modifyTime != null" >
and modify_time ${modifyTimeOperator} #{modifyTime}
</if>
<if test="modifyTime1 != null" >
and modify_time &gt;= #{modifyTime1}
</if>
<if test="modifyTime2 != null" >
and modify_time &lt;= #{modifyTime2}
</if>
</trim>
</sql>
<!-- 插入记录 -->
<insert id="insert" parameterType="com.adc.da.slrs.sarBussStandAttrInfo.entity.SarBussStandAttrInfo" >
insert into SAR_BUSS_STAND_ATTR_INFO(<include refid="Base_Column_List" />)
values (#{id, jdbcType=VARCHAR}, #{standId, jdbcType=VARCHAR}, #{creationUser, jdbcType=VARCHAR}, #{validFlag, jdbcType=VARCHAR}, #{creationTime, jdbcType=TIMESTAMP}, #{modifyTime, jdbcType=TIMESTAMP})
</insert>
<!-- 动态插入记录 主键是序列 -->
<insert id="insertSelective" parameterType="com.adc.da.slrs.sarBussStandAttrInfo.entity.SarBussStandAttrInfo" >
insert into SAR_BUSS_STAND_ATTR_INFO
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >id,</if>
<if test="standId != null" >stand_id,</if>
<if test="creationUser != null" >creation_user,</if>
<if test="validFlag != null" >valid_flag,</if>
<if test="creationTime != null" >creation_time,</if>
<if test="modifyTime != null" >modify_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
<if test="standId != null" >#{standId, jdbcType=VARCHAR},</if>
<if test="creationUser != null" >#{creationUser, jdbcType=VARCHAR},</if>
<if test="validFlag != null" >#{validFlag, jdbcType=VARCHAR},</if>
<if test="creationTime != null" >#{creationTime, jdbcType=TIMESTAMP},</if>
<if test="modifyTime != null" >#{modifyTime, jdbcType=TIMESTAMP},</if>
</trim>
</insert>
<!-- SAR_BUSS_STAND_ATTR_INFO 列表总数-->
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
select count(1) from SAR_BUSS_STAND_ATTR_INFO
<include refid="Base_Where_Clause"/>
</select>
<!-- 查询SAR_BUSS_STAND_ATTR_INFO列表 -->
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List" /> from
(select tmp_tb.* from
(select <include refid="Base_Column_List" /> from SAR_BUSS_STAND_ATTR_INFO
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
) tmp_tb limit ${pager.startIndex-1},${pageSize}) a
</select>
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List"/> from SAR_BUSS_STAND_ATTR_INFO
<include refid="Base_Where_Clause"/>
<if test="pager.productNameLike != null and pager.productNameLike != ''">
and PRODUCT_NAME like concat(concat('%',#{pager.productNameLike}),'%')
</if>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
</select>
<!-- 新增字段-->
<insert id="alterStandAttr" parameterType="java.lang.String" >
alter table SAR_BUSS_STAND_ATTR_INFO
add ${fieldInfo}
</insert>
<!-- 删除字段-->
<insert id="deleteStandAttr" parameterType="java.lang.String" >
alter table SAR_BUSS_STAND_ATTR_INFO
drop COLUMN ${fieldInfo}
</insert>
<!-- 查询表中已存在字段-->
<select id="selectStandAttrColumn" resultType="java.lang.Integer" parameterType="java.lang.String">
SELECT COUNT(*)
FROM information_schema.columns
WHERE TABLE_NAME = 'SAR_BUSS_STAND_ATTR_INFO' AND COLUMN_NAME = #{columnName}
</select>
<!-- 修改字段长度-->
<update id="updateAttrLen" parameterType="java.lang.String" >
ALTER table SAR_BUSS_STAND_ATTR_INFO
MODIFY ${fieldInfo}
</update>
<!-- 查询字段及对应数据-->
<select id="selectStandFieldAndData" resultType="Map">
SELECT ${fieldInfo}
FROM SAR_BUSS_STAND_ATTR_INFO
WHERE valid_flag=0 and stand_id = #{standId}
</select>
<insert id="insertStandAttr" parameterType="java.lang.String" >
insert into SAR_BUSS_STAND_ATTR_INFO(${fieldInfo})
values (${fieldValue})
</insert>
<update id="deleteStandAttrByStandId" parameterType="java.lang.String" >
delete from SAR_BUSS_STAND_ATTR_INFO
where stand_id = #{standId}
</update>
<update id="updateStandInfo" parameterType="java.lang.String" >
update SAR_BUSS_STAND_ATTR_INFO set ${field}=#{value}
where stand_id = #{standId}
</update>
<select id="selectFieldValByStandId" resultType="java.lang.String" parameterType="java.lang.String">
SELECT ${field}
FROM SAR_BUSS_STAND_ATTR_INFO
WHERE stand_id = #{standId} and valid_flag=0
</select>
</mapper>