sqlmap-service.xml
1.01 KB
<?xml version="1.0" encoding="UTF-8"?>
<sqlMap namespace="service">
<insert id="set">
INSERT INTO `#table#` (#fields#) VALUES (#string#) ON DUPLICATE KEY UPDATE #upstring#
</insert>
<update id="update">
UPDATE `#table#` SET #upstring# WHERE #where#
</update>
<delete id="del">
DELETE FROM `#table#` WHERE #condition#
</delete>
<select id="getList">
SELECT * FROM `#table#` #condition# #order# #limits#
</select>
<select id="getOne">
SELECT #column# FROM `#table#` WHERE #condition# LIMIT 0,1
</select>
<select id="getListTotal">
SELECT COUNT(*) FROM `#table#` #condition# LIMIT 1
</select>
<select id="getListByIds">
SELECT * FROM `#table#` WHERE #column# IN (#ids#) #order#
</select>
<select id="getDistinctTotal">
SELECT COUNT( DISTINCT(`#distinct_column#`) ) FROM `#table#` #condition#
</select>
<update id="updateDateByQuery">
UPDATE `#table#` SET #upstring# WHERE #where#
</update>
<update id="inc">
UPDATE `#table#` SET #column# = #column# + :step #condition#
</update>
</sqlMap>